/* cerEbro · sistema visual
   Oscuro por defecto (negro y casi negro), claro opcional. Grises para la jerarquía; azul eléctrico solo para
   selección, foco y acciones principales; verde solo para confirmar o indicar un estado correcto.
   Escala de espacio: 4 · 8 · 12 · 16 · 24 · 32 · 48. Radios: 8 · 12 · 16. Bordes de 1 px. */
:root, :root[data-theme="dark"] {
  --bg: #0a0b0d; --surface: #111317; --surface-2: #181b20; --line: #22262d; --line-2: #2f343c;
  --text: #eceef1; --muted: #a3a9b3; --faint: #737a85;
  --accent: #3d7eff; --accent-text: #79a6ff; --accent-soft: rgba(61, 126, 255, .14); --accent-ink: #ffffff;
  --ok: #4fb286; --ok-soft: rgba(79, 178, 134, .14); --warn: #d6a24a; --bad: #e0716b;
  --brain: #6b7380; --brain-soft: #3a4049; --area: #8b929d;
  --scrim: rgba(0, 0, 0, .62); --pop-shadow: 0 16px 48px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f7f8; --surface: #ffffff; --surface-2: #eff1f3; --line: #e2e5e9; --line-2: #cdd2d9;
  --text: #121418; --muted: #575e69; --faint: #858c96;
  --accent: #1f5fff; --accent-text: #1a53e0; --accent-soft: rgba(31, 95, 255, .1); --accent-ink: #ffffff;
  --ok: #23845a; --ok-soft: rgba(35, 132, 90, .1); --warn: #a66a00; --bad: #c2433b;
  --brain: #8c939e; --brain-soft: #c9ced5; --area: #8b929d;
  --scrim: rgba(18, 20, 24, .4); --pop-shadow: 0 16px 48px rgba(20, 24, 32, .14);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] {
    --bg: #f6f7f8; --surface: #ffffff; --surface-2: #eff1f3; --line: #e2e5e9; --line-2: #cdd2d9;
    --text: #121418; --muted: #575e69; --faint: #858c96;
    --accent: #1f5fff; --accent-text: #1a53e0; --accent-soft: rgba(31, 95, 255, .1); --accent-ink: #ffffff;
    --ok: #23845a; --ok-soft: rgba(35, 132, 90, .1); --warn: #a66a00; --bad: #c2433b;
    --brain: #8c939e; --brain-soft: #c9ced5; --area: #8b929d;
    --scrim: rgba(18, 20, 24, .4); --pop-shadow: 0 16px 48px rgba(20, 24, 32, .14);
    color-scheme: light;
  }
}
:root {
  --font: 'Segoe UI Variable Text', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Roboto, system-ui, sans-serif;
  --font-display: 'Segoe UI Variable Display', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Roboto, system-ui, sans-serif;
  --r-s: 8px; --r: 12px; --r-l: 16px;
  --ease: cubic-bezier(.2, .7, .2, 1); --fast: 140ms; --med: 220ms;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.5; -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
body { overflow-x: hidden; transition: background-color var(--med), color var(--med); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ic { flex: none; vertical-align: middle; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; z-index: 99; background: var(--surface); padding: 8px 12px; border-radius: var(--r-s); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); }
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Estructura ---------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 16px; padding-top: env(safe-area-inset-top);
  background: var(--bg); border-bottom: 1px solid transparent; transition: border-color var(--med); }
.topbar.scrolled { border-bottom-color: var(--line); }
.brand { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-family: var(--font-display); font-size: 17px; font-weight: 600; letter-spacing: -.01em; padding: 6px 8px 6px 4px; margin-left: -4px; border-radius: var(--r-s); }
.brand:hover { text-decoration: none; background: var(--surface); }
.brand b { color: var(--accent-text); font-weight: 650; }
.brand .back { color: var(--muted); }
.demo-badge { font-size: 11px; font-weight: 600; letter-spacing: .08em; border: 1px solid var(--warn); color: var(--warn); padding: 1px 6px; border-radius: 6px; }
.top-actions { margin-left: auto; display: flex; gap: 2px; align-items: center; }
.tb { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 40px; min-width: 40px; justify-content: center; padding: 0 10px; border: 0; border-radius: var(--r-s);
  background: transparent; color: var(--muted); font-size: 14.5px; cursor: pointer; transition: background-color var(--fast), color var(--fast); }
.tb:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.tb.on { color: var(--text); }
.tb .lbl { display: none; }
@media (min-width: 760px) { .tb .lbl { display: inline; } }
.tb .pip { position: absolute; top: 8px; right: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.sync-pill { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 10px; border: 0; background: transparent; border-radius: var(--r-s); color: var(--faint); font-size: 13px; cursor: pointer; }
.sync-pill:hover { background: var(--surface); color: var(--muted); }
.sync-pill .dot { width: 7px; height: 7px; }
.sync-pill .txt { white-space: nowrap; display: none; }
@media (min-width: 760px) { .sync-pill .txt { display: inline; } }
main { flex: 1; padding: 8px 16px calc(96px + var(--safe-b)); width: 100%; max-width: 880px; margin: 0 auto; outline: none; min-width: 0; }
main.is-map { max-width: none; padding: 0 0 24px; display: flex; flex-direction: column; }
/* Sección YouTube: la Bitácora ocupa todo el espacio bajo la barra superior (ella tiene su propio desplazamiento). */
main.is-frame { max-width: none; padding: 0; }
.yt-frame { display: block; width: 100%; height: calc(100vh - 56px - env(safe-area-inset-top, 0px)); height: calc(100dvh - 56px - env(safe-area-inset-top, 0px)); border: 0; background: var(--bg); }
/* Canal de YouTube en Proyectos: la tarjeta entera es el acceso (como los nodos del cerebro). */
.yt-tile { display: flex; align-items: center; gap: 16px; color: var(--text); text-decoration: none; transition: border-color var(--fast), background-color var(--fast); }
.yt-tile:hover, .yt-tile:focus-visible { text-decoration: none; border-color: var(--accent); }
.yt-mark { flex: none; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); color: var(--brain); transition: color var(--fast), border-color var(--fast); }
.yt-mark svg { width: 34px; height: 34px; }
.yt-tile:hover .yt-mark { color: var(--accent-text); border-color: var(--accent); }
.yt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.yt-name { font-family: var(--font-display); font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.yt-next { color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yt-kpis { display: flex; gap: 18px; margin-top: 6px; color: var(--faint); font-size: 12.5px; }
.yt-kpis b { color: var(--text); font-size: 15.5px; font-weight: 600; margin-right: 5px; font-variant-numeric: tabular-nums; }
.yt-go { flex: none; display: inline-flex; align-items: center; gap: 2px; color: var(--muted); font-size: 14px; }
.yt-tile:hover .yt-go { color: var(--accent-text); }
@media (max-width: 560px) { .yt-tile { gap: 12px; } .yt-mark { width: 46px; height: 46px; } .yt-mark svg { width: 28px; height: 28px; } .yt-go { font-size: 0; } .yt-kpis { gap: 12px; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.view-in { animation: viewIn var(--med) var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }
.fab { position: fixed; right: 20px; bottom: calc(20px + var(--safe-b)); z-index: 25; width: 52px; height: 52px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); cursor: pointer; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); transition: transform var(--fast) var(--ease), opacity var(--fast); }
.fab:hover { transform: translateY(-1px); } .fab:active { transform: scale(.94); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--area); }

/* ---------- Tipografía y bloques ---------- */
h1 { font-family: var(--font-display); font-size: 28px; font-weight: 600; letter-spacing: -.015em; line-height: 1.2; margin: 20px 0 6px; }
h2 { font-size: 17px; font-weight: 600; margin: 0; letter-spacing: -.005em; }
h3 { font-size: 12.5px; margin: 20px 0 8px; color: var(--faint); font-weight: 600; text-transform: uppercase; letter-spacing: .07em; }
.sub { color: var(--muted); margin: 0 0 20px; max-width: 62ch; }
p { max-width: 72ch; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 18px 20px; margin: 14px 0; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.card-h h2 { flex: 1; }
.card-h .link { font-size: 14px; }
.grid2 { display: grid; gap: 14px; grid-template-columns: 1fr; margin: 14px 0; }
.grid2 > .card { margin: 0; }
@media (min-width: 720px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 14px; } .tiny { font-size: 12.5px; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; line-height: 1.5; padding: 1px 9px; border-radius: 99px; background: transparent; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.pill.area { background: transparent !important; color: var(--muted); }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; min-height: 42px; border-radius: var(--r); border: 1px solid var(--line-2); background: transparent;
  cursor: pointer; font-size: 15px; color: var(--text); text-decoration: none; transition: background-color var(--fast), border-color var(--fast), transform var(--fast); }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; }
.btn.small { padding: 0 12px; min-height: 34px; font-size: 14px; border-radius: var(--r-s); }
.btn:disabled { opacity: .45; cursor: default; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-s); border: 0; background: transparent; cursor: pointer; color: var(--muted); transition: background-color var(--fast), color var(--fast); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ---------- Listas ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.item { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item .main { flex: 1; min-width: 0; cursor: pointer; }
.item .main:hover .t { color: var(--accent-text); }
.item .t { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color var(--fast); }
.item .s { display: block; font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item.done .t { text-decoration: line-through; color: var(--faint); }
.item > .dot { background: var(--line-2) !important; width: 6px; height: 6px; margin: 0 5px; }
.tick { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line-2); background: transparent; cursor: pointer; display: grid; place-items: center; color: transparent; flex: none; transition: border-color var(--fast), background-color var(--fast); }
.tick:hover { border-color: var(--ok); color: var(--ok); }
.item.done .tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.when { font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.when.over { color: var(--bad); }
.empty { color: var(--faint); font-size: 14.5px; padding: 8px 0; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.chip { border: 1px solid var(--line-2); background: transparent; border-radius: 99px; padding: 6px 13px; font-size: 14px; cursor: pointer; color: var(--muted); transition: all var(--fast); }
.chip:hover { color: var(--text); }
.chip.on { background: var(--accent-soft); color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }

/* ---------- Captura ---------- */
.capture { display: flex; gap: 8px; align-items: flex-end; }
.capture textarea { flex: 1; resize: none; min-height: 50px; max-height: 160px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--bg); padding: 13px 14px; }
.capture textarea:focus { outline: none; border-color: var(--accent); }
.rules-note { font-size: 12.5px; color: var(--faint); margin-top: 8px; display: flex; gap: 6px; align-items: center; }
.proposal { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-top: 12px; background: var(--surface-2); }
.reasons { margin: 6px 0 0; padding-left: 18px; font-size: 14px; color: var(--muted); }

/* ---------- Formularios ---------- */
.form { display: grid; gap: 14px; }
.field label { display: block; font-size: 13.5px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.field .help { font-size: 12.5px; color: var(--faint); margin-top: 4px; }
.field input:not([type]), .field input[type=text], .field input[type=url], .field input[type=number], .field input[type=date], .field input[type=time], .field input[type=datetime-local], .field input[type=search], .field input[type=email], .field input[type=password], .field input[type=tel], .field select, .field textarea, .input {
  width: 100%; padding: 10px 12px; border-radius: var(--r-s); border: 1px solid var(--line-2); background: var(--bg); min-height: 44px; transition: border-color var(--fast); }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus, .sel-mini:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field textarea { min-height: 96px; resize: vertical; }
.field.inline { display: flex; align-items: center; gap: 10px; } .field.inline label { margin: 0; color: var(--text); font-size: 15px; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 18px; height: 18px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .two { grid-template-columns: 1fr; } }
.req::after { content: ' *'; color: var(--bad); }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; position: sticky; bottom: 0; background: var(--surface); padding: 12px 0 2px; }
.stars button { border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--line-2); padding: 0 2px; }
.stars button.on { color: var(--accent); }

/* ---------- Modal ---------- */
.modal { border: 1px solid var(--line); border-radius: var(--r-l); padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 48px); background: var(--surface); color: var(--text); box-shadow: var(--pop-shadow); }
.modal[open] { animation: modalIn var(--med) var(--ease); }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.99); } }
.modal::backdrop { background: var(--scrim); }
.modal-in { padding: 20px 20px 16px; overflow-y: auto; max-height: calc(100vh - 48px); }
.modal-h { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; } .modal-h h2 { flex: 1; font-size: 18px; }
@media (max-width: 600px) { .modal { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: var(--r-l) var(--r-l) 0 0; border-bottom: 0; } .modal-in { padding-bottom: calc(16px + var(--safe-b)); } }
.menu-list { display: grid; gap: 2px; }
.menu-list a, .menu-list button { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 10px; border-radius: var(--r-s); color: var(--text); background: transparent; border: 0; cursor: pointer; text-align: left; font-size: 15.5px; }
.menu-list a:hover, .menu-list button:hover { background: var(--surface-2); text-decoration: none; }
.menu-list .ic { color: var(--muted); }
.menu-list .n { margin-left: auto; color: var(--faint); font-size: 13.5px; }
.menu-list hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

/* ---------- Avisos ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + var(--safe-b)); z-index: 60; display: grid; gap: 8px; width: min(520px, calc(100vw - 24px)); }
.toast { background: var(--surface-2); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--r); padding: 11px 14px; display: flex; align-items: center; gap: 10px; box-shadow: var(--pop-shadow); animation: up var(--med) var(--ease); font-size: 14.5px; }
.toast button { background: none; border: 0; color: var(--accent-text); font-weight: 600; cursor: pointer; padding: 4px 6px; }
.toast .msg { flex: 1; }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); border-left: 2px solid var(--warn); color: var(--text); margin: 12px 0; font-size: 14.5px; }
.banner > .ic { color: var(--warn); margin-top: 1px; }
.banner.bad { border-left-color: var(--bad); } .banner.bad > .ic { color: var(--bad); }
.banner.info { border-left-color: var(--accent); } .banner.info > .ic { color: var(--accent-text); }
.banner.okb { border-left-color: var(--ok); } .banner.okb > .ic { color: var(--ok); }

/* ---------- Mapa de entrada: el cerebro ---------- */
.map { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 16px 0; }
.map-stage { width: 100%; max-width: 1180px; transform-origin: 50% 50%; transition: transform 200ms var(--ease), opacity 180ms var(--ease); }
.map-stage svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.map.leaving .map-stage { transform: scale(1.06); opacity: 0; }
.map.enter .map-stage { animation: mapIn 260ms var(--ease); }
@keyframes mapIn { from { opacity: 0; transform: scale(.975); } }
.b-line { fill: none; stroke: var(--brain); stroke-width: calc(1.4 * var(--k, 1)); stroke-linecap: round; stroke-linejoin: round; }
.b-shape { fill: var(--bg); stroke: var(--brain); stroke-width: calc(1.6 * var(--k, 1)); stroke-linejoin: round; transition: fill var(--med); }
.b-fine { fill: none; stroke: var(--brain-soft); stroke-width: calc(1.2 * var(--k, 1)); stroke-linecap: round; }
.b-hit { fill: transparent; cursor: pointer; }
.node { cursor: pointer; outline: none; }
.node .halo { fill: url(#haloG); opacity: 0; transition: opacity var(--med) var(--ease); }
.node .anchor { fill: var(--bg); stroke: var(--muted); stroke-width: 1.4; transition: stroke var(--fast), fill var(--fast); vector-effect: non-scaling-stroke; }
.node .conn { fill: none; stroke: var(--line-2); stroke-width: 1.2; transition: stroke var(--fast) var(--ease); }
.node .lbl { fill: var(--text); font-family: var(--font-display); font-weight: 500; letter-spacing: -.005em; transition: fill var(--fast); }
.node .desc { fill: var(--muted); font-size: 12.5px; opacity: 0; transition: opacity var(--med); }
.node .flag { fill: var(--accent); }
.node .hit { fill: transparent; }
.node.on .halo { opacity: 1; }
.node.on .anchor { stroke: var(--accent); fill: var(--accent); }
.node.on .conn { stroke: var(--accent); }
.node.on .lbl { fill: var(--accent-text); }
.node.on .desc { opacity: 1; }
.node:focus-visible .lbl { text-decoration: underline; text-underline-offset: 4px; }
.node:active .lbl { opacity: .7; }
.map.intro .b-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 900ms var(--ease) forwards; }
.map.intro .b-shape { fill-opacity: 0; animation: draw 900ms var(--ease) forwards, fillIn 500ms var(--ease) 350ms forwards; }
.map.intro .node .conn { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 520ms var(--ease) forwards; animation-delay: calc(380ms + var(--i) * 40ms); }
.map.intro .node .lbl, .map.intro .node .anchor, .map.intro .node .flag { opacity: 0; animation: fade 360ms var(--ease) forwards; animation-delay: calc(560ms + var(--i) * 40ms); }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fillIn { to { fill-opacity: 1; } }
@keyframes fade { to { opacity: 1; } }
.home-capture { width: min(560px, calc(100% - 32px)); margin: 8px auto 0; display: flex; align-items: center; gap: 4px; border: 1px solid var(--line-2); border-radius: 99px; padding: 4px 4px 4px 18px; background: var(--surface); transition: border-color var(--fast), box-shadow var(--fast); }
.home-capture:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.home-capture input { flex: 1; border: 0; background: transparent; min-height: 44px; font-size: 16px; outline: none; min-width: 0; }
.home-capture input::placeholder { color: var(--faint); }
.home-capture button { width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; background: transparent; color: var(--muted); cursor: pointer; flex: none; transition: background-color var(--fast), color var(--fast); }
.home-capture button:hover, .home-capture:focus-within button { background: var(--accent); color: var(--accent-ink); }
.map-foot { display: flex; justify-content: center; gap: 18px; margin-top: 16px; font-size: 13px; color: var(--faint); }
.map-foot button, .map-foot a { background: none; border: 0; padding: 6px 4px; color: var(--faint); cursor: pointer; font-size: 13px; }
.map-foot button:hover, .map-foot a:hover { color: var(--text); text-decoration: none; }
.map-list { list-style: none; padding: 0; margin: 16px auto 0; width: min(520px, calc(100% - 32px)); }
.map-list a { display: flex; align-items: baseline; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--line); color: var(--text); }
.map-list a:hover { color: var(--accent-text); text-decoration: none; }
.map-list .d { color: var(--muted); font-size: 14px; flex: 1; text-align: right; }

/* ---------- Encabezado de sección ---------- */
.page-h { margin: 20px 0 18px; }
.page-h h1 { margin: 0; }
.page-h .sub { margin: 6px 0 0; }
.page-h .row { margin-top: 12px; }

/* ---------- Salud y cifras ---------- */
.body-fig { display: grid; grid-template-columns: 140px 1fr; gap: 20px; align-items: center; }
@media (max-width: 480px) { .body-fig { grid-template-columns: 100px 1fr; gap: 14px; } }
.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.metric { background: transparent; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; cursor: pointer; text-align: left; transition: border-color var(--fast); }
.metric:hover { border-color: var(--line-2); }
.metric .k { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; } .metric .v { font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; } .metric .a { font-size: 12px; color: var(--faint); }
.bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; } .bar > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.bar.over > i { background: var(--bad); }
.spark { width: 100%; height: 70px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpi { padding: 2px 0; } .kpi + .kpi { border-left: 1px solid var(--line); padding-left: 16px; } .kpi .k { font-size: 13px; color: var(--muted); } .kpi .v { font-family: var(--font-display); font-size: 24px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi .v { white-space: nowrap; }
@media (max-width: 480px) { .kpi .v { font-size: 15.5px; } .kpi + .kpi { padding-left: 8px; } .kpis { gap: 6px; } .card { padding: 16px; } }
table.t { width: 100%; border-collapse: collapse; font-size: 14.5px; } table.t td, table.t th { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: left; } table.t .r { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Calendario ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .h { font-size: 12px; color: var(--faint); text-align: center; padding: 4px 0; text-transform: uppercase; letter-spacing: .05em; }
.cal .d { min-height: 68px; background: transparent; border: 1px solid var(--line); border-radius: var(--r-s); padding: 5px 6px; font-size: 12px; cursor: pointer; overflow: hidden; color: var(--text); transition: border-color var(--fast); }
.cal .d:hover { border-color: var(--line-2); text-decoration: none; }
.cal .d.out { opacity: .4; } .cal .d.today { border-color: var(--accent); } .cal .d.sel { background: var(--surface-2); }
.cal .d .num { font-weight: 600; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.cal .d.today .num { color: var(--accent-text); }
.cal .ev { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 4px; padding: 0 4px; margin-top: 2px; font-size: 11px; background: var(--surface-2) !important; color: var(--muted); }
@media (max-width: 600px) { .cal .d { min-height: 48px; } .cal .ev { height: 4px; padding: 0; font-size: 0; background: var(--line-2) !important; } }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(190px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.kanban .col { border: 1px solid var(--line); border-radius: var(--r); padding: 10px; min-height: 120px; }
.kanban .col h3 { margin: 0 0 8px; }
.kanban .kc { background: var(--surface-2); border-radius: var(--r-s); padding: 9px 10px; margin-bottom: 6px; cursor: pointer; font-size: 14px; }
.kanban .kc:hover { color: var(--accent-text); }
.meter { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; display: flex; } .meter i { display: block; height: 100%; }
.code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 15px; letter-spacing: .5px; background: var(--bg); border: 1px solid var(--line); padding: 12px; border-radius: var(--r-s); word-break: break-all; user-select: all; }
details > summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.prio-num { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--accent); color: var(--accent-text); font-size: 12px; font-weight: 600; display: grid; place-items: center; flex: none; }
.view-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); padding: 3px; }
.view-toggle button { border: 0; background: transparent; padding: 6px 12px; border-radius: var(--r-s); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; font-size: 14px; color: var(--muted); }
.view-toggle button.on { background: var(--surface-2); color: var(--text); }

/* ---------- Opciones de sincronización ---------- */
.sync-opt { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.sync-opt > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 4px 0; color: var(--text); }
.sync-opt > summary::-webkit-details-marker { display: none; }
.sync-opt > summary::before { content: '›'; display: inline-block; width: 12px; transition: transform var(--fast); color: var(--muted); }
.sync-opt[open] > summary::before { transform: rotate(90deg); }

/* Selectores sueltos (fuera de .field) y acciones dentro de una propuesta */
select { border: 1px solid var(--line-2); background: var(--bg); border-radius: var(--r-s); padding: 6px 10px; min-height: 36px; color: var(--text); }
select:focus { outline: none; border-color: var(--accent); }
.proposal .form-actions { background: transparent; }

/* Mi día: el canal en la lista de hoy y la vista previa de la semana (pequeña, sin tarjeta). */
.yt-today .yt-ico { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); color: var(--muted); }
.today-card .undated { margin-top: 12px; }
.today-card .undated > summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.week-peek { margin: 18px 4px 8px; }
.week-peek .card-h h2 { font-size: 15px; color: var(--muted); font-weight: 600; }
.week-peek ul { list-style: none; margin: 6px 0 0; padding: 0; }
.wk-day { display: flex; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.wk-day:first-child { border-top: 0; }
.wk-d { flex: none; width: 92px; color: var(--muted); }
.wk-items { flex: 1; min-width: 0; }
.wk-it { color: var(--text); }
.wk-it .ic { vertical-align: -2px; color: var(--muted); }

/* Hoy, bajo el cerebro: pocas líneas, sin tarjeta, alineado con el campo de captura. */
.home-today { width: min(560px, calc(100% - 32px)); margin: 18px auto 0; }
.hb-h { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px 6px; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.hb-h span { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.hb-h a { font-size: 13px; color: var(--muted); }
.hb-h a:hover { color: var(--accent-text); text-decoration: none; }
.hb-row { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px; border-radius: var(--r-s); color: var(--text); }
a.hb-row:hover, .hb-row:hover { background: var(--surface); text-decoration: none; }
.hb-ic { flex: none; width: 22px; height: 22px; display: grid; place-items: center; color: var(--muted); }
.hb-tick { flex: none; width: 20px; height: 20px; margin: 1px; border-radius: 50%; border: 1.5px solid var(--line-2); background: transparent; cursor: pointer; }
.hb-tick:hover { border-color: var(--ok); }
.hb-t { flex: 1; min-width: 0; color: var(--text); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-t:hover { text-decoration: none; color: var(--accent-text); }
.hb-w { flex: none; color: var(--faint); font-size: 13px; }
.hb-w.late { color: var(--bad); }
.hb-empty { margin: 8px 4px; color: var(--faint); font-size: 14px; }
.hb-more { display: block; padding: 6px 4px 0; font-size: 13px; color: var(--muted); }

/* Calendario: cabecera con Mes / Semana, vista semanal y publicaciones del canal en gris. */
.cal-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 12px; }
.cal-h h1 { margin: 4px 0; flex: 0 0 auto; }
.cal-nav { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.cal-nav b { min-width: 120px; text-align: center; font-weight: 600; }
.seg { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.seg-b { padding: 5px 14px; border-radius: 8px; font-size: 14px; color: var(--muted); }
.seg-b:hover { color: var(--text); text-decoration: none; }
.seg-b.on { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.cal .ev.yt { background: transparent !important; color: var(--faint) !important; font-style: italic; }
.cal-yt .cal-yt-ic { flex: none; width: 24px; height: 24px; display: grid; place-items: center; color: var(--faint); }
.cal-yt .main { color: var(--muted); }
.cal-yt .main .t { font-style: italic; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.wk-col { min-height: 220px; border: 1px solid var(--line); border-radius: var(--r-s); padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.wk-col.today { border-color: var(--accent); }
.wk-col.past { opacity: .6; }
.wk-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); padding: 0 2px 4px; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.wk-col.today .wk-head span { color: var(--accent-text); font-weight: 600; }
.wk-add { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; color: var(--faint); }
.wk-add:hover { background: var(--surface-2); color: var(--text); }
.wk-ev { display: flex; flex-direction: column; gap: 1px; padding: 5px 6px; border-radius: 6px; background: var(--surface); color: var(--text); font-size: 13px; line-height: 1.3; }
.wk-ev:hover { background: var(--surface-2); text-decoration: none; }
.wk-ev .wk-h { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.wk-ev .wk-h:empty { display: none; }
.wk-ev .wk-t .ic { vertical-align: -2px; color: var(--faint); }
.wk-ev.yt { background: transparent; color: var(--faint); font-style: italic; box-shadow: inset 0 0 0 1px var(--line); }
.wk-ev.done { opacity: .5; }
.wk-empty { color: var(--line-2); font-size: 13px; padding: 2px 4px; }
@media (max-width: 900px) {
  .week-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .wk-col { min-height: 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 10px 2px; flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
  .wk-col.today { border-color: var(--line); }
  .wk-head { width: 100%; border: 0; padding: 0; margin: 0; font-size: 14px; }
  .wk-ev { flex: 1 1 100%; flex-direction: row; gap: 10px; padding: 8px 10px; font-size: 14.5px; }
  .wk-ev .wk-h { font-size: 13px; min-width: 40px; }
  .cal-nav { margin-left: 0; width: 100%; justify-content: space-between; }
}

/* Salud: encuesta semanal. */
.survey-call { display: flex; align-items: center; gap: 16px; justify-content: space-between; flex-wrap: wrap; border-color: var(--accent); }
.health-notes { margin: 6px 0 8px; padding-left: 18px; font-size: 14px; }
.health-notes li { margin: 3px 0; }
.survey fieldset { border: 0; padding: 0; margin: 0 0 16px; }
.survey legend { font-weight: 600; font-size: 15px; margin-bottom: 8px; display: flex; gap: 6px; align-items: center; }
.survey .chip { cursor: pointer; }
.hb-link { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font: inherit; }

/* Economía visual: tarjetas de dinero, barra del mes, pagos en bloques e ideas. */
.eco-sec { margin: 22px 0; }
.eco-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.eco-h h2 { margin: 0; font-size: 17px; }
.pay-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.pay-chip { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 10px 12px; min-width: 120px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.pay-chip .d { font-size: 12px; color: var(--accent-text); }
.pay-chip .t { font-size: 13.5px; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pay-chip b { font-size: 15px; font-variant-numeric: tabular-nums; }
.eco-ideas { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.eco-ideas li { padding: 10px 14px; border-left: 2px solid var(--line-2); background: var(--surface); border-radius: 0 var(--r-s) var(--r-s) 0; font-size: 14.5px; }
.eco-ideas li.fuerte { border-left-color: var(--warn); }
.eco-ideas li[role=button] { cursor: pointer; }
@media (max-width: 640px) {
  .eco-imps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.eco-h { flex-wrap: wrap; }

/* Economía (vigía): estado, para mirar, lo importante y revisión */
.eco-estado { display: flex; align-items: center; gap: 10px; margin: 4px 0 18px; font-size: 17px; }
.eco-estado .muted { font-size: 14.5px; }
.eco-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); flex: none; }
.eco-dot.warn { background: var(--warn); }
.eco-k { font-size: 13px; font-weight: 500; color: var(--muted); margin: 0 0 8px; letter-spacing: .01em; text-transform: none; }
.eco-h .eco-k { margin: 0; font-size: 13px; }
.eco-mirar { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.eco-mirar li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.eco-mirar li + li { border-top: 1px solid var(--line); }
.eco-mirar li > svg, .eco-rev > svg { color: var(--muted); flex: none; }
.eco-mirar .main, .eco-rev .main { flex: 1; min-width: 0; }
.eco-mirar .t, .eco-rev .t { font-size: 15px; }
.eco-mirar .s, .eco-rev .s { font-size: 13px; color: var(--muted); }
.eco-mirar .acts, .eco-rev .acts { display: flex; gap: 6px; align-items: center; flex: none; }
.eco-imps { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.eco-imp { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.eco-imp:hover { border-color: var(--line-2); }
.eco-imp > svg { color: var(--muted); margin-bottom: 4px; }
.eco-imp .k { font-size: 13.5px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eco-imp b { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.eco-imp .s { font-size: 12px; color: var(--faint); }
.eco-imp.vacio { border-style: dashed; background: transparent; }
.eco-todos { margin-top: 10px; font-size: 14px; }
.eco-rev { display: flex; align-items: center; gap: 12px; padding: 14px 0; margin-top: 22px; border-top: 1px solid var(--line); }
.eco-adds { display: grid; gap: 8px; }
.eco-add { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); color: var(--text); text-decoration: none; }
.eco-add:hover { border-color: var(--line-2); }
.eco-add > svg { color: var(--muted); flex: none; margin-top: 2px; }
.eco-add .s { display: block; font-size: 13px; color: var(--muted); }
.renta-out p { margin: 8px 0; }
.rev-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 10px 0 18px; }
.rev-kpis div { background: var(--surface-2); border-radius: var(--r-s); padding: 10px 12px; }
.rev-kpis b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.rev-kpis span { font-size: 12.5px; color: var(--muted); }
.rev-bars { list-style: none; margin: 0 0 18px; padding: 0; }
.rev-bars li { display: grid; grid-template-columns: 180px 1fr 70px; gap: 10px; align-items: center; padding: 5px 0; }
.rev-bars .lab { font-size: 14px; }
.rev-bars .lab small { display: block; font-size: 11.5px; color: var(--faint); }
.rev-bars .tr { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.rev-bars .tr i { display: block; height: 100%; background: var(--muted); border-radius: 5px; }
.rev-bars .n { text-align: right; font-variant-numeric: tabular-nums; font-size: 14px; }
.rev-tag { font-size: 11px; border: 1px solid var(--warn); color: var(--warn); border-radius: 99px; padding: 0 6px; margin-left: 4px; }
.rev-ahorro { padding: 10px 14px; background: var(--surface-2); border-radius: var(--r-s); font-size: 14.5px; }
@media (max-width: 560px) {
  .eco-mirar li { flex-wrap: wrap; }
  .eco-mirar .acts { width: 100%; justify-content: flex-end; }
  .rev-bars li { grid-template-columns: 1fr 64px; }
  .rev-bars .tr { grid-column: 1 / -1; grid-row: 2; }
}

/* ───────── Proyectos (espacios de trabajo) ───────── */
main.is-pj { max-width: 1240px; }
.pj-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin: 14px 0; }
.pj-card-t { font-weight: 600; font-size: 16px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-card-d { color: var(--muted); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pj-card-n { font-size: 13.5px; margin-top: 6px; display: flex; gap: 4px; align-items: center; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pj-card-f .sp { flex: 1; }
.pj-chip { display: inline-flex; align-items: center; gap: 3px; border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; color: var(--muted); }
.pj-card-new:hover { color: var(--text); }
.pj-more { margin: 14px 0; }
.pj-more > summary { cursor: pointer; color: var(--muted); font-size: 14.5px; padding: 6px 0; }
.pj-ico { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--surface-2) center / cover no-repeat; font-size: 20px; font-weight: 600; color: var(--muted); line-height: 1; }
.pj-ico.has-img { font-size: 0; }
.pj-ico.sm { width: 22px; height: 22px; border-radius: 6px; font-size: 12px; }
.pj-ico.lg { width: 64px; height: 64px; border-radius: 16px; font-size: 30px; }

.pj { display: grid; grid-template-columns: 200px minmax(0, 1fr); grid-template-areas: "head head" "rail body"; gap: 6px 28px; }
.pj-head { grid-area: head; display: grid; grid-template-columns: 1fr minmax(180px, 300px); grid-template-areas: "up up" "id find"; align-items: end; gap: 4px 16px; padding: 4px 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.pj-up { grid-area: up; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.pj-id { grid-area: id; display: flex; gap: 14px; align-items: center; min-width: 0; }
.pj-id-t { min-width: 0; }
.pj-id h1 { margin: 0; font-size: 24px; line-height: 1.2; overflow-wrap: anywhere; }
.pj-id .sub { margin: 2px 0 0; font-size: 14px; }
.pj-find { grid-area: find; position: relative; display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: var(--r-s); padding: 0 10px; background: var(--surface); color: var(--muted); }
.pj-find:focus-within { border-color: var(--accent); }
.pj-find input { border: 0; background: none; outline: none; padding: 8px 0; width: 100%; color: var(--text); }
.pj-found { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 20; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-s); box-shadow: var(--pop-shadow); padding: 4px; animation: popIn var(--fast) var(--ease); max-height: 60vh; overflow: auto; }
.pj-found a { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; color: var(--text); font-size: 14px; }
.pj-found a:hover, .pj-found a:focus { background: var(--surface-2); text-decoration: none; }
.pj-found small { margin-left: auto; color: var(--faint); }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px); } }
.pj-rail { grid-area: rail; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 64px; align-self: start; }
.pj-tab { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-s); color: var(--muted); font-size: 14.5px; transition: background-color var(--fast), color var(--fast); }
.pj-tab:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.pj-tab.on { background: var(--surface-2); color: var(--text); font-weight: 600; }
.pj-tab .n { margin-left: auto; font-size: 12px; color: var(--faint); font-weight: 400; }
.pj-railsep { height: 1px; background: var(--line); margin: 8px 6px; }
.pj-body { grid-area: body; min-width: 0; animation: viewIn var(--med) var(--ease); }
.pj-k { display: block; font-size: 12.5px; font-weight: 600; letter-spacing: .02em; color: var(--muted); margin: 0 0 8px; }
.pj-sec { margin: 22px 0; }
.pj-next { margin: 4px 0 18px; }
.pj-next-in { width: 100%; font-size: 19px; font-weight: 600; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 6px 0; outline: none; color: var(--text); }
.pj-next-in:focus { border-bottom-color: var(--accent); }
.pj-meta { margin: 8px 0 0; display: flex; align-items: center; gap: 6px; }
.pj-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.pj-tile { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--text); min-width: 0; transition: border-color var(--fast), transform var(--fast) var(--ease); }
.pj-tile:hover { text-decoration: none; border-color: var(--line-2); transform: translateY(-1px); }
.pj-tile > svg { color: var(--muted); margin-bottom: 4px; }
.pj-tile span { font-size: 14px; color: var(--muted); }
.pj-tile small { font-size: 12.5px; color: var(--faint); }
.pj-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.pj-recent { list-style: none; margin: 0; padding: 0; }
.pj-recent a { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); color: var(--text); }
.pj-recent a:hover { text-decoration: none; background: var(--surface); }
.pj-recent svg { color: var(--muted); flex: none; }
.pj-recent .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-recent .s { font-size: 12.5px; color: var(--faint); white-space: nowrap; }
.pj-empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.pj-empty h2 { color: var(--text); margin: 10px 0 6px; }
.pj-empty p { margin: 0 auto 16px; }
.pj-add { display: flex; gap: 8px; margin: 2px 0 14px; }
.pj-add input[name=t] { flex: 1; min-width: 0; }
.pj-add input, .pj-add select { border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); padding: 9px 12px; color: var(--text); }
.pj-add input:focus, .pj-add select:focus { border-color: var(--accent); outline: none; }
.pj-filtros { margin-bottom: 12px; }
.ideas { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.idea { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); animation: viewIn var(--med) var(--ease); transition: border-color var(--fast); }
.idea:hover { border-color: var(--line-2); }
.idea.usada { opacity: .7; }
.idea-main { padding: 14px 16px 8px; cursor: pointer; flex: 1; }
.idea-main b { display: block; font-size: 15.5px; margin-top: 4px; }
.idea-main p { margin: 6px 0 0; color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
.idea-main small { display: block; color: var(--faint); font-size: 12px; margin-top: 8px; }
.idea-k { font-size: 11.5px; color: var(--faint); border: 1px solid var(--line); border-radius: 99px; padding: 0 8px; }
.idea-acts { display: flex; justify-content: flex-end; gap: 6px; padding: 4px 10px 10px; }
.pj-star { color: var(--faint); }
.pj-star.on { color: var(--warn); }
.pj-star.on svg { fill: currentColor; }
.pj-opts { display: grid; gap: 8px; }
.pj-opt-b { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; transition: border-color var(--fast); }
.pj-opt-b:hover { border-color: var(--accent); }
.pj-opt-b > svg { color: var(--muted); flex: none; margin-top: 2px; }
.pj-opt-b small { display: block; color: var(--muted); font-size: 13px; }
.pj-mods { list-style: none; margin: 0 0 12px; padding: 0; }
.pj-mods li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pj-mods .input { flex: 1; min-width: 140px; }
.pj-mod-ic { color: var(--muted); display: grid; }
.ic.up { transform: rotate(-90deg); } .ic.down { transform: rotate(90deg); }
.pj-framebar { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-bottom: 1px solid var(--line); font-size: 14px; background: var(--bg); }
.pj-crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.yt-frame.with-bar { height: calc(100vh - 96px - env(safe-area-inset-top, 0px)); height: calc(100dvh - 96px - env(safe-area-inset-top, 0px)); }
.pj-pill { color: var(--text); }
.chip.gone, .pg-links li.gone a { opacity: .6; text-decoration: line-through; }

/* Documentos: árbol + texto */
.pj.is-docs { grid-template-columns: 170px minmax(0, 1fr); }
.pj-docs { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; min-height: 60vh; }
.pj-tree { border-right: 1px solid var(--line); padding-right: 12px; position: sticky; top: 64px; align-self: start; max-height: calc(100vh - 80px); overflow: auto; }
.tr-tools { display: flex; gap: 6px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.tr-root, .tr-kids ul { list-style: none; margin: 0; padding: 0; }
.tr-row { display: flex; align-items: center; gap: 2px; padding-left: calc(var(--lv, 0) * 14px); border-radius: 6px; position: relative; transition: background-color var(--fast); }
.tr-row:hover { background: var(--surface); }
.tr.on > .tr-row { background: var(--surface-2); }
.tr.on > .tr-row .tr-a { color: var(--text); font-weight: 600; }
.tr-car { width: 22px; height: 26px; flex: none; display: grid; place-items: center; border: 0; background: none; color: var(--faint); cursor: pointer; padding: 0; }
.tr-car svg { transition: transform var(--fast) var(--ease); }
.tr-car.open svg { transform: rotate(90deg); }
.tr-a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; padding: 5px 2px; color: var(--muted); font-size: 14px; }
.tr-a:hover { color: var(--text); text-decoration: none; }
.tr-a svg { flex: none; }
.tr-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-tag { color: var(--accent-text); display: grid; }
.tr-more { opacity: 0; width: 26px; height: 26px; transition: opacity var(--fast); }
.tr-row:hover .tr-more, .tr-more:focus-visible, .tr.on > .tr-row .tr-more { opacity: 1; }
.tr-kids { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--med) var(--ease); }
.tr-kids > ul { overflow: hidden; min-height: 0; }
.tr-kids.open { grid-template-rows: 1fr; }
.dragging { opacity: .4; }
.drop-antes > .tr-row, li.drop-antes:not(.tr) { box-shadow: inset 0 2px 0 var(--accent); }
.drop-despues > .tr-row, li.drop-despues:not(.tr) { box-shadow: inset 0 -2px 0 var(--accent); }
.drop-dentro > .tr-row, .drop-dentro.board-card, .tr-drop-root.drop-dentro { background: var(--accent-soft); }
.board-card.drop-antes { box-shadow: inset 3px 0 0 var(--accent); } .board-card.drop-despues { box-shadow: inset -3px 0 0 var(--accent); }
.tr-drop-root { margin-top: 8px; padding: 8px; border: 1px dashed var(--line); border-radius: 6px; color: var(--faint); font-size: 12px; text-align: center; display: none; }
.pj-tree:has(.dragging) .tr-drop-root { display: block; }
.pj-doc { min-width: 0; }
.pg { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 22px; }
.pg.split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 230px; }
.pg-insp.hide { display: none; }
.pg:has(.pg-insp.hide) { grid-template-columns: minmax(0, 1fr); }
.pg.split:has(.pg-insp.hide) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.pg-main { min-width: 0; }
.pg-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; }
.pg-crumbs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); min-width: 0; }
.pg-crumbs a { color: var(--muted); }
.pg-acts { display: flex; gap: 2px; }
.icon-btn.on { color: var(--accent-text); }
.pg-title { width: 100%; border: 0; background: none; outline: none; font-family: var(--font-display); font-size: 30px; font-weight: 650; line-height: 1.2; padding: 10px 0 6px; color: var(--text); }
.pg-title.as-h { margin: 0; }
.fd-syn { width: 100%; border: 1px solid transparent; background: none; color: var(--muted); resize: vertical; padding: 4px 0; outline: none; border-radius: 6px; }
.fd-syn:focus { border-color: var(--line); padding: 4px 8px; }
.fd-bar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 8px 0 14px; }
.fd-bar .sp { flex: 1; }
.fold-list .item > svg { color: var(--muted); flex: none; }
.ed-bar { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; padding: 4px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); position: sticky; top: 60px; z-index: 5; margin: 4px 0 10px; }
.ed-b { min-width: 32px; height: 30px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; font-size: 14px; }
.ed-b:hover { background: var(--surface-2); color: var(--text); }
.ed-sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.ed { position: relative; outline: none; font-family: Georgia, 'Iowan Old Style', 'Palatino Linotype', serif; font-size: 18.5px; line-height: 1.75; max-width: 68ch; min-height: 40vh; color: var(--text); caret-color: var(--accent); overflow-wrap: anywhere; }
.ed > p:only-child:has(> br:only-child)::before { content: attr(data-placeholder); color: var(--faint); pointer-events: none; position: absolute; }
.ed p { margin: 0 0 .9em; max-width: none; }
.ed h2 { font-family: var(--font-display); font-size: 1.35em; margin: 1.3em 0 .5em; line-height: 1.3; }
.ed h3 { font-family: var(--font-display); font-size: 1.12em; margin: 1.1em 0 .4em; }
.ed blockquote { margin: 1em 0; padding-left: 1em; border-left: 2px solid var(--line-2); color: var(--muted); font-style: italic; }
.ed hr { border: 0; text-align: center; margin: 1.6em 0; }
.ed hr::after { content: '* * *'; color: var(--faint); letter-spacing: .4em; }
.ed ul, .ed ol { padding-left: 1.4em; margin: 0 0 .9em; }
.ed.read { min-height: 0; font-size: 16.5px; }
.pg-foot { display: flex; justify-content: space-between; color: var(--faint); font-size: 12.5px; padding: 18px 0 8px; border-top: 1px solid var(--line); margin-top: 18px; max-width: 68ch; }
.pg-saved { display: inline-flex; align-items: center; gap: 6px; }
.pg-saved i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); transition: background-color 300ms var(--ease); }
.pg-saved[data-st="ok"] i { background: var(--ok); animation: savedPulse 900ms var(--ease); }
.pg-saved[data-st="sucio"] i { background: var(--warn); }
@keyframes savedPulse { 0% { transform: scale(1.8); } 100% { transform: scale(1); } }
.pg-insp { border-left: 1px solid var(--line); padding-left: 16px; position: sticky; top: 64px; align-self: start; display: flex; flex-direction: column; gap: 6px; animation: slideIn var(--med) var(--ease); }
@keyframes slideIn { from { opacity: 0; transform: translateX(10px); } }
.pg-insp textarea, .pg-insp select { width: 100%; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); padding: 8px; margin-bottom: 10px; color: var(--text); }
.pg-links { list-style: none; margin: 0 0 6px; padding: 0; font-size: 13.5px; }
.pg-links li { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 3px 0; }
.pg-links a { display: inline-flex; gap: 6px; align-items: center; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pg-ref { border-left: 1px solid var(--line); padding-left: 16px; position: sticky; top: 64px; align-self: start; max-height: calc(100vh - 80px); overflow: auto; animation: slideIn var(--med) var(--ease); }
.ref-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 10px; position: sticky; top: 0; background: var(--bg); }
.fil-prev img { max-width: 100%; border-radius: var(--r-s); margin-top: 12px; }
.fil-prev iframe { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: var(--r-s); margin-top: 12px; }
.cards-board { list-style: none; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.board-card { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; min-height: 130px; cursor: grab; transition: border-color var(--fast), transform var(--fast) var(--ease); }
.board-card:hover { border-color: var(--line-2); transform: translateY(-1px); }
.board-card a { color: var(--text); display: flex; gap: 6px; align-items: center; }
.board-card p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
.board-card small { color: var(--faint); font-size: 12px; }
.seguido { max-width: 68ch; }
.seg-sec { padding: 6px 0 18px; border-bottom: 1px dashed var(--line); margin-bottom: 18px; }
.seg-t { display: inline-block; font-family: var(--font-display); font-size: 20px; font-weight: 650; color: var(--text); margin-bottom: 8px; }
.seg-ed { min-height: 2em; }
.seg-folder { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; margin: 26px 0 8px; }
.ver-prev { border: 1px solid var(--line); border-radius: var(--r-s); padding: 14px; margin-top: 14px; max-height: 40vh; overflow: auto; }

/* Enfoque: solo el texto */
body.pj-focus .topbar, body.pj-focus .pj-head, body.pj-focus .pj-rail, body.pj-focus .pj-tree, body.pj-focus .pg-insp, body.pj-focus .pg-ref, body.pj-focus .pg-top, body.pj-focus .fab { display: none !important; }
body.pj-focus main.is-pj { max-width: 820px; padding-top: 6vh; }
body.pj-focus .pj, body.pj-focus .pj-docs, body.pj-focus .pg { display: block; }
body.pj-focus .ed { margin: 0 auto; font-size: 20px; }
body.pj-focus .pg-title, body.pj-focus .ed-bar, body.pj-focus .pg-foot { max-width: 68ch; margin-left: auto; margin-right: auto; }
body.pj-focus .ed-bar { opacity: .25; transition: opacity var(--fast); top: 8px; }
body.pj-focus .ed-bar:hover, body.pj-focus .ed-bar:focus-within { opacity: 1; }

/* En Documentos hace falta ancho para escribir: la barra del proyecto pasa arriba antes y el panel de detalles, debajo. */
@media (max-width: 1180px) {
  .pj.is-docs { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "rail" "body"; }
  .pj.is-docs .pj-rail { position: static; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 6px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .pj.is-docs .pj-tab { flex: none; padding: 7px 10px; }
  .pj.is-docs .pj-tab .n { margin-left: 2px; }
  .pj.is-docs .pj-railsep { width: 1px; height: auto; margin: 6px 2px; }
}
@media (max-width: 1080px) {
  .pg, .pg.split, .pg:has(.pg-insp.hide) { grid-template-columns: minmax(0, 1fr); }
  .pg.split .pg-ref { grid-row: 3; }
  .pg-insp, .pg-ref { position: static; border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 12px; max-height: none; }
}
@media (max-width: 900px) {
  .pj, .pj.is-docs { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "rail" "body"; }
  .pj-rail { position: static; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 6px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .pj-tab { flex: none; padding: 7px 10px; }
  .pj-tab .n { margin-left: 2px; }
  .pj-railsep { width: 1px; height: auto; margin: 6px 2px; }
  .pj-docs { grid-template-columns: minmax(0, 1fr); }
  .pj-tree { position: static; border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 10px; max-height: 40vh; }
  .pj-docs.es-texto .pj-tree { display: none; }
  .pg, .pg.split, .pg:has(.pg-insp.hide) { grid-template-columns: minmax(0, 1fr); }
  .pg-insp, .pg-ref { position: static; border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 12px; }
  .tr-more { opacity: 1; }
}
@media (max-width: 560px) {
  .pj-head { grid-template-columns: minmax(0, 1fr); grid-template-areas: "up" "id" "find"; }
  .pj-id h1 { font-size: 21px; }
  .pj-add { flex-wrap: wrap; }
  .pj-add input[name=t] { flex-basis: 100%; }
  .pg-title { font-size: 25px; }
  .ed { font-size: 17.5px; }
  .pj-cards { grid-template-columns: minmax(0, 1fr); }
  .pj-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pj-tile { padding: 12px; }
  .pj-tile small { display: none; }
}

/* Tarjeta de proyecto alta: foto arriba (o el icono en grande), texto debajo */
.pj-card-w { position: relative; display: flex; min-width: 0; }
.pj-card { flex: 1; display: flex; flex-direction: column; min-height: 300px; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); color: var(--text); text-align: left; font: inherit; cursor: pointer; min-width: 0; transition: border-color var(--fast), transform var(--fast) var(--ease); }
.pj-card:hover, .pj-card:focus-visible { border-color: var(--line-2); text-decoration: none; transform: translateY(-2px); }
.pj-cover { position: relative; flex: none; height: 150px; display: grid; place-items: center; background: var(--surface-2) center / cover no-repeat; border-bottom: 1px solid var(--line); }
.pj-cover.has-img { border-bottom-color: transparent; }
.pj-cover.has-img::after { content: ''; position: absolute; inset: auto 0 0 0; height: 40%; background: linear-gradient(transparent, rgba(0, 0, 0, .18)); pointer-events: none; }
.pj-cover-ico { font-size: 46px; line-height: 1; font-weight: 600; color: var(--muted); }
.pj-cover.has-img .pj-cover-ico { display: none; }
.pj-card-in { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px 16px 14px; min-width: 0; }
.pj-card-f { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; width: 100%; margin-top: auto; padding-top: 12px; font-size: 12px; color: var(--faint); }
.pj-card-foto { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); background: var(--bg); color: var(--muted); cursor: pointer; opacity: 0; transition: opacity var(--fast), color var(--fast); }
.pj-card-w:hover .pj-card-foto, .pj-card-foto:focus-visible { opacity: .92; }
.pj-card-foto:hover { color: var(--text); }
@media (hover: none) { .pj-card-foto { opacity: .85; } }
.pj-card-new { min-height: 300px; border-style: dashed; background: transparent; color: var(--muted); align-items: center; justify-content: center; text-align: center; padding: 24px; gap: 8px; }
.pj-card-new:hover { color: var(--text); }

/* Nuevo proyecto: dos campos, limpio */
.pj-new { display: grid; gap: 16px; min-width: min(420px, 100%); }
.pj-new-f { display: grid; gap: 6px; }
.pj-new-f > span { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.pj-new-f small { font-weight: 400; color: var(--faint); margin-left: 4px; }
.pj-new .input { font-size: 16px; padding: 11px 13px; }
.pj-new .input::placeholder { color: var(--faint); }
.pj-new-err { margin: -6px 0 0; color: var(--bad); font-size: 13px; }
.pj-new .form-actions { margin-top: 4px; }

/* Selector pequeño dentro de una línea (p. ej. «Tipo» en la captura) */
.sel-mini { min-height: 32px; padding: 4px 28px 4px 10px; border-radius: var(--r-s); border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font-size: 14px; margin-left: 6px; }

/* ───────── Economía › movimientos ───────── */
.mv { margin: 6px 0 26px; }
.mv-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 14px; }
.mv-mes { display: flex; align-items: center; gap: 4px; font-size: 15px; }
.mv-mes b { min-width: 130px; text-align: center; font-weight: 600; text-transform: capitalize; }
.mv-sum { display: flex; gap: 26px; }
.mv-sum div { display: flex; flex-direction: column; }
.mv-sum span { font-size: 12.5px; color: var(--muted); }
.mv-sum b { font-size: 24px; font-weight: 650; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.mv-sum b.in, .mv-amt.in { color: var(--ok); }
.mv-sum b.neg { color: var(--bad); }
.mv-add { display: grid; grid-template-columns: auto 110px minmax(0, 1fr) 170px 150px auto; gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.mv-add .input, .mv-edit .input { min-height: 40px; padding: 8px 10px; }
.mv-imp { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.mv-kind .seg-b, .mv-edit .seg-b { cursor: pointer; }
.mv-filtros { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 14px 0 4px; }
.mv-filtros .sel-mini { margin-left: auto; }
.mv-list { list-style: none; margin: 6px 0 0; padding: 0; }
.mv-day { display: flex; justify-content: space-between; padding: 16px 6px 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); text-transform: capitalize; font-variant-numeric: tabular-nums; }
.mv-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 0; transition: background-color var(--fast), opacity var(--med), transform var(--med) var(--ease); outline: none; }
.mv-row:hover, .mv-row:focus-visible { background: var(--surface); }
.mv-row.editing { background: var(--surface); cursor: default; }
.mv-row.leaving { opacity: 0; transform: translateX(16px); }
.mv-row.interno { opacity: .65; }
.mv-ic { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.mv-ic.in { background: var(--ok-soft); color: var(--ok); }
.mv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mv-main b { font-weight: 550; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-main small { color: var(--faint); font-size: 12.5px; display: inline-flex; align-items: center; gap: 3px; }
.mv-amt { font-weight: 650; font-size: 15.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mv-edit { flex-basis: 100%; padding: 10px 0 2px 46px; animation: viewIn var(--med) var(--ease); }
.mv-edit-g { display: grid; grid-template-columns: auto 110px minmax(0, 1fr) 170px 150px; gap: 8px; align-items: center; }
.mv-edit-acts { display: flex; gap: 6px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.mv-edit-acts .sp { flex: 1; }
.danger-t { color: var(--bad); }
.mv-empty { padding: 26px 0; text-align: center; }
.mv-cats { margin-top: 16px; }
.mv-cats summary { cursor: pointer; color: var(--muted); font-size: 14px; padding: 6px 0; }
.mv-cats ul { list-style: none; margin: 6px 0 0; padding: 0; }
.mv-cats li { display: grid; grid-template-columns: 150px 1fr 100px; gap: 10px; align-items: center; padding: 5px 0; font-size: 14px; }
.mv-cats a { color: var(--text); }
.mv-cats b { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.mv-bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.mv-bar i { display: block; height: 100%; background: var(--muted); border-radius: 4px; transition: width var(--med) var(--ease); }
.eco-bloque { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .02em; margin: 34px 0 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.shake { animation: shake 320ms var(--ease); border-color: var(--bad) !important; }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
@media (max-width: 760px) {
  .mv-add { grid-template-columns: auto minmax(0, 1fr); }
  .mv-add .mv-con { grid-column: 1 / -1; }
  .mv-add .mv-cat, .mv-add .mv-fecha { grid-column: span 1; }
  .mv-add .btn { grid-column: 1 / -1; }
  .mv-edit { padding-left: 0; }
  .mv-edit-g { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .mv-edit-g .seg { grid-column: 1 / -1; }
  .mv-sum { gap: 18px; width: 100%; justify-content: space-between; }
  .mv-sum b { font-size: 20px; }
  .mv-cats li { grid-template-columns: 110px 1fr 84px; }
}

/* ───────── Menú de acciones (⋯, clic derecho, pulsación larga) ───────── */
.ctx-menu { position: fixed; z-index: 1000; min-width: 200px; max-width: 280px; padding: 5px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); box-shadow: var(--pop-shadow); animation: popIn var(--fast) var(--ease); }
.ctx-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 7px; background: none; color: var(--text); font: inherit; font-size: 14.5px; text-align: left; cursor: pointer; }
.ctx-menu button svg { color: var(--muted); flex: none; }
.ctx-menu button:hover, .ctx-menu button:focus-visible { background: var(--surface-2); outline: none; }
.ctx-menu button.danger-t, .ctx-menu button.danger-t svg { color: var(--bad); }
.ctx-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }

/* ───────── Documentos (biblioteca) ───────── */
.doc-bar { display: flex; gap: 10px; align-items: center; margin: 0 0 16px; }
.doc-find { flex: 1; }
.doc-aviso { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-left: 2px solid var(--warn); border-radius: 0 var(--r-s) var(--r-s) 0; margin-bottom: 14px; font-size: 14px; }
.doc-grupo { margin: 0 0 8px; border-bottom: 1px solid var(--line); }
.doc-grupo > summary { display: flex; justify-content: space-between; align-items: center; padding: 12px 4px; cursor: pointer; font-weight: 600; list-style: none; }
.doc-grupo > summary::-webkit-details-marker { display: none; }
.doc-grupo > summary::before { content: '›'; color: var(--faint); margin-right: 8px; transition: transform var(--fast) var(--ease); display: inline-block; }
.doc-grupo[open] > summary::before { transform: rotate(90deg); }
.doc-grupo > summary span:first-child { flex: 1; }
.doc-carpeta-h { display: flex; gap: 6px; align-items: center; padding: 8px 4px 2px 14px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.doc-list { list-style: none; margin: 0 0 8px; padding: 0; }
.doc-row { display: flex; align-items: center; gap: 12px; padding: 7px 4px; border-radius: var(--r-s); transition: background-color var(--fast); }
.doc-carpeta .doc-row { padding-left: 14px; }
.doc-row:hover { background: var(--surface); }
.doc-ic { flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.doc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--text); }
.doc-main:hover { text-decoration: none; }
.doc-main b { font-weight: 550; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-main small { color: var(--faint); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-more { opacity: .55; transition: opacity var(--fast); }
.doc-row:hover .doc-more, .doc-more:focus-visible { opacity: 1; }
.doc-nueva { display: flex; gap: 8px; margin-top: 6px; }
.doc-nueva .input { flex: 1; }

/* ───────── Personas ───────── */
.pe-av { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2) center / cover no-repeat; border: 1px solid var(--line-2); color: var(--muted); font-weight: 600; font-size: 15px; letter-spacing: .02em; }
.pe-av.has-img { font-size: 0; }
.pe-av.sm { width: 30px; height: 30px; font-size: 11px; }
.pe-av.lg { width: 72px; height: 72px; font-size: 22px; }
.pe-av.xl { width: 96px; height: 96px; font-size: 30px; }
.pe-pronto { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; margin-bottom: 8px; scrollbar-width: thin; }
.pe-fecha { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--text); transition: border-color var(--fast); }
.pe-fecha:hover { text-decoration: none; border-color: var(--line-2); }
.pe-fecha.cerca { border-color: var(--accent); }
.pe-fecha span { display: flex; flex-direction: column; line-height: 1.25; }
.pe-fecha b { font-size: 13.5px; font-weight: 600; }
.pe-fecha small { font-size: 12px; color: var(--muted); }
.pe-fecha > svg { color: var(--muted); }
.pe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pe-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 18px 10px 14px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); color: var(--text); min-width: 0; transition: border-color var(--fast), transform var(--fast) var(--ease); }
.pe-card:hover { text-decoration: none; border-color: var(--line-2); transform: translateY(-2px); }
.pe-card .pe-av { margin-bottom: 8px; }
.pe-card b { font-size: 15px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pe-card small { color: var(--muted); font-size: 12.5px; min-height: 1.2em; }
.pe-next { margin-top: 6px; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 1px 9px; }
.pe-next.cerca { color: var(--accent-text); border-color: var(--accent); }
.pe-nueva { border-style: dashed; background: transparent; color: var(--muted); justify-content: center; }
.pe-head { display: flex; align-items: center; gap: 18px; margin: 4px 0 14px; }
.pe-foto { position: relative; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 50%; }
.pe-foto-ic { position: absolute; right: 0; bottom: 2px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line-2); color: var(--muted); opacity: 0; transition: opacity var(--fast); }
.pe-foto:hover .pe-foto-ic, .pe-foto:focus-visible .pe-foto-ic { opacity: 1; }
@media (hover: none) { .pe-foto-ic { opacity: .9; } }
.pe-rel { margin: 0; color: var(--muted); font-size: 15px; }
.pe-cumple { margin: 4px 0 0; display: flex; align-items: center; gap: 6px; font-size: 15px; }
.pe-fechas { list-style: none; margin: 0 0 10px; padding: 0; }
.pe-fechas li { display: grid; grid-template-columns: 110px 1fr auto 32px; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.pe-d { font-weight: 600; font-variant-numeric: tabular-nums; }
.pe-nf { display: grid; grid-template-columns: minmax(0, 1fr) 160px auto auto; gap: 8px; align-items: center; }
.pe-nf .input { min-height: 38px; padding: 7px 10px; }
.pe-nf label { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.edit-det > summary { cursor: pointer; font-weight: 600; padding: 2px 0; }
.edit-det[open] > summary { margin-bottom: 12px; }
@media (max-width: 560px) {
  .pe-nf { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pe-nf .input:first-child { grid-column: 1 / -1; }
  .pe-fechas li { grid-template-columns: 90px 1fr 32px; }
  .pe-fechas li > .faint { display: none; }
  .pe-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.pe-name { margin: 0 0 2px; font-size: 26px; line-height: 1.2; }

/* ───────── Salud por personas ───────── */
.sa-perfiles { display: flex; gap: 6px; flex-wrap: wrap; margin: -6px 0 16px; }
.sa-chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px 4px 4px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: var(--surface); font: inherit; font-size: 14px; cursor: pointer; transition: border-color var(--fast), color var(--fast); }
.sa-chip:hover { text-decoration: none; color: var(--text); border-color: var(--line-2); }
.sa-chip.on { color: var(--text); border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.sa-mas { padding: 4px 10px; }
.sa-quien { display: flex; align-items: center; gap: 16px; margin: 0 0 14px; }
.sa-quien h2 { margin: 0; font-size: 21px; }
.sa-quien p { margin: 2px 0 0; }

/* ───────── Portada: tu día + el cerebro ───────── */
.home2 { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "hola" "cap" "hoy" "cand" "stage" "prox" "seg" "foot"; align-content: start; justify-items: stretch; gap: 0; width: min(620px, 100%); margin: 0 auto; padding: 18px 16px 0; }
.home2 .h2-hola { grid-area: hola; margin: 6px 0 14px; }
.h2-hola h1 { margin: 0; font-family: var(--font-display); font-size: 30px; font-weight: 650; letter-spacing: -.01em; line-height: 1.15; }
.h2-hola p { margin: 4px 0 0; color: var(--muted); font-size: 15px; text-transform: none; }
.home2 .h2-cap { grid-area: cap; }
.home2 .home-capture { width: 100%; margin: 0; }
.home2 .home-today { grid-area: hoy; width: 100%; margin: 22px 0 0; }
.home2 .h2-stage { grid-area: stage; margin: 10px 0 0; }
.home2 .h2-prox { grid-area: prox; }
.home2 .h2-seg { grid-area: seg; }
.h2-bloque { margin: 22px 0 0; }
.home2 .map-foot { grid-area: foot; }
.home2 .map-list { margin-top: 18px; }
@media (min-width: 1100px) {
  main.is-map { justify-content: center; }
  .home2 { width: min(1360px, 100%); grid-template-columns: minmax(0, 1fr) minmax(360px, 420px); grid-template-rows: auto auto auto auto auto 1fr auto; grid-template-areas: "stage hola" "stage cap" "stage hoy" "stage prox" "stage seg" "stage ." "foot foot"; column-gap: 48px; padding-top: 28px; }
  .home2 .h2-stage { margin: 0; align-self: center; }
  .home2 .h2-hola { margin-top: 0; }
}

/* Botón ⋯ de cada fila: discreto, aparece al pasar por encima (en táctil, siempre tenue) */
.item .item-more { opacity: 0; width: 30px; height: 30px; flex: none; transition: opacity var(--fast); color: var(--muted); }
.item:hover .item-more, .item-more:focus-visible { opacity: 1; }
@media (hover: none) { .item .item-more { opacity: .5; } }
.item.leaving { opacity: 0; transform: translateX(14px); transition: opacity var(--med), transform var(--med) var(--ease); }

/* Microinteracciones: completar, pulsar y aparecer */
.item.done .tick svg { animation: tickIn 260ms var(--ease); }
@keyframes tickIn { from { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.15); } to { transform: scale(1); opacity: 1; } }
.tick:active, .icon-btn:active, .chip:active, .pj-tab:active { transform: scale(.94); }
.icon-btn, .chip { transition: transform var(--fast) var(--ease), background-color var(--fast), color var(--fast), border-color var(--fast); }
/* Solo al llegar a una pantalla (no en cada redibujado, para que completar algo no haga parpadear la lista) */
.view-in .list .item { animation: itemIn var(--med) var(--ease) both; }
.view-in .list .item:nth-child(2) { animation-delay: 20ms; } .view-in .list .item:nth-child(3) { animation-delay: 40ms; } .view-in .list .item:nth-child(4) { animation-delay: 60ms; } .view-in .list .item:nth-child(n+5) { animation-delay: 80ms; }
@keyframes itemIn { from { opacity: 0; transform: translateY(3px); } }
.card { transition: border-color var(--fast); }
#modal[open] .modal-in { animation: modalIn var(--med) var(--ease); }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.985); } }

/* ───────── Contraseñas ───────── */
.kp-nueva, .kp-abrir { max-width: 520px; }
.kp-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.kp-bar .pj-find { flex: 1; min-width: 180px; }
.kp-grupos { margin-bottom: 10px; }
.kp-list { list-style: none; margin: 0; padding: 0; }
.kp-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.kp-ic { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-weight: 650; }
.kp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; padding: 2px 0; }
.kp-main b { font-weight: 550; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kp-main small { color: var(--faint); font-size: 12.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kp-main:hover b { color: var(--accent-text); }
.kp-aviso { color: var(--warn); }
.kp-pw { display: flex; gap: 4px; align-items: center; }
.kp-pw input { flex: 1; font-family: ui-monospace, Consolas, monospace; letter-spacing: .02em; }
.kp-medidor { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.kp-fuerza { display: inline-flex; gap: 3px; }
.kp-fuerza i { width: 28px; height: 4px; border-radius: 2px; background: var(--line); }
.kp-fuerza.n1 i:nth-child(-n+1) { background: var(--bad); }
.kp-fuerza.n2 i:nth-child(-n+2) { background: var(--warn); }
.kp-fuerza.n3 i:nth-child(-n+3), .kp-fuerza.n4 i { background: var(--ok); }
.kp-err { color: var(--bad); margin: 0; }
.kp-gen { padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); margin-bottom: 12px; text-align: center; }
.kp-gen code { font-size: 19px; letter-spacing: .04em; word-break: break-all; user-select: all; }

/* Candado de Contraseñas junto al cerebro */
.home2 .h2-candado { grid-area: cand; justify-self: end; align-self: start; z-index: 2; display: inline-flex; align-items: center; gap: 7px; margin-top: 24px; padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 99px; background: var(--surface); color: var(--muted); font-size: 14px; transition: border-color var(--fast), color var(--fast), transform var(--fast) var(--ease); }
.home2 .h2-candado:hover { color: var(--text); border-color: var(--accent); text-decoration: none; }
.home2 .h2-candado:active { transform: scale(.96); }
.home2 .h2-candado svg { color: var(--accent-text); }
@media (min-width: 1100px) { .home2 .h2-candado { grid-area: stage; margin-top: 0; } }

/* ───────── Bloqueo de cerEbro (js/bloqueo.js) ───────── */
.bloqueada .shell, .bloqueada .fab, .bloqueada .toasts, .bloqueada .ctx-menu { visibility: hidden; }
.bloqueo { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 24px 16px calc(24px + var(--safe-b, 0px)); background: var(--bg); color: var(--text); overflow: auto; }
.bq-caja { width: min(360px, 100%); display: grid; justify-items: center; gap: 14px; text-align: center; animation: popIn var(--med) var(--ease); }
.bq-marca { font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.bq-marca b { color: var(--accent-text); }
.bq-candado { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); margin-top: 14px; }
.bq-t { margin: 0 0 6px; color: var(--muted); }
.bq-bio { width: 100%; justify-content: center; padding: 13px 16px; font-size: 16px; gap: 8px; }
.bq-otra { width: 100%; }
.bq-otra summary { cursor: pointer; color: var(--muted); padding: 6px; list-style: none; }
.bq-otra summary::-webkit-details-marker { display: none; }
.bq-otra[open] summary { margin-bottom: 8px; }
.bq-frase { display: flex; gap: 8px; width: 100%; }
.bq-frase .input { flex: 1; min-width: 0; }
.bq-rec { display: inline-flex; align-items: center; gap: 6px; color: var(--faint); }
.bq-err { min-height: 1.4em; margin: 0; color: var(--warn, #e0a33a); }
/* Avisos dentro de una ventana abierta (ui.js toast): mismos estilos, por encima del contenido de la ventana. */
.modal > .toasts { z-index: 5; }
.bq-pin { display: flex; gap: 8px; width: 100%; }
.bq-pin .input { flex: 1; min-width: 0; text-align: center; letter-spacing: .35em; font-size: 20px; }
