/* iswNotes v2.0 — estilos unificados */
:root {
    --bg: #edf3f4; --surface: #ffffff; --surface2: #e5eef0; --text: #1f3547; --muted: #5d7484; --line: #d3e0e4;
    --accent: #2a7889; --accent-h: #216273; --accent-soft: #dbecef; --accent-text: #ffffff;
    --accent-2: #3e6079;
    --danger: #d23f4b; --ok: #1d9a62; --warn: #c68300; --hl: #fff4b8;
    --mar-bg: #fffce8; --mar-line: #efe4a0; --mar-text: #3d3600;
    --side: #e4ecee; --side-h: rgba(31, 53, 71, .07);
    --shadow: 0 1px 2px rgba(20, 28, 45, .06), 0 6px 20px rgba(20, 28, 45, .07);
    --radius: 10px; --top: calc(64px + env(safe-area-inset-top, 0px)); --fz: 1;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    color-scheme: light;
}
:root[data-theme="dark"] {
    --bg: #2d3539; --surface: #374146; --surface2: #414c52; --text: #edf2f4; --muted: #b1bfc6; --line: #4f5c63;
    --accent: #6fc2cd; --accent-h: #8dd2db; --accent-soft: #2f5660; --accent-text: #14262c; --accent-2: #4f7891;
    --danger: #f5838d; --ok: #5ad9a0; --warn: #efbb52; --hl: #5b5424;
    --mar-bg: #4a4526; --mar-line: #6a6230; --mar-text: #f3eab0; --side: #283034; --side-h: rgba(255, 255, 255, .06);
    --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 8px 24px rgba(0, 0, 0, .22);
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #2d3539; --surface: #374146; --surface2: #414c52; --text: #edf2f4; --muted: #b1bfc6; --line: #4f5c63;
        --accent: #6fc2cd; --accent-h: #8dd2db; --accent-soft: #2f5660; --accent-text: #14262c; --accent-2: #4f7891;
        --danger: #f5838d; --ok: #5ad9a0; --warn: #efbb52; --hl: #5b5424;
        --mar-bg: #4a4526; --mar-line: #6a6230; --mar-text: #f3eab0; --side: #283034; --side-h: rgba(255, 255, 255, .06);
        --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 8px 24px rgba(0, 0, 0, .22);
        color-scheme: dark;
    }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
button, a, select, label, summary { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--text); font: calc(14px * var(--fz))/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
code, kbd { font-family: var(--mono); }
kbd { font-size: 10px; padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface2); color: var(--muted); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.oculto, [hidden] { display: none !important; }

/* ---------- Botones y formularios ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 7px 13px; border-radius: 8px; font: inherit; font-weight: 500; cursor: pointer; transition: .12s; white-space: nowrap; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-h); border-color: var(--accent-h); color: var(--accent-text); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { padding: 4px 9px; font-size: 12px; border-radius: 6px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 0; background: transparent; color: var(--muted); border-radius: 8px; cursor: pointer; font-size: 16px; }
.icon-btn:hover { background: var(--surface2); color: var(--text); }
input[type=text], input[type=password], input[type=number], input[type=search], input[type=url], select, textarea {
    width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 80px; }
label.f { display: block; margin-bottom: 12px; font-size: 12px; font-weight: 600; color: var(--muted); }
label.f > input, label.f > select, label.f > textarea { margin-top: 4px; font-weight: 400; color: var(--text); }
.row { display: flex; gap: 10px; } .row > * { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 500; }
.chip button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 0 0 2px; font-size: 14px; line-height: 1; opacity: .7; }
.chip button:hover { opacity: 1; }
.badge { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: var(--accent-text); font-size: 11px; font-weight: 700; text-align: center; }

/* ---------- Barra superior ---------- */
.top { position: fixed; inset: 0 0 auto 0; height: var(--top); padding-top: env(safe-area-inset-top, 0px) !important; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 16px; z-index: 50; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 17px; font-weight: 500; letter-spacing: -.2px; }
.brand b { color: var(--accent); font-weight: 700; } .brand-ico { font-size: 20px; }
.tabs { display: flex; gap: 2px; margin-left: 8px; }
.tabs a { display: flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 8px; color: var(--muted); font-weight: 600; }
.tabs a em { font-style: normal; }
.tabs a:hover { background: var(--surface2); color: var(--text); }
.tabs a.on { background: var(--accent-soft); color: var(--accent); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface2); color: var(--muted); font: inherit; cursor: pointer; }
.pill:hover { border-color: var(--accent); color: var(--accent); }
.pill em { font-style: normal; } .pill b { color: var(--text); }
.pill-repaso.has { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); } .pill-repaso.has b { color: var(--accent); }
.dd { position: relative; }
.dd-menu { display: none; position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 5px; z-index: 60; }
.dd.open .dd-menu { display: block; }
.dd-menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; color: var(--text); font: inherit; padding: 9px 11px; border-radius: 7px; cursor: pointer; }
.dd-menu button:hover { background: var(--accent-soft); color: var(--accent); }

.view { position: fixed; inset: var(--top) 0 0 0; overflow: auto; }
.view.noscroll { overflow: hidden; }
.page { max-width: 1120px; margin: 0 auto; padding: 26px 20px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; letter-spacing: -.3px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: 1.4fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.empty .big { font-size: 34px; display: block; margin-bottom: 6px; }

/* ---------- Toasts / modales / paleta ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 300; }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 9px; box-shadow: var(--shadow); max-width: 340px; animation: tin .18s ease; }
.toast.err { background: var(--danger); color: #fff; } .toast.ok { background: var(--ok); color: #fff; }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }
.modal { position: fixed; inset: 0; background: rgba(10, 14, 24, .5); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 14px 14px; z-index: 200; overflow: auto; animation: fin .12s; }
@keyframes fin { from { opacity: 0; } }
.modal-box { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); width: 100%; max-width: 520px; }
.modal-box.w-lg { max-width: 760px; } .modal-box.w-xl { max-width: 980px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 18px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); }
.modal-foot .left { margin-right: auto; }
.cmdk { max-width: 640px; margin-top: 10vh; }
.cmdk input { border: 0; border-bottom: 1px solid var(--line); border-radius: 14px 14px 0 0; padding: 15px 18px; font-size: 16px; box-shadow: none !important; }
.cmdk-res { max-height: 56vh; overflow: auto; padding: 6px; }
.cmdk-g { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: 10px 10px 4px; }
.cmdk-i { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text); cursor: pointer; }
.cmdk-i.sel, .cmdk-i:hover { background: var(--accent-soft); }
.cmdk-i b { display: block; font-weight: 600; } .cmdk-i span { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Inicio ---------- */
.hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 24px; border-radius: 16px; background: linear-gradient(135deg, #2a7889, #3e6079); color: #fff; margin-bottom: 16px; flex-wrap: wrap; }
.hero h1 { font-size: 24px; } .hero p { margin: 4px 0 0; opacity: .9; }
.hero .btn { background: #fff; color: #216273; border-color: #fff; font-weight: 700; }
.hero .btn:hover { color: #216273; transform: translateY(-1px); }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.quick button { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.quick button:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.quick .ico { font-size: 22px; } .quick b { font-size: 14px; } .quick span { color: var(--muted); font-size: 12px; }
.lista { list-style: none; margin: 0; padding: 0; }
.lista li > a, .lista li > div.it { display: flex; gap: 10px; align-items: center; padding: 9px 8px; border-radius: 8px; color: var(--text); cursor: pointer; }
.lista li > a:hover, .lista li > div.it:hover { background: var(--surface2); }
.lista .t { flex: 1; min-width: 0; } .lista .t b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lista .t span { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lista .d { color: var(--muted); font-size: 11px; white-space: nowrap; }
.stat { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); } .stat:last-child { border: 0; }
.stat b { font-variant-numeric: tabular-nums; }
.bar { height: 6px; border-radius: 99px; background: var(--surface2); overflow: hidden; } .bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }

/* ---------- Notas (3 columnas) ---------- */
.notas { display: flex; height: 100%; position: relative; }
.n-izq, .n-der { background: var(--surface); display: flex; flex-direction: column; min-height: 0; flex: none; }
.n-izq { width: 300px; border-right: 1px solid var(--line); } .n-der { width: 320px; border-left: 1px solid var(--line); }
.n-ed { flex: 1 1 auto; }
/* Barras de iconos (cuando la columna no está acoplada) */
.n-rail { display: none; flex: none; width: 54px; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0; background: var(--side, var(--surface2)); }
.n-rail-izq { border-right: 1px solid var(--line); } .n-rail-der { border-left: 1px solid var(--line); }
.notas.rail-izq .n-rail-izq, .notas.rail-der .n-rail-der { display: flex; }
.n-rail button { position: relative; width: 42px; height: 42px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font-size: 19px; cursor: pointer; display: grid; place-items: center; }
.n-rail button:hover { background: var(--side-h, var(--surface2)); }
.n-rail button.on { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.n-rail button b { position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--accent); color: var(--accent-text); font-size: 10.5px; line-height: 17px; font-weight: 800; }
.n-rail-izq [data-r="nueva"] { background: var(--accent); color: var(--accent-text); font-weight: 700; }
/* Columnas: acopladas, ocultas o flotantes */
.notas:not(.izq-dock):not(.izq-flot) .n-izq { display: none; }
.notas:not(.der-dock):not(.der-flot) .n-der { display: none; }
.notas.izq-flot .n-izq { position: absolute; top: 0; bottom: 0; left: 54px; width: min(360px, calc(100% - 54px)); z-index: 30; box-shadow: var(--shadow); }
.notas.der-flot .n-der { position: absolute; top: 0; bottom: 0; right: 54px; width: min(360px, calc(100% - 54px)); z-index: 40; box-shadow: var(--shadow); }
.notas.izq-flot.con-nota .n-izq, .notas.der-flot .n-der { box-shadow: 0 0 0 100vmax rgba(15, 18, 24, .28), var(--shadow); }
.notas.der-flot .n-rail-der, .notas.izq-flot .n-rail-izq { position: relative; z-index: 45; }
.n-busca { padding: 10px 10px 6px; display: flex; gap: 6px; }
.n-tipos { display: flex; gap: 4px; padding: 0 10px 8px; flex-wrap: wrap; }
.n-tipos button { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 99px; padding: 2px 9px; font: inherit; font-size: 12px; cursor: pointer; }
.n-tipos button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.carpetas { padding: 2px 6px 6px; border-bottom: 1px solid var(--line); max-height: 28%; overflow: auto; }
.carp-h { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px; font-size: 11px; font-weight: 700; letter-spacing: .6px; color: var(--muted); text-transform: uppercase; }
.carp-h button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; border-radius: 5px; width: 22px; height: 22px; } .carp-h button:hover { background: var(--surface2); color: var(--accent); }
.carp { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 7px; cursor: pointer; color: var(--text); }
.carp:hover { background: var(--surface2); } .carp.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.carp i { width: 9px; height: 9px; border-radius: 50%; flex: none; } .carp span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .carp small { color: var(--muted); font-variant-numeric: tabular-nums; }
.carp .edit { opacity: 0; border: 0; background: none; cursor: pointer; color: var(--muted); } .carp:hover .edit { opacity: 1; }
.n-lista { flex: 1; overflow: auto; padding: 6px; }
.nota-it { display: block; padding: 9px 10px; border-radius: 9px; cursor: pointer; border: 1px solid transparent; color: var(--text); }
.nota-it:hover { background: var(--surface2); } .nota-it.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.nota-it .l1 { display: flex; gap: 6px; align-items: baseline; } .nota-it b { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nota-it .pre { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nota-it .tg { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; } .nota-it .tg span { font-size: 10.5px; color: var(--accent); background: var(--accent-soft); padding: 0 6px; border-radius: 99px; }
.nota-it .f { font-size: 10.5px; color: var(--muted); }
.prio-1 { box-shadow: inset 3px 0 0 #3da5f4; } .prio-2 { box-shadow: inset 3px 0 0 var(--warn); } .prio-3 { box-shadow: inset 3px 0 0 var(--danger); }
.nota-it.ocul { opacity: .55; }
.n-pie { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.n-pie button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-size: 12px; } .n-pie button:hover { color: var(--accent); }

.n-ed { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); }
.ed-vacio { margin: auto; text-align: center; color: var(--muted); padding: 30px; max-width: 460px; }
.ed-vacio .big { font-size: 54px; }
.ed-top { display: flex; align-items: center; gap: 8px; padding: 10px 16px 0; }
.ed-titulo { flex: 1; border: 0 !important; background: transparent !important; box-shadow: none !important; font-size: 24px; font-weight: 700; letter-spacing: -.4px; padding: 6px 2px !important; }
.ed-tipo { width: auto !important; border: 1px solid var(--line); padding: 4px 8px; font-size: 12px; }
.toolbar { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; padding: 6px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.tb { min-width: 30px; height: 30px; padding: 0 7px; border: 0; background: transparent; color: var(--text); border-radius: 6px; cursor: pointer; font: inherit; font-weight: 600; display: inline-grid; place-items: center; }
.tb:hover { background: var(--surface2); } .tb.on { background: var(--accent-soft); color: var(--accent); }
.tb-sep { width: 1px; height: 18px; background: var(--line); margin: 0 5px; } .tb-sp { flex: 1; }
.tb i { font-style: italic; font-family: Georgia, serif; }
.ed-meta { display: flex; align-items: center; gap: 8px; padding: 8px 16px; flex-wrap: wrap; background: var(--surface); border-bottom: 1px solid var(--line); }
.ed-meta .kw-in { flex: 1; min-width: 120px; border: 0; box-shadow: none !important; padding: 3px 4px; font-size: 13px; background: transparent; }
.ed-scroll { flex: 1; overflow: auto; }
.ed-scroll { background: var(--surface); }
.ed-hoja { max-width: none; margin: 0; padding: 18px 32px 60px; min-height: 100%; display: flex; flex-direction: column; }
.ed-resumen { background: var(--hl); border-left: 4px solid var(--warn); border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; }
.ed-resumen textarea { border: 0; background: transparent; box-shadow: none !important; min-height: 44px; padding: 2px 0; font-size: 13px; }
.ed-resumen .rh { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--warn); }
.ed-texto { flex: 1; min-height: 55vh; outline: none; font-size: 15.5px; line-height: 1.7; background: transparent; border: 0; border-radius: 0; padding: 4px 0 40px; word-wrap: break-word; }
.ed-texto:empty:before { content: "Escribe aquí… usa [[ para enlazar con otra nota"; color: var(--muted); }
.ed-texto h1, .ed-texto h2, .ed-texto h3, .ed-texto h4 { margin: 1.1em 0 .4em; } .ed-texto p { margin: 0 0 .8em; } .ed-texto img { max-width: 100%; border-radius: 8px; cursor: zoom-in; }
.ed-texto blockquote { margin: .8em 0; padding: 2px 14px; border-left: 3px solid var(--line); color: var(--muted); }
.ed-texto pre { background: var(--surface2); padding: 10px 12px; border-radius: 8px; overflow: auto; font-family: var(--mono); font-size: 13px; }
.ed-texto code { background: var(--surface2); padding: 1px 5px; border-radius: 4px; font-family: var(--mono); font-size: .9em; }
.ed-texto table { border-collapse: collapse; } .ed-texto td, .ed-texto th { border: 1px solid var(--line); padding: 4px 8px; }
.ed-texto a { text-decoration: underline; }
a.wl { color: var(--accent); font-weight: 600; text-decoration: underline !important; text-decoration-thickness: 1.5px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); cursor: pointer; border-radius: 3px; -webkit-user-modify: read-only; }
a.wl::before { content: ""; display: inline-block; width: .78em; height: .9em; margin-right: .22em; vertical-align: -.08em; background: currentColor; opacity: .75;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 16'%3E%3Cpath d='M2 0h7l5 5v9a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm6 1.5V6h4.5M3 9h8M3 12h6' fill='none' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 16'%3E%3Cpath d='M2 0h7l5 5v9a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm6 1.5V6h4.5M3 9h8M3 12h6' fill='none' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E") center / contain no-repeat; }
a.wl:hover { background: var(--accent-soft); text-decoration-color: var(--accent); }
a.wl .wlb { display: none; }
a.wl.roto { color: var(--warn); text-decoration-style: dashed; text-decoration-color: var(--warn); }
a.wl.roto::after { content: " +"; font-weight: 700; }
.ed-estado { display: flex; gap: 14px; align-items: center; padding: 6px 16px; border-top: 1px solid var(--line); background: var(--surface); font-size: 12px; color: var(--muted); }
.ed-estado .sp { flex: 1; } .guard-ok { color: var(--ok); } .guard-pend { color: var(--warn); }
.ac { position: fixed; z-index: 120; min-width: 240px; max-width: 360px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 4px; }
.ac div { padding: 6px 9px; border-radius: 6px; cursor: pointer; } .ac div.sel, .ac div:hover { background: var(--accent-soft); color: var(--accent); } .ac small { color: var(--muted); }

.n-der .ptabs { display: flex; border-bottom: 1px solid var(--line); }
.ptabs button { flex: 1; border: 0; background: transparent; padding: 10px 4px; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; }
.ptabs button.on { color: var(--accent); border-bottom-color: var(--accent); } .ptabs button b { color: var(--accent); }
.p-body { flex: 1; overflow: auto; padding: 12px; }
.adj-drop { border: 2px dashed var(--line); border-radius: 10px; padding: 14px; text-align: center; color: var(--muted); font-size: 12px; margin-bottom: 10px; cursor: pointer; }
.adj-drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.adj-g { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.adj { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface2); }
.adj img { width: 100%; height: 86px; object-fit: cover; display: block; cursor: zoom-in; }
.adj .doc { display: grid; place-items: center; height: 86px; font-size: 26px; } .adj .nm { padding: 4px 6px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adj .acc { position: absolute; top: 3px; right: 3px; display: none; gap: 2px; } .adj:hover .acc { display: flex; }
.adj .acc button { border: 0; background: rgba(0, 0, 0, .65); color: #fff; border-radius: 5px; width: 22px; height: 22px; cursor: pointer; font-size: 12px; }
.rel { display: flex; gap: 8px; align-items: flex-start; padding: 8px; border-radius: 8px; cursor: pointer; color: var(--text); }
.rel:hover { background: var(--surface2); } .rel b { display: block; font-weight: 600; } .rel span { color: var(--muted); font-size: 12px; }
.peso { flex: none; font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 5px; letter-spacing: .4px; margin-top: 2px; }
.peso.ALTO { background: color-mix(in srgb, var(--ok) 20%, transparent); color: var(--ok); } .peso.MEDIO { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); } .peso.BAJO { background: var(--surface2); color: var(--muted); }
.sec-t { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 14px 0 6px; display: flex; justify-content: space-between; align-items: center; }
.sec-t:first-child { margin-top: 0; }
.ref-it, .mar-it { display: flex; gap: 8px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; background: var(--surface); }
.ref-it .n { font-weight: 800; color: var(--accent); } .ref-it .x, .mar-it .x { flex: 1; min-width: 0; word-break: break-word; font-size: 13px; }
.ref-it .x a { display: block; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini { border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 5px; width: 22px; height: 22px; } .mini:hover { background: var(--surface2); color: var(--danger); }
.mar-it { background: var(--mar-bg); border-color: var(--mar-line); color: var(--mar-text); }
.mar-it small { display: block; opacity: .6; font-size: 10.5px; }
.inline-form { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.mapa-svg { width: 100%; height: auto; background: var(--surface2); border-radius: 10px; }
.mapa-svg text { fill: var(--text); font-size: 11px; } .mapa-svg .nodo { cursor: pointer; } .mapa-svg .nodo:hover circle { stroke: var(--accent); stroke-width: 3; }
.wiki-lst { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; }
.wiki-lst div { padding: 8px 10px; cursor: pointer; border-bottom: 1px solid var(--line); } .wiki-lst div:hover, .wiki-lst div.sel { background: var(--accent-soft); } .wiki-lst small { display: block; color: var(--muted); }
.wiki-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 8px; }
.wiki-imgs label { position: relative; cursor: pointer; border: 2px solid transparent; border-radius: 8px; overflow: hidden; display: block; background: var(--surface2); }
.wiki-imgs img { width: 100%; height: 76px; object-fit: cover; display: block; } .wiki-imgs input { position: absolute; top: 4px; left: 4px; }
.wiki-imgs label:has(input:checked) { border-color: var(--accent); }
.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .88); display: grid; place-items: center; z-index: 400; cursor: zoom-out; } .lightbox img { max-width: 94vw; max-height: 92vh; border-radius: 6px; }
.m-izq-btn { display: none; }

/* ---------- Memoria ---------- */
.pal-card { position: relative; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 16px; cursor: pointer; border-top: 5px solid var(--pc, var(--accent)); transition: .12s; }
.pal-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.pal-card .pf { display: inline-block; background: var(--pc); color: #fff; font-weight: 800; padding: 2px 8px; border-radius: 6px; font-size: 12px; margin-bottom: 8px; }
.pal-card h3 { font-size: 16px; margin-bottom: 4px; } .pal-card p { margin: 0 0 10px; color: var(--muted); font-size: 12.5px; min-height: 18px; }
.pal-card .bar i { background: var(--pc); }
.pal-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pal-head h1 { font-size: 22px; } .pal-head .pf { background: var(--pc); color: #fff; font-weight: 800; padding: 3px 9px; border-radius: 7px; }
.sub-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.sub-tabs a { padding: 8px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; } .sub-tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }
.aula { display: grid; gap: 8px; }
.cel { position: relative; min-height: 92px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface); padding: 7px 8px; cursor: pointer; overflow: hidden; display: flex; flex-direction: column; transition: .1s; }
.cel:hover { border-color: var(--pc); border-style: solid; box-shadow: var(--shadow); }
.cel .cd { font-size: 10px; font-weight: 800; color: var(--pc); letter-spacing: .4px; }
.cel.llena { border-style: solid; border-left: 4px solid var(--pc); } .cel b { font-size: 12.5px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cel small { color: var(--muted); font-size: 11px; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cel .im { position: absolute; right: 0; bottom: 0; width: 46px; height: 46px; object-fit: cover; border-top-left-radius: 8px; }
.cel.vacia:after { content: "+"; margin: auto; font-size: 20px; color: var(--line); } .cel.vacia:hover:after { color: var(--pc); }
.cel.drag { opacity: .4; } .cel.over { background: var(--accent-soft); }
.tips { border: 1px solid var(--line); border-radius: 10px; background: var(--surface2); margin-top: 10px; }
.tips summary { padding: 9px 12px; cursor: pointer; font-weight: 600; color: var(--accent); }
.tips-b { padding: 4px 12px 12px; max-height: 240px; overflow: auto; }
.tips h4 { margin: 10px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.tip { display: flex; gap: 8px; padding: 4px 0; font-size: 12.5px; } .tip span { flex: none; } .tip em { font-style: normal; color: var(--muted); }
.mim { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; } .mim div { position: relative; } .mim img { width: 88px; height: 88px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; display: block; }
.mim button { position: absolute; top: 2px; right: 2px; border: 0; border-radius: 5px; background: rgba(0, 0, 0, .65); color: #fff; width: 20px; height: 20px; cursor: pointer; }
.pao-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.pao-c { border: 1px solid var(--line); border-radius: 9px; background: var(--surface); padding: 7px 9px; } .pao-c .cd { font-weight: 800; color: var(--accent); margin-bottom: 3px; font-size: 13px; }
.pao-c input { padding: 4px 7px; font-size: 12.5px; margin-top: 3px; }

/* ---------- Repaso ---------- */
.rep { max-width: 720px; margin: 0 auto; padding: 26px 20px; }
.rep-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; } .rep-top .bar { flex: 1; }
.flash { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 28px; min-height: 260px; display: flex; flex-direction: column; }
.flash .lugar { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.flash .fr { font-size: 22px; font-weight: 700; line-height: 1.3; letter-spacing: -.3px; }
.flash .rv { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--line); white-space: pre-wrap; font-size: 16px; line-height: 1.6; }
.flash .imgs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; } .flash .imgs img { max-height: 150px; border-radius: 8px; cursor: zoom-in; }
.flash .acc { margin-top: auto; padding-top: 22px; }
.q-btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.q-btns button { padding: 11px 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font: inherit; font-weight: 600; cursor: pointer; display: flex; flex-direction: column; gap: 2px; color: var(--text); }
.q-btns button small { font-weight: 400; color: var(--muted); font-size: 11px; } .q-btns button:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.q-0 { border-color: var(--danger) !important; } .q-3 { border-color: var(--warn) !important; } .q-4 { border-color: #3da5f4 !important; } .q-5 { border-color: var(--ok) !important; }
.ok-fin { text-align: center; padding: 40px 10px; } .ok-fin .big { font-size: 60px; }

/* ---------- Libros ---------- */
.libros-frame { width: 100%; height: 100%; border: 0; display: block; background: var(--bg); }

/* ---------- Auth ---------- */
body.auth { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 20px; }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 30px; }
.auth-card h1 { font-size: 22px; margin-bottom: 4px; } .auth-card h1 small { font-size: 12px; color: var(--muted); font-weight: 500; }
.auth-logo { font-size: 40px; margin-bottom: 8px; } .auth-card label { display: block; margin: 12px 0; font-size: 12px; font-weight: 600; color: var(--muted); } .auth-card input { margin-top: 4px; }
.auth-card .btn { width: 100%; justify-content: center; margin-top: 6px; padding: 10px; }
.auth-error { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); padding: 8px 12px; border-radius: 8px; margin: 10px 0; font-size: 13px; }
.auth-checks { list-style: none; padding: 0; margin: 18px 0 0; font-size: 12px; color: var(--muted); } .auth-checks .ok { color: var(--ok); } .auth-checks .ko { color: var(--danger); font-weight: 700; }

/* ---------- Responsive (escritorio → tablet → móvil) ---------- */
/* Tablet horizontal / portátil pequeño: panel derecho flotante, lista acoplada */
@media (max-width: 1280px) {
    .g3 { grid-template-columns: 1fr 1fr; }
    .n-izq { width: 270px; }
}
@media (max-width: 1180px) {
    .brand-txt, .pill em, .pill kbd, #btnNuevo em { display: none; }
    .tabs { margin-left: 0; }
}
/* Tablet vertical: lista como cajón deslizante sobre el editor */
@media (max-width: 900px) {
    .g2, .g3 { grid-template-columns: 1fr; } .g4, .quick { grid-template-columns: 1fr 1fr; }
    .tabs a em { display: none; } .tabs a { padding: 8px 12px; }
    .ed-hoja { padding: 14px 18px 50px; }
    .modal { padding-top: 3vh; }
}
@media (max-width: 700px) {
    .top { gap: 6px; padding: 0 10px; }
    .ed-hoja { padding: 12px 14px 40px; } .ed-titulo { font-size: 20px; } .q-btns { grid-template-columns: 1fr 1fr; } .row { flex-direction: column; }
}
@supports (padding: max(0px)) {
    .top { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
    .n-pie, .ed-estado { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
}
/* Pantallas táctiles (tablet / móvil): objetivos más grandes y acciones siempre visibles */
@media (hover: none), (pointer: coarse) {
    input[type=text], input[type=password], input[type=number], input[type=search], input[type=url], input[type=email], input[type=date], select, textarea { font-size: 16px; }
    .btn { padding: 9px 15px; } .btn-sm { padding: 7px 12px; font-size: 13px; }
    .icon-btn { width: 42px; height: 42px; font-size: 18px; }
    .tabs a { padding: 10px 14px; }
    .pill { padding: 8px 13px; } .pill kbd { display: none; }
    .dd-menu button { padding: 12px 13px; }
    .tb { min-width: 40px; height: 40px; font-size: 15px; }
    .carp { padding: 9px 10px; } .carp .edit { opacity: .7; padding: 4px 6px; }
    .carp-h button { width: 32px; height: 32px; }
    .nota-it { padding: 12px 12px; }
    .n-tipos button { padding: 6px 12px; font-size: 14px; }
    .n-pie { padding: 10px 12px; }
    .ptabs button { padding: 13px 4px; font-size: 13px; }
    .mini { width: 32px; height: 32px; }
    .adj .acc { display: flex; } .adj .acc button { width: 30px; height: 30px; }
    .mim button { width: 28px; height: 28px; }
    .cmdk-i { padding: 11px 12px; }
    .cv-q button { width: 40px; height: 40px; }
    .sub-tabs { overflow-x: auto; scrollbar-width: none; } .sub-tabs::-webkit-scrollbar { display: none; } .sub-tabs a { flex: none; padding: 11px 14px; }
    .ed-texto { font-size: 17px; }
    .ed-vacio .small { display: none; }
}

/* ---------- Claves (gestor de contraseñas) ---------- */
input[type=email], input[type=date] { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; outline: none; }
label.f > input[type=email], label.f > input[type=date] { margin-top: 4px; font-weight: 400; color: var(--text); }
.cv-lock { max-width: 460px; margin: 5vh auto 0; text-align: center; padding: 28px; }
.cv-lock-ico { font-size: 44px; line-height: 1; } .cv-lock h2 { font-size: 20px; margin: 10px 0 4px; } .cv-lock > p { margin: 0 0 16px; }
.cv-lock form { text-align: left; } .cv-lock form .btn-primary { width: 100%; justify-content: center; padding: 10px; margin-top: 4px; }
.cv-aviso { background: color-mix(in srgb, var(--warn) 13%, transparent); border-left: 4px solid var(--warn); padding: 9px 12px; border-radius: 8px; font-size: 12.5px; margin: 0 0 12px; text-align: left; }
.cv-err { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); padding: 8px 12px; border-radius: 8px; margin: 0 0 10px; font-size: 13px; text-align: left; }
.cv-chk { display: flex; align-items: center; gap: 7px; font-size: 12.5px; margin: 4px 0 12px; cursor: pointer; }
.btn-link { border: 0; background: none; color: var(--accent); cursor: pointer; font: inherit; font-size: 12.5px; padding: 0; text-decoration: underline; }
.cv-lock > .btn-link { margin-top: 14px; color: var(--muted); }
.cv-acc { display: flex; gap: 8px; align-items: center; }
.btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.cv-filtros { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.cv-filtros input { flex: 2 1 260px; width: auto; } .cv-filtros select { flex: 1 1 180px; width: auto; }
.cv-tipos { padding: 0 0 12px; } .cv-tipos b { font-weight: 700; margin-left: 2px; }
.cv-it { display: flex; align-items: center; gap: 12px; padding: 9px 10px 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); margin-bottom: 6px; cursor: pointer; transition: .1s; }
.cv-it:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.cv-it.cv-roto { opacity: .75; cursor: default; }
.cv-ico { width: 38px; height: 38px; border-radius: 9px; background: var(--surface2); display: grid; place-items: center; font-size: 18px; flex: none; }
.cv-it .t { flex: 1; min-width: 0; }
.cv-it .t b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-it .t span { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-q { display: flex; gap: 2px; flex: none; }
.cv-q button { width: 32px; height: 32px; border: 0; background: transparent; border-radius: 7px; cursor: pointer; color: var(--muted); font-size: 15px; }
.cv-q button:hover { background: var(--surface2); color: var(--accent); }
.cv-q .fav.on { color: var(--warn); }
.cv-badge { flex: none; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.cv-badge.cad { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.cv-badge.rev { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.cv-in { display: flex; gap: 4px; align-items: stretch; margin-top: 4px; }
.cv-in input { flex: 1; min-width: 0; margin-top: 0 !important; font-weight: 400; color: var(--text); }
.cv-in button { flex: none; width: 36px; border: 1px solid var(--line); background: var(--surface2); border-radius: 8px; cursor: pointer; color: var(--text); font-size: 14px; }
.cv-in button:hover { border-color: var(--accent); color: var(--accent); }
.cv-mono { font-family: var(--mono) !important; letter-spacing: .3px; }
.cv-fuerza { height: 5px; border-radius: 99px; background: var(--surface2); overflow: hidden; margin-top: 6px; }
.cv-fuerza i { display: block; height: 100%; width: 0; border-radius: 99px; transition: width .2s, background .2s; }
.cv-fz-t { display: block; min-height: 15px; font-size: 11px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.cv-gen { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--surface2); margin: -4px 0 12px; }
.cv-gen-out { font-family: var(--mono); font-size: 15px; word-break: break-all; padding: 9px 11px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; min-height: 40px; }
.cv-gen-op { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; margin: 4px 0 10px; }
.cv-gen-op label { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.cv-gen input[type=range] { width: 100%; margin-top: 6px; accent-color: var(--accent); }
.cv-sec { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; }
.cv-sec summary { padding: 9px 12px; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--muted); }
.cv-sec > div { padding: 2px 12px 0; }
.cv-ex { display: grid; grid-template-columns: 1fr 1.6fr auto auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.cv-ex .cv-in { margin-top: 0; }
.cv-ex label { font-size: 12px; display: flex; gap: 4px; align-items: center; color: var(--muted); white-space: nowrap; cursor: pointer; }
#cf-ex:empty { display: none; } #cf-ex { margin-bottom: 12px; }
.cv-pie { font-size: 11.5px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 10px; }
@media (max-width: 700px) {
    .cv-ex { grid-template-columns: 1fr auto auto; } .cv-ex .cv-in { grid-column: 1 / -1; grid-row: 2; }
    .cv-hide-sm { display: none; } .cv-acc #cv-menu { padding: 7px 10px; }
    .row > label.f[style] { flex: 1 1 auto !important; }
}
/* Cabecera en móvil (6 pestañas): sin logo y pestañas desplazables si no caben */
@media (max-width: 520px) {
    .brand { display: none; }
    .tabs { margin-left: 0; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
    .tabs::-webkit-scrollbar { display: none; }
    .tabs a { padding: 8px 6px; flex: none; }
    .top-actions { gap: 4px; margin-left: 4px; }
    .pill { padding: 6px 9px; } .icon-btn { width: 30px; }
}

/* ---------- Fondo de la pantalla de entrada (img/login-bg.jpg) ---------- */
body.auth.auth-bg { background: #2d3539 url("../img/login-bg.jpg") center / cover no-repeat fixed; position: relative; }
body.auth.auth-bg::before { content: ""; position: fixed; inset: 0; background: linear-gradient(180deg, rgba(20, 28, 38, .15), rgba(20, 28, 38, .45)); pointer-events: none; }
body.auth.auth-bg .auth-card { position: relative; background: color-mix(in srgb, var(--surface) 88%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 10px 40px rgba(0, 0, 0, .35); }
@media (hover: none), (pointer: coarse) { body.auth.auth-bg { background-attachment: scroll; } }

/* ---------- Tamaño de letra (Aa) ---------- */
.top { font-size: 14px; }
.btn-fz { font-weight: 700; font-size: 15px; letter-spacing: -.5px; }
.dd-fz { min-width: 200px; }
.fz-row { display: flex; align-items: center; gap: 6px; padding: 4px; }
.fz-row button { flex: 1; text-align: center !important; border: 1px solid var(--line) !important; font-weight: 700 !important; font-size: 16px !important; }
.fz-row b { min-width: 52px; text-align: center; font-variant-numeric: tabular-nums; }
.dd-fz .fz-reset { text-align: center; color: var(--muted); font-size: 13px; }
.ed-texto { font-size: calc(15.5px * var(--fz)); }
.ed-titulo { font-size: calc(24px * var(--fz)); }
.ed-resumen textarea, .ed-meta .kw-in { font-size: calc(13px * var(--fz)); }
.nota-it .pre, .lista .t span, .lista .d, .rel span, .cv-it .t span, .cmdk-i span, .nota-it .f { font-size: calc(12px * var(--fz)); }
.ref-it .x, .mar-it .x, .tip, .pal-card p { font-size: calc(13px * var(--fz)); }
.flash .fr { font-size: calc(22px * var(--fz)); } .flash .rv { font-size: calc(16px * var(--fz)); }
.page-head h1, .hero h1 { font-size: calc(24px * var(--fz)); }
.ptabs button { font-size: calc(12px * var(--fz)); }
@media (hover: none), (pointer: coarse) {
    input[type=text], input[type=password], input[type=number], input[type=search], input[type=url], input[type=email], input[type=date], select, textarea { font-size: max(16px, calc(14px * var(--fz))); }
    .ed-texto { font-size: calc(17px * var(--fz)); }
    .top input, .top select { font-size: 16px; }
}

/* ---------- Notas de voz ---------- */
.ed-texto a.voz { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft); color: var(--accent); padding: 2px 10px; border-radius: 99px; text-decoration: none !important; font-weight: 600; font-size: .92em; cursor: pointer; white-space: nowrap; }
.voz-rec { text-align: center; }
.voz-t { font-size: 38px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -1px; margin: 4px 0 8px; }
.voz-nivel { height: 6px; border-radius: 99px; background: var(--surface2); overflow: hidden; max-width: 260px; margin: 0 auto 16px; }
.voz-nivel i { display: block; height: 100%; width: 0; background: var(--ok); border-radius: 99px; transition: width .08s; }
.voz-b { width: 76px; height: 76px; border-radius: 50%; border: 4px solid var(--line); background: var(--surface); color: var(--danger); font-size: 30px; cursor: pointer; display: inline-grid; place-items: center; transition: .15s; }
.voz-b:hover { border-color: var(--danger); }
.voz-b.on { background: var(--danger); color: #fff; border-color: color-mix(in srgb, var(--danger) 45%, transparent); animation: vzp 1.4s infinite; }
.voz-b[disabled] { opacity: .5; }
@keyframes vzp { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--danger) 18%, transparent); } }
.voz-rec audio, .adj-aud audio, .voz-player audio { width: 100%; height: 40px; }
#vz-a { margin-top: 12px; }
.adj-aud { grid-column: 1 / -1; }
.adj-aud .aud { display: flex; align-items: center; gap: 6px; padding: 8px 8px 2px; } .adj-aud .aud span { font-size: 18px; }
.adj-aud .acc { position: static; display: flex; justify-content: flex-end; padding: 0 6px 6px; } .adj-aud .acc button { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.adj-aud .nm { padding-right: 70px; margin-bottom: -26px; }
.voz-player { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(520px, calc(100vw - 24px)); display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 8px 8px 8px 14px; z-index: 150; }
.voz-player .vp-t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 38%; }

/* ---------- Modo app instalada (pantalla completa) ---------- */
@media (display-mode: standalone) {
    html, body { overscroll-behavior: none; }
    body { -webkit-user-select: none; user-select: none; }
    input, textarea, select, [contenteditable], .ed-texto, .ed-texto * { -webkit-user-select: text; user-select: text; }
    .toasts { bottom: max(16px, env(safe-area-inset-bottom)); }
}

/* ---------- Impresión / PDF desde el navegador: solo la nota, a tamaño de página ---------- */
@media print {
    @page { size: A4; margin: 18mm 16mm; }
    :root { --bg: #fff; --surface: #fff; --text: #111; --muted: #555; --line: #ccc; --accent: #1f5f6e; --accent-soft: transparent; color-scheme: light; }
    html, body { height: auto !important; background: #fff !important; }
    .top, .n-izq, .n-der, .toolbar, .ed-meta, .ed-estado, #e-back, .ed-tipo, .toasts, .voz-player, #modales, .ac, #mas-m { display: none !important; }
    .view, .notas, .n-ed, .ed-scroll { position: static !important; display: block !important; overflow: visible !important; height: auto !important; inset: auto !important; }
    .ed-top { padding: 0 0 8px; border-bottom: 1px solid #ccc; margin-bottom: 12px; }
    .ed-titulo { font-size: 22pt !important; padding: 0 !important; }
    .ed-hoja { padding: 0; max-width: 100%; }
    .ed-texto { font-size: 11pt !important; line-height: 1.55; min-height: 0; padding: 0; }
    .ed-texto img { max-width: 100%; page-break-inside: avoid; }
    .ed-texto h1, .ed-texto h2, .ed-texto h3 { page-break-after: avoid; }
    .ed-texto pre, .ed-texto blockquote, .ed-texto table { page-break-inside: avoid; }
    a.wl { color: #1f5f6e; } a.wl::before { display: none; }
    .ed-resumen { border: 1px solid #ccc; }
}

/* ---------- v2.5: cabecera, columnas y pies más legibles ---------- */
.top { font-size: 15px; gap: 16px; }
.brand { gap: 11px; font-size: 23px; font-weight: 600; letter-spacing: -.4px; }
.brand b { font-weight: 800; }
.brand-logo { width: 40px; height: 40px; border-radius: 10px; display: block; flex: none; }
.tabs { gap: 4px; }
.tabs a { font-size: 15.5px; font-weight: 700; color: var(--text); padding: 9px 15px; opacity: .82; }
.tabs a:hover, .tabs a.on { opacity: 1; }
.tabs a span { font-size: 17px; }
.top .pill { font-weight: 700; color: var(--text); padding: 8px 14px; }
.top .btn { font-weight: 700; font-size: 15px; padding: 9px 16px; }
.top .icon-btn { width: 40px; height: 40px; font-size: 19px; color: var(--text); }
.btn-fz { font-size: 17px !important; font-weight: 800 !important; }
/* Pies (lista y editor) */
.n-pie, .ed-estado { font-size: 13.5px; font-weight: 700; color: var(--text); }
.n-pie button, .n-pie select { font-size: 13.5px !important; font-weight: 700; color: var(--text) !important; }
.ed-estado { padding: 9px 16px; }
.n-pie { padding: 9px 12px; }
/* Columnas laterales en gris para separar del editor */
.n-izq, .n-der { background: var(--side); }
.n-izq .carp:hover, .n-izq .nota-it:hover, .n-der .rel:hover { background: var(--side-h); }
.n-izq .n-pie, .n-der .ptabs { background: var(--side); }
.n-der .ref-it, .n-der .adj, .n-der .adj-drop { background: var(--surface); }
.n-tipos button { background: var(--surface); }
/* Título de la nota */
.ed-top input.ed-titulo { font-size: calc(27px * var(--fz)); font-weight: 800; letter-spacing: -.5px; line-height: 1.2; color: var(--text); }
.ed-top { padding-top: 14px; }
@media (max-width: 1180px) { .brand { font-size: 21px; } .tabs a { padding: 9px 12px; } }
@media (max-width: 900px) { .brand-logo { width: 36px; height: 36px; } .tabs a { padding: 9px 13px; } }
@media (max-width: 700px) { .ed-top input.ed-titulo { font-size: calc(22px * var(--fz)); } }
@media print { .ed-top input.ed-titulo { font-size: 22pt !important; } }
@media (min-width: 1025px) { .brand-txt { display: inline !important; } }

/* ---------- v2.6: notas adaptables con barras de iconos ---------- */
@media (max-width: 900px) {
    .toolbar [data-c="izq"], .toolbar [data-c="der"], .toolbar [data-c="izq"] + .tb-sep { display: none; }
    #e-back { display: none; }
    .sub-tabs { overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; } .sub-tabs a { flex: none; white-space: nowrap; }
}
@media (max-width: 520px) {
    .n-rail { width: 46px; } .n-rail button { width: 38px; height: 38px; font-size: 17px; }
    .notas.izq-flot .n-izq { left: 46px; width: calc(100% - 46px); } .notas.der-flot .n-der { right: 46px; width: calc(100% - 46px); }
}
@media print { .n-rail { display: none !important; } }
/* Móvil: las secciones pasan a una barra inferior, como una app */
@media (max-width: 520px) {
    :root { --bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }
    .brand { display: flex !important; } .brand-txt { display: none !important; } .brand-logo { width: 34px; height: 34px; }
    .tabs { position: fixed; left: 0; right: 0; bottom: 0; height: var(--bottom); padding: 0 4px env(safe-area-inset-bottom, 0px); margin: 0; background: var(--surface); border-top: 1px solid var(--line); display: flex; justify-content: space-around; align-items: stretch; overflow: visible; z-index: 55; }
    .tabs a { flex: 1 1 0; flex-direction: column; justify-content: center; gap: 1px; padding: 4px 0 !important; border-radius: 10px; margin: 5px 2px; font-size: 11px; }
    .tabs a em { display: block !important; font-size: 11px; font-weight: 700; }
    .tabs a span { font-size: 20px; }
    .view { bottom: var(--bottom); }
    .top-actions { margin-left: auto; }
    .toasts { bottom: calc(var(--bottom) + 10px); }
    .voz-player { bottom: calc(var(--bottom) + 10px); }
}
@media (max-width: 520px) {
    .ed-top { flex-wrap: wrap; padding: 10px 12px 0; } .ed-top input.ed-titulo { flex: 1 1 100%; order: 2; font-size: calc(21px * var(--fz)); }
    .ed-tipo { margin-left: auto; }
    .toolbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 4px 8px; } .toolbar::-webkit-scrollbar { display: none; } .tb { flex: none; }
    .ed-estado { gap: 10px; white-space: nowrap; overflow: hidden; } .ed-estado .sp ~ span { display: none; }
    .ed-meta { padding: 6px 12px; }
}

/* ---------- v2.7: color por nota (paleta tipo Keep, tonos claro/oscuro) ---------- */
:root {
    --nc-rojo: #faafa8; --nc-naranja: #f39f76; --nc-amarillo: #fff8b8; --nc-verde: #e2f6d3; --nc-turquesa: #b4ddd3; --nc-celeste: #d4e4ed;
    --nc-azul: #aeccdc; --nc-morado: #d3bfdb; --nc-rosa: #f6e2dd; --nc-marron: #e9e3d4; --nc-gris: #efeff1;
}
:root[data-theme="dark"] {
    --nc-rojo: #77172e; --nc-naranja: #692b17; --nc-amarillo: #7c4a03; --nc-verde: #264d3b; --nc-turquesa: #0c625d; --nc-celeste: #256377;
    --nc-azul: #284255; --nc-morado: #472e5b; --nc-rosa: #6c394f; --nc-marron: #4b443a; --nc-gris: #232427;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --nc-rojo: #77172e; --nc-naranja: #692b17; --nc-amarillo: #7c4a03; --nc-verde: #264d3b; --nc-turquesa: #0c625d; --nc-celeste: #256377;
        --nc-azul: #284255; --nc-morado: #472e5b; --nc-rosa: #6c394f; --nc-marron: #4b443a; --nc-gris: #232427;
    }
}
.nc-rojo { --nc: var(--nc-rojo); } .nc-naranja { --nc: var(--nc-naranja); } .nc-amarillo { --nc: var(--nc-amarillo); } .nc-verde { --nc: var(--nc-verde); }
.nc-turquesa { --nc: var(--nc-turquesa); } .nc-celeste { --nc: var(--nc-celeste); } .nc-azul { --nc: var(--nc-azul); } .nc-morado { --nc: var(--nc-morado); }
.nc-rosa { --nc: var(--nc-rosa); } .nc-marron { --nc: var(--nc-marron); } .nc-gris { --nc: var(--nc-gris); }
.nota-it.nc, .n-izq .nota-it.nc { background: var(--nc); border-color: color-mix(in srgb, var(--text) 8%, transparent); margin-bottom: 3px; }
.nota-it.nc:hover, .n-izq .nota-it.nc:hover { background: color-mix(in srgb, var(--nc) 88%, var(--text)); }
.nota-it.nc.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.nota-it.nc.prio-1.on, .nota-it.nc.prio-2.on, .nota-it.nc.prio-3.on { border-color: var(--accent); }
.n-ed.nc { background: var(--nc); }
.n-ed.nc .ed-scroll { background: transparent; }
.lista li > a.nc { background: var(--nc); margin-bottom: 3px; }
.lista li > a.nc:hover { background: color-mix(in srgb, var(--nc) 88%, var(--text)); }
.nc-pop { position: fixed; z-index: 150; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 10px; }
.nc-g { display: grid; grid-template-columns: repeat(6, 32px); gap: 8px; }
.nc-pop .nc-sw { width: 32px; height: 32px; padding: 0; border-radius: 50%; border: 2px solid var(--line); background: var(--nc, var(--surface)); cursor: pointer; display: grid; place-items: center; }
.nc-pop .nc-sw:hover { border-color: var(--muted); }
.nc-pop .nc-sw.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.nc-pop .nc-sw.nc-0::after { content: "⊘"; color: var(--muted); font-size: 16px; line-height: 1; }

/* ---------- v2.7: listas de tareas (casillas estilo Keep) ---------- */
.ed-hoja.es-lista .ed-texto { flex: none; min-height: 1.7em; padding: 0 0 10px; }
.ed-hoja.es-lista .ed-texto:empty:before { content: "Descripción (opcional)…"; }
#e-ck { flex: 1; }
.ck { padding-bottom: 40px; }
.ck-it { display: flex; align-items: flex-start; gap: 4px; padding: 2px 2px; border-top: 1px solid transparent; border-bottom: 1px solid transparent; }
.ck-it.n1 { margin-left: 30px; }
.ck-it:focus-within { border-color: color-mix(in srgb, var(--text) 14%, transparent); }
.ck-drag { flex: none; width: 18px; height: calc(1.6em + 4px); display: grid; place-items: center; color: var(--muted); cursor: grab; opacity: 0; touch-action: none; -webkit-user-select: none; user-select: none; font-size: 14px; }
.ck-drag-x { cursor: default; }
.ck-it:hover .ck-drag:not(.ck-drag-x), .ck-it:focus-within .ck-drag:not(.ck-drag-x) { opacity: .75; }
.ck-box { flex: none; width: 20px; height: 20px; margin: calc((1.6em - 20px) / 2 + 2px) 6px 0 2px; padding: 0; border: 2px solid var(--muted); border-radius: 4px; background: transparent; cursor: pointer; display: grid; place-items: center; color: var(--accent-text); font: inherit; }
.ck-box:hover { border-color: var(--accent); }
.ck-it.hecho .ck-box { background: var(--accent); border-color: var(--accent); }
.ck-it.hecho .ck-box::after { content: "✓"; font-size: 14px; font-weight: 800; line-height: 1; }
.ck-tx { flex: 1; min-width: 0; outline: none; font-size: calc(15.5px * var(--fz)); line-height: 1.6; padding: 2px 0; white-space: pre-wrap; overflow-wrap: anywhere; cursor: text; -webkit-user-select: text; user-select: text; }
.ck-tx:empty:before { content: attr(data-ph); color: var(--muted); opacity: .7; }
.ck-it.hecho .ck-tx { text-decoration: line-through; color: var(--muted); }
.ck-x { flex: none; width: 28px; height: calc(1.6em + 4px); border: 0; background: transparent; color: var(--muted); border-radius: 6px; cursor: pointer; opacity: 0; font: inherit; }
.ck-it:hover .ck-x, .ck-it:focus-within .ck-x { opacity: 1; }
.ck-x:hover { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--danger); }
.ck-add { display: flex; align-items: center; gap: 8px; margin-left: 22px; padding: 5px 4px; color: var(--muted); cursor: text; border-radius: 6px; font-size: calc(15.5px * var(--fz)); }
.ck-add span { width: 22px; text-align: center; font-size: 18px; line-height: 1; }
.ck-add:hover, .ck-add:focus { color: var(--text); outline: none; background: color-mix(in srgb, var(--text) 5%, transparent); }
.ck-dh { display: flex; align-items: center; gap: 4px; margin-top: 12px; padding: 8px 0 4px; border-top: 1px solid color-mix(in srgb, var(--text) 14%, transparent); flex-wrap: wrap; }
.ck-dh .sp { flex: 1; }
.ck-pl, .ck-ac { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 5px 8px; border-radius: 6px; }
.ck-pl:hover, .ck-ac:hover { background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); }
.ck-del:hover { color: var(--danger); }
.ck.ck-arr, .ck.ck-arr * { -webkit-user-select: none; user-select: none; cursor: grabbing; }
.ck-it.arrastra { background: var(--surface); box-shadow: var(--shadow); border-radius: 6px; position: relative; z-index: 2; }
.ck-it.arrastra .ck-drag { opacity: 1; }
.nota-it .ck-prog { font-weight: 700; font-variant-numeric: tabular-nums; } .nota-it .ck-prog.ok { color: var(--ok); }
.ck-ini .t .bar { margin-top: 5px; }
@media (hover: none), (pointer: coarse) {
    .ck-drag:not(.ck-drag-x) { opacity: .5; width: 26px; }
    .ck-drag-x { width: 26px; }
    .ck-x { opacity: .6; width: 36px; }
    .ck-tx, .ck-add { font-size: calc(17px * var(--fz)); }
    .ck-box { width: 24px; height: 24px; margin-top: calc((1.6em - 24px) / 2 + 2px); }
    .ck-it.n1 { margin-left: 26px; }
    .ck-add { margin-left: 30px; padding: 9px 4px; }
    .ck-pl, .ck-ac { padding: 9px 10px; }
}
@media print {
    .ck-drag, .ck-x, .ck-add, .ck-ac { display: none !important; }
    .ck-dl[hidden] { display: block !important; }
    .n-ed.nc { background: #fff !important; }
    .ck-it { break-inside: avoid; }
}

/* ---------- v2.7.1: orden de carpetas (A-Z / manual arrastrando) ---------- */
.carp-h .carp-ord { width: auto; margin-left: auto; margin-right: 2px; padding: 0 7px; font-size: 11px; font-weight: 700; letter-spacing: .3px; text-transform: none; white-space: nowrap; }
.carp-h .carp-ord.on { color: var(--accent); background: var(--accent-soft); }
.carp > .carp-drag { flex: none; width: 14px; margin-right: -2px; color: var(--muted); cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; font-size: 13px; line-height: 1; opacity: .55; text-align: center; }
.carp:hover .carp-drag { opacity: 1; }
.carp.arrastra { background: var(--surface) !important; box-shadow: var(--shadow); position: relative; z-index: 2; cursor: grabbing; }
.carp.arrastra .carp-drag { cursor: grabbing; opacity: 1; }
@media (hover: none), (pointer: coarse) {
    .carp-h .carp-ord { width: auto; height: 32px; padding: 0 10px; font-size: 12px; }
    .carp > .carp-drag { width: 24px; font-size: 16px; opacity: .7; }
}

/* v2.8 · historial de versiones y documentos versionados */
.vbadge { display: inline-block; font-size: 10px; font-weight: 700; padding: 0 5px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); vertical-align: 1px; }
.vh-top { display: flex; gap: 8px; margin-bottom: 10px; } .vh-top input { flex: 1; min-width: 0; }
.vh-lst { max-height: 34vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; }
.vh-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.vh-row:last-child { border-bottom: 0; }
.vh-n { font-weight: 700; color: var(--accent); min-width: 32px; }
.vh-i { flex: 1; min-width: 160px; display: flex; flex-direction: column; font-size: 12px; } .vh-i b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .vh-i span { color: var(--muted); }
.vh-a { display: flex; gap: 4px; flex-wrap: wrap; }
.vh-det { max-height: 34vh; overflow: auto; margin-bottom: 8px; }
.vh-pre { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--surface2); overflow-wrap: anywhere; } .vh-pre img { max-width: 100%; }
.vh-items { list-style: none; margin: 0; padding: 0; }
.df-box { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; font-size: 13px; }
.df { padding: 2px 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.df-add { background: rgba(29, 154, 98, .18); } .df-del { background: rgba(220, 53, 69, .18); text-decoration: line-through; text-decoration-color: rgba(220, 53, 69, .6); }
.df-gap { color: var(--muted); font-size: 11px; text-align: center; background: var(--surface2); }
.df-add-k { color: #1d9a62; } .df-del-k { color: #dc3545; }

/* ---------- v2.8.2: pies azul marino, más anchos ---------- */
.n-izq .n-pie, .n-pie, .ed-estado, .n-izq .n-pag { background: #1A2744 !important; color: #fff !important; border-top: 0 !important; box-sizing: border-box; }
.n-izq .n-pie, .n-pie, .ed-estado { min-height: 56px !important; padding-top: 16px !important; padding-bottom: max(16px, env(safe-area-inset-bottom)) !important; font-size: 15px !important; font-weight: 700; align-items: center; }
.ed-estado { padding-left: 20px !important; padding-right: 20px !important; gap: 18px; }
.n-pie { padding-left: 14px !important; padding-right: 14px !important; gap: 10px; white-space: nowrap; }
.n-pie > * { white-space: nowrap; min-width: 0; }
.n-pie span, .ed-estado span, .n-pie button, .n-pie select { color: #fff !important; font-size: 14.5px !important; font-weight: 700; }
.n-pie button:hover { color: #3FA6A6 !important; }
.n-pie select { background: transparent !important; border: 0 !important; max-width: 100px; text-overflow: ellipsis; padding: 4px 2px !important; min-height: 0 !important; height: auto !important; }
.n-pie select option { color: #1A2744; background: #fff; }
.ed-estado .guard-ok { color: #7be0b0 !important; } .ed-estado .guard-pend { color: #ffc566 !important; }
.n-pag { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 8px 12px; font-size: 14px; font-weight: 700; border-bottom: 1px solid rgba(255,255,255,.14); }
.n-pag:empty { display: none; }
.n-pag button { background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 6px; min-width: 44px; min-height: 36px; font-size: 20px; line-height: 1; cursor: pointer; }
.n-pag button:hover:not(:disabled) { background: #3FA6A6; }
.n-pag button:disabled { opacity: .35; cursor: default; }
.nota-it { padding: 12px 12px; }

/* ---------- v2.9.0: Repaso FSRS · idiomas, mazos, importación, estadísticas ---------- */
:root { --c-n: #2f6fd6; --c-a: #c8463a; --c-r: #1d9a62; }
:root[data-theme="dark"] { --c-n: #7fb0ff; --c-a: #ff8f84; --c-r: #5ad9a0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --c-n: #7fb0ff; --c-a: #ff8f84; --c-r: #5ad9a0; } }
.rep-ancho { max-width: 1180px; }
.rep-tabs { align-items: center; }
.rep-tabs .rep-cfg { margin-left: auto; border: 0; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; padding: 6px 10px; border-radius: 8px; }
.rep-tabs .rep-cfg:hover { color: var(--accent); background: var(--accent-soft); }
.rep-top { flex-wrap: wrap; }
.rp-mazo { width: auto !important; max-width: 230px; padding: 5px 8px !important; font-size: 13px; }
.rp-cnt { display: inline-flex; gap: 8px; font-variant-numeric: tabular-nums; font-size: 15px; }
.c-n { color: var(--c-n); } .c-a { color: var(--c-a); } .c-r { color: var(--c-r); }
i.c-n, i.c-r { font-style: normal; font-weight: 700; }
.rp-tools { display: inline-flex; gap: 4px; }
.rp-tools button { width: 34px; height: 34px; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 8px; cursor: pointer; font-size: 15px; display: grid; place-items: center; }
.rp-tools button:hover:not(:disabled) { border-color: var(--accent); }
.rp-tools button.tg { opacity: .45; } .rp-tools button.tg.on { opacity: 1; background: var(--accent-soft); border-color: var(--accent); }
.rp-tools button:disabled { opacity: .3; cursor: default; }
.rp-off { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); font-weight: 600; }
.rp-card .lugar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rp-card .lugar > a, .rp-card .lugar > span:first-child { flex: 0 1 auto; }
.rp-est { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--surface2); color: var(--muted); white-space: nowrap; }
.rp-est.e0 { color: var(--c-n); background: color-mix(in srgb, var(--c-n) 12%, transparent); }
.rp-est.e1, .rp-est.e3 { color: var(--c-a); background: color-mix(in srgb, var(--c-a) 12%, transparent); }
.rp-est.e2 { color: var(--c-r); background: color-mix(in srgb, var(--c-r) 12%, transparent); }
.rp-voz { margin-left: auto; display: inline-flex; gap: 4px; }
.rp-voz button { border: 1px solid var(--line); background: var(--surface2); border-radius: 8px; padding: 4px 9px; cursor: pointer; font-size: 15px; }
.rp-voz button:hover { border-color: var(--accent); }
.flash .fr-cz { font-weight: 600; line-height: 1.55; }
.cz { display: inline-block; min-width: 3.2em; padding: 0 .45em; border-bottom: 2px solid var(--accent); background: var(--accent-soft); color: var(--accent); border-radius: 4px 4px 0 0; text-align: center; font-weight: 700; }
.cz.cz-r { min-width: 0; }
.flash .pista { margin-top: 10px; color: var(--muted); font-style: italic; font-size: calc(16px * var(--fz)); line-height: 1.45; }
.rp-in { margin-top: 18px; font-size: calc(18px * var(--fz)) !important; padding: 11px 13px !important; }
.rp-diff { margin-top: 18px; padding: 10px 13px; border-radius: 10px; font-size: calc(18px * var(--fz)); background: var(--surface2); overflow-wrap: anywhere; }
.rp-diff.ok, .rp-diff.acentos { background: color-mix(in srgb, var(--ok) 14%, transparent); }
.rp-diff.no { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.rp-diff del { color: var(--danger); text-decoration: line-through; background: color-mix(in srgb, var(--danger) 16%, transparent); }
.rp-diff ins { color: var(--ok); text-decoration: underline; background: color-mix(in srgb, var(--ok) 16%, transparent); }
.rp-diff small { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.rp-extra { margin-top: 12px; font-size: 13px; color: var(--muted); white-space: pre-wrap; }
.rp-show { width: 100%; justify-content: center; padding: 12px; }
.q-btns button { --qc: var(--line); box-shadow: inset 0 3px 0 var(--qc); }
.q-btns .qg1 { --qc: var(--danger); } .q-btns .qg2 { --qc: var(--warn); } .q-btns .qg3 { --qc: var(--ok); } .q-btns .qg4 { --qc: var(--c-n); }
.q-btns button:hover { box-shadow: inset 0 3px 0 var(--qc), var(--shadow); }
.q-btns button.sug { outline: 2px solid var(--accent); outline-offset: 1px; }
/* tarjetas */
.rp-mazos { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.rp-mz { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.rp-mz:hover { border-color: var(--accent); } .rp-mz.on { background: var(--accent-soft); border-color: var(--accent); }
.rp-mz b { font-size: 13px; } .rp-mz span { font-size: 12px; color: var(--muted); }
.rp-mz a, .rp-mz button { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 2px 6px; border-radius: 6px; font-size: 13px; }
.rp-mz a:hover, .rp-mz button:hover { color: var(--accent); background: var(--surface2); }
.rp-filtros { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.rp-filtros input[type=search] { flex: 1 1 260px; width: auto; } .rp-filtros select { width: auto; flex: 0 1 220px; }
.rp-bulk { position: sticky; top: 0; z-index: 5; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 8px 10px; margin-bottom: 8px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent-soft); }
.rp-bulk b { margin-right: 6px; }
.rp-res { margin: 4px 2px 6px; }
.rp-lista li.sel > .it { background: var(--accent-soft); }
.rp-it input[type=checkbox] { width: 18px; height: 18px; flex: none; }
.rp-it .ori { flex: none; }
.rp-it .t { min-width: 0; }
.rp-it .rp-fr { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* importar */
.rp-imp { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 16px; align-items: start; }
.rp-imp textarea { min-height: 360px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.5; resize: vertical; }
.rp-imp-r { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
label.ck { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; margin: 4px 0 8px; cursor: pointer; }
label.ck input { width: 16px; height: 16px; margin-top: 2px; flex: none; }
.rp-ayuda { margin-top: 14px; font-size: 12.5px; } .rp-ayuda summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.rp-ayuda ul { padding-left: 18px; margin: 8px 0 0; } .rp-ayuda li { margin-bottom: 5px; }
.rp-ayuda code { font-size: 11.5px; background: var(--surface2); padding: 1px 4px; border-radius: 4px; }
#im-res { margin-top: 16px; }
.rp-sum { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.chip.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); } .chip.err { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.rp-tab { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--surface); }
.rp-tab th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.rp-tab td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.rp-tab tr.err td { color: var(--danger); } .rp-tab tr.dup td { opacity: .55; }
/* estadísticas */
.rp-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.rp-kpi { display: flex; flex-direction: column; gap: 2px; }
.rp-kpi span { font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; }
.rp-kpi b { font-size: 26px; line-height: 1.15; font-variant-numeric: tabular-nums; } .rp-kpi small { color: var(--muted); font-size: 12px; }
.rp-bars { display: flex; align-items: flex-end; gap: 2px; height: 140px; padding-bottom: 16px; position: relative; border-bottom: 1px solid var(--line); }
.rp-b { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; min-width: 0; }
.rp-b i { display: block; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 0; }
.rp-b:hover i { background: var(--accent-h); }
.rp-b span { position: absolute; bottom: -16px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--muted); white-space: nowrap; }
.rp-bars-max { text-align: right; margin-top: 4px; }
/* formularios del repaso */
.rp-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.rp-form .full { grid-column: 1 / -1; }
.rp-form small, label.f small { display: block; font-weight: 400; margin-top: 3px; color: var(--muted); }
@media (max-width: 900px) { .rp-imp { grid-template-columns: 1fr; } .rp-imp textarea { min-height: 220px; } }
@media (max-width: 700px) {
    .rp-form { grid-template-columns: 1fr; }
    .rep-top .bar { order: 5; flex-basis: 100%; }
    .rp-mazo { max-width: 46vw; }
    .rp-it .rp-est { display: none; }
}
.rp-it .rp-fr b, .rp-it .rp-fr span { display: inline !important; white-space: nowrap; }
.rp-tab td:last-child a { white-space: nowrap; }

/* ---------- v3.0.0: Idiomas (NeuroLingo 150) ---------- */
.idi .sub-tabs.idi-tabs { margin-bottom: 14px; }
.idi-hero { background: linear-gradient(135deg, #1A2744, #2a7889); }
.idi-hero p { line-height: 1.55; }
.idi-90 { display: flex; gap: 4px; margin-top: 10px; max-width: 420px; }
.idi-90 span { flex: 1; height: 7px; border-radius: 99px; background: rgba(255,255,255,.22); overflow: hidden; }
.idi-90 i { display: block; height: 100%; background: #7be0b0; }
.idi-bloques { list-style: none; margin: 0; padding: 0; }
.idi-bloques li { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-bottom: 1px dashed var(--line); }
.idi-bloques li:last-child { border-bottom: 0; }
.idi-bloques li.cur { background: var(--accent-soft); border-radius: 10px; }
.idi-bloques .ib { font-size: 22px; width: 32px; text-align: center; flex: none; }
.idi-bloques li > div { flex: 1; min-width: 0; } .idi-bloques b { display: block; } .idi-bloques small { color: var(--muted); font-size: 12px; }
.idi-bloques .chip, .idi-bloques .muted { flex: none; }
.idi-kpi { margin-bottom: 6px; } .idi-kpi b { font-size: 26px; font-variant-numeric: tabular-nums; }
.idi-tema { font-size: calc(17px * var(--fz)); font-weight: 600; line-height: 1.4; margin: 0 0 4px; }
.idi-aviso { background: color-mix(in srgb, var(--warn) 12%, var(--surface)); border-color: color-mix(in srgb, var(--warn) 40%, transparent); margin: 10px 0; }
.idi-lec .it { flex-wrap: wrap; }
.idi-lec .it > .btn { flex: none; }
.idi-lh { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.idi-lh h2 { margin: 0; font-size: 20px; } .idi-lh > div:first-child { flex: 1 1 260px; min-width: 0; }
.idi-lh .idi-modo { margin: 0; border-bottom: 0; }
.idi-lh-a { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.idi-ctl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.idi-ctl select { width: auto; }
.idi-play { min-width: 56px; justify-content: center; font-size: 16px; }
.idi-pos { flex: 1 1 200px; display: flex; flex-direction: column; gap: 2px; min-width: 160px; }
.idi-pos input[type=range] { width: 100%; padding: 0; accent-color: var(--accent); border: 0; box-shadow: none; }
.btn.tg.on, .btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.idi-yo { display: flex; gap: 8px; align-items: center; margin: -4px 0 12px; padding: 8px 12px; border: 1px dashed var(--accent); border-radius: 10px; }
.idi-yo audio { display: none; }
.idi-texto { max-height: 58vh; overflow: auto; font-size: calc(17px * var(--fz)); line-height: 1.65; }
.idi-texto p { margin: 0 0 4px; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.idi-texto p:hover { background: var(--surface2); }
.idi-texto p.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.idi-texto p small { color: var(--muted); font-size: 11px; margin-right: 8px; font-variant-numeric: tabular-nums; }
.idi-texto span.w-on { background: var(--accent); color: var(--accent-text); border-radius: 4px; padding: 0 2px; }
.idi-dh { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; } .idi-dh select { width: auto; margin-left: auto; }
.idi-dict textarea { font-size: calc(16px * var(--fz)); line-height: 1.5; }
#dc-r { margin-top: 12px; }
.idi-diff { padding: 12px 14px; border-radius: 10px; background: var(--surface2); font-size: calc(16px * var(--fz)); line-height: 1.8; overflow-wrap: anywhere; }
.idi-diff .ok { color: var(--text); }
.idi-diff del { color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); border-radius: 4px; padding: 0 3px; }
.idi-diff ins { color: var(--ok); background: color-mix(in srgb, var(--ok) 16%, transparent); text-decoration: underline dotted; border-radius: 4px; padding: 0 3px; cursor: pointer; font-weight: 600; }
.idi-diff ins.hecha { text-decoration: none; opacity: .6; } .idi-diff ins.hecha::after { content: ' ✓'; }
.idi-score { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-top: 8px; }
.idi-ref { margin-top: 8px; font-size: 13px; color: var(--muted); } .idi-ref summary { cursor: pointer; }
.idi-rec h3 span { display: inline-flex; gap: 4px; }
.idi-meta { position: relative; height: 8px; border-radius: 99px; background: var(--surface2); max-width: 320px; margin: 0 auto 10px; }
.idi-meta i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 99px; background: var(--warn); }
.idi-meta i.bien { background: var(--ok); } .idi-meta i.largo { background: var(--c-n); }
.idi-meta span { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--muted); opacity: .5; }
.idi-gt tbody tr { cursor: pointer; } .idi-gt tbody tr:hover td { background: var(--surface2); }
.idi-tr { font-size: calc(16px * var(--fz)); line-height: 1.9; max-height: 60vh; overflow: auto; }
.idi-tr span { cursor: pointer; border-radius: 4px; } .idi-tr span:hover { background: var(--accent-soft); }
.idi-pz { border: 0; background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); font: inherit; font-size: 11.5px; font-weight: 700; border-radius: 99px; padding: 1px 8px; cursor: pointer; vertical-align: 1px; }
.idi-pz.larga { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.idi-lag { position: sticky; top: 10px; align-self: start; }
.idi-lag h3 .chip { text-transform: none; letter-spacing: 0; }
.idi-creadas { list-style: none; margin: 10px 0 0; padding: 0; font-size: 13px; color: var(--ok); } .idi-creadas li { padding: 3px 0; }
.idi-d { font-size: 12px; font-weight: 700; color: var(--muted); } .idi-d.up { color: var(--ok); } .idi-d.down { color: var(--danger); }
.idi-min { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 6px; }
.idi-min label { font-size: 12px; font-weight: 600; color: var(--muted); }
.idi-diag { padding: 10px 12px; border-radius: 10px; background: var(--surface2); margin: 6px 0 10px; font-size: 13px; overflow-wrap: anywhere; }
/* barra de sesión (visible en toda la app mientras hay sesión) */
.idi-bar { position: fixed; right: 16px; bottom: 16px; z-index: 70; display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 12px; background: #1A2744; color: #fff; border-radius: 14px; box-shadow: var(--shadow); max-width: min(460px, calc(100vw - 32px)); }
.idi-bar .ib-ico { font-size: 22px; }
.idi-bar .ib-t { flex: 1; min-width: 0; } .idi-bar .ib-t b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.idi-bar .ib-t small { font-size: 12px; opacity: .85; font-variant-numeric: tabular-nums; }
.idi-bar .ib-p { height: 4px; border-radius: 99px; background: rgba(255,255,255,.2); margin-top: 4px; overflow: hidden; } .idi-bar .ib-p i { display: block; height: 100%; background: #3FA6A6; }
.idi-bar.fin .ib-p i { background: #FD7E14; } .idi-bar.pausado { opacity: .85; }
.idi-bar button { border: 0; background: rgba(255,255,255,.12); color: #fff; border-radius: 8px; min-width: 34px; height: 34px; font: inherit; font-weight: 700; cursor: pointer; }
.idi-bar button:hover { background: #3FA6A6; }
.idi-pausa { position: fixed; inset: 0; z-index: 90; background: #1A2744; color: #fff; display: grid; place-items: center; text-align: center; padding: 20px; }
.idi-pausa .ip-ico { font-size: 64px; } .idi-pausa h2 { margin: 6px 0; } .idi-pausa .ip-t { font-size: 72px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -2px; }
.idi-pausa p { opacity: .85; line-height: 1.6; } .idi-pausa .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.rp-lat { margin: 8px 0 0; text-align: center; }
@media (max-width: 900px) { .idi-lag { position: static; } }
@media (max-width: 520px) {
    .idi-bar { left: 8px; right: 8px; bottom: calc(var(--bottom) + 8px); max-width: none; }
    .idi-lh-a .btn { flex: none; }
    .idi-pausa .ip-t { font-size: 56px; }
}
@media print { .idi-bar, .idi-pausa { display: none !important; } }
body.idi-ses .view > .page, body.idi-ses .view > .rep { padding-bottom: 96px; }
.card h3 .muted.small, .card h3 .small.muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
@media (min-width: 521px) and (max-width: 1440px) { .tabs a { padding: 9px 10px; gap: 5px; } .tabs { gap: 1px; } #btnBuscar kbd { display: none; } }
@media (min-width: 521px) and (max-width: 1240px) { .tabs a em { display: none; } .tabs a { padding: 9px 11px; } }
@media (min-width: 521px) and (max-width: 720px) {
    .top { gap: 6px; padding-left: 8px !important; padding-right: 8px !important; }
    .tabs { flex: 1 1 0 !important; min-width: 0 !important; overflow-x: auto; scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; }
    .tabs a { padding: 8px 7px !important; flex: none; } .top-actions { gap: 4px; flex: none; }
    #btnBuscar em, #btnNuevo em { display: none; } .pill { padding: 6px 9px; } .icon-btn { width: 30px; }
}

/* ---------- v3.0.1: ayuda de Idiomas ---------- */
.ay-q { font-size: 14px; text-decoration: none; opacity: .75; margin-left: 4px; vertical-align: 2px; text-transform: none; }
.ay-q:hover { opacity: 1; }
.rep-tabs .rep-ay { text-decoration: none; font-size: 16px; } .rep-tabs .rep-ay + .rep-cfg { margin-left: 0; }
.ay { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
.ay-nav { position: sticky; top: 10px; display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; max-height: calc(100vh - 120px); overflow: auto; }
.ay-nav input { margin-bottom: 8px; }
.ay-nav a { padding: 6px 9px; border-radius: 7px; color: var(--text); font-size: 13.5px; }
.ay-nav a:hover { background: var(--surface2); } .ay-nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.ay-c { display: grid; gap: 12px; }
.ay-sec { scroll-margin-top: 12px; line-height: 1.6; font-size: calc(14.5px * var(--fz)); transition: box-shadow .3s; }
.ay-sec h2 { font-size: 18px; margin: 0 0 10px; }
.ay-sec ul, .ay-sec ol { padding-left: 20px; margin: 6px 0; } .ay-sec li { margin-bottom: 5px; }
.ay-sec code { font-size: 12.5px; background: var(--surface2); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.ay-sec .rp-tab { margin: 8px 0; } .ay-sec p { margin: 8px 0; }
.ay-hl { box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.ay-check li::marker { font-weight: 700; color: var(--accent); }
.ay-ok { font-weight: 600; } .ay-del { color: var(--danger); text-decoration: line-through; } .ay-ins { color: var(--ok); text-decoration: underline dotted; font-weight: 600; }
.ay-pz { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); font-size: 12px; font-weight: 700; border-radius: 99px; padding: 1px 8px; }
.card h3 > span:first-child { display: inline-flex; align-items: center; gap: 2px; }
@media (max-width: 900px) {
    .ay { grid-template-columns: 1fr; }
    .ay-nav { position: static; flex-direction: row; flex-wrap: wrap; max-height: none; }
    .ay-nav input { flex: 1 1 100%; }
    .ay-nav a { background: var(--surface2); font-size: 12.5px; }
}

/* ---------- v3.1.0: modo inmersión, chino (pinyin) y traductor ---------- */
.idi-tabs .idi-es { margin-left: auto; font-size: 12.5px; opacity: .85; white-space: nowrap; }
.idi-tabs .idi-es.on { opacity: 1; background: var(--accent-soft); }
.idi-lang { display: inline-block; vertical-align: middle; margin-left: 8px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: rgba(255, 255, 255, .18); }
.idi .idi-t { cursor: help; }
@media (hover: hover) { .idi .idi-t:hover { text-decoration: underline dotted; text-underline-offset: 3px; } }
.idi-zh, .idi-zh p { letter-spacing: .01em; line-height: 1.85; }
.idi-hz { margin-top: 6px; font-size: 1.1em; opacity: .8; }
.idi-trad { list-style: none; margin: 8px 0 12px; padding: 0; display: grid; gap: 8px; }
.idi-trad > li { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--surface); }
.idi-trad .it-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.idi-trad .it-h .ck { margin: 0; }
.idi-trad .it-b { margin-left: auto; display: flex; gap: 4px; }
.idi-trad .rp-form { margin-top: 6px; }
.idi-trad .rp-form:empty { display: none; }
.idi-tres .ok { color: var(--ok); }
.idi-tres .err { color: var(--danger); }
.idi-tres:empty { display: none; }
@media (max-width: 520px) { .idi-trad .it-b { margin-left: 0; width: 100%; } .idi-tabs .idi-es { margin-left: 0; } }
.idi-trad .it-h .ck { flex: 1 1 auto; min-width: 0; }

/* ---------- v3.2.0: tarjeta de idioma ampliada (imagen, pronunciación, producción, extras) ---------- */
.tn1 { color: #d93a3a; } .tn2 { color: #2f9a3f; } .tn3 { color: #2f6fd6; } .tn4 { color: #8a3fc4; } .tn5 { color: var(--muted); }
html[data-theme="dark"] .tn1 { color: #ff8a80; } html[data-theme="dark"] .tn2 { color: #7fdc8c; } html[data-theme="dark"] .tn3 { color: #8cb6ff; } html[data-theme="dark"] .tn4 { color: #d1a2ff; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .tn1 { color: #ff8a80; } html:not([data-theme="light"]) .tn2 { color: #7fdc8c; } html:not([data-theme="light"]) .tn3 { color: #8cb6ff; } html:not([data-theme="light"]) .tn4 { color: #d1a2ff; } }
.rp-card .cz .tn1, .rp-card .cz .tn2, .rp-card .cz .tn3, .rp-card .cz .tn4, .rp-card .cz .tn5 { color: inherit; }
.rp-card.zh .fr { letter-spacing: .01em; }

.rp-img { position: relative; margin: 14px 0 6px; border-radius: 14px; overflow: hidden; background: var(--surface2); min-height: 120px; display: grid; place-items: center; }
.rp-img img { display: block; width: 100%; max-height: 210px; object-fit: cover; cursor: zoom-in; }
.rp-img.vacia, .rp-img.cargando { min-height: 40px; border: 1px dashed var(--line); background: transparent; margin: 10px 0 4px; }
.rp-img.cargando::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 10%, transparent), transparent); animation: rpbrillo 1.2s linear infinite; }
@keyframes rpbrillo { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.rp-img-t { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; z-index: 1; }
.rp-img:hover .rp-img-t, .rp-img.vacia .rp-img-t, .rp-img:focus-within .rp-img-t { opacity: 1; }
@media (hover: none) { .rp-img-t { opacity: .85; } }
.rp-img-t button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--text); cursor: pointer; font-size: 14px; display: grid; place-items: center; backdrop-filter: blur(4px); }
.rp-img-t button:hover { border-color: var(--accent); }
.rp-img.vacia .rp-img-t { position: static; margin-left: 10px; }
.rp-img.vacia { display: flex; align-items: center; justify-content: center; padding: 4px 8px; }
.rp-img.vacia .rp-img-t button { width: 28px; height: 28px; font-size: 13px; }

.rp-pron { margin-top: 8px; color: var(--accent); font-size: calc(16px * var(--fz)); line-height: 1.45; letter-spacing: .01em; }
.rp-prod { text-align: center; padding: 12px 0 4px; }
.rp-prod small { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
.rp-prod .prod-es { font-size: calc(24px * var(--fz)); font-weight: 700; line-height: 1.3; margin: 10px 0 16px; }
.prod-t { height: 6px; border-radius: 4px; background: var(--surface2); overflow: hidden; }
.prod-t i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .1s linear; }
.prod-t.fin i { background: var(--warn); }

.rp-asoc { margin-top: 14px; padding: 10px 13px; border-radius: 10px; background: var(--mar-bg); color: var(--mar-text); border: 1px solid var(--mar-line); white-space: pre-wrap; line-height: 1.5; }
.rp-pal { margin-top: 8px; font-size: 13px; }
.rp-xtra { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.rp-xtra button { border: 1px solid var(--line); background: var(--surface2); color: var(--text); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 13px; }
.rp-xtra button:hover { border-color: var(--accent); }
.rp-xtra button.on { background: var(--accent-soft); border-color: var(--accent); }
.rp-pn { margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface2); }
.rp-pn textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); resize: vertical; }
.rp-ej, .rp-fa { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rp-ej li, .rp-fa li { display: flex; gap: 8px; align-items: flex-start; line-height: 1.45; }
.rp-ej li > div { display: flex; flex-direction: column; min-width: 0; }
.rp-ej-t { font-weight: 600; }
.rp-ej-p { color: var(--accent); } .rp-ej-es { color: var(--muted); font-style: italic; } .rp-ej-f { color: var(--muted); font-size: 10px; opacity: .7; }
.rp-ej-v { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 2px 7px; cursor: pointer; font-size: 13px; }
.rp-fa-b { margin-bottom: 8px; }
.rp-fa li small { color: var(--accent); }
.rp-dilo { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface2); }
.rp-dilo .idi-diff { padding: 0; background: none; }
.rp-dilo small { display: block; margin-top: 6px; color: var(--muted); }
.rp-dilo.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); }
.rp-dilo.medio { background: color-mix(in srgb, var(--warn) 14%, transparent); }
.rp-dilo.mal { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.rp-dilo .idi-diff ins { cursor: default; color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); text-decoration: underline wavy; font-weight: 600; }
.rp-dilo .idi-diff .ok { color: var(--ok); font-weight: 600; }
.rp-dilo .idi-diff del { color: var(--muted); background: none; }
.rp-hz { margin-top: 6px; font-size: calc(20px * var(--fz)); letter-spacing: .08em; }
.rep-enfoque .rp-hz { font-size: calc(28px * var(--fz)); }
.rp-hz-s { margin-left: 6px; color: var(--muted); letter-spacing: .05em; }
.rp-ej-t + .rp-hz-s { margin-left: 0; }

.rep.rep-enfoque { max-width: 980px; }
.rep-enfoque .flash { padding: 34px 40px; min-height: 62vh; }
.rep-enfoque .flash .fr { font-size: calc(32px * var(--fz)); line-height: 1.3; }
.rep-enfoque .flash .fr-cz { line-height: 1.5; }
.rep-enfoque .flash .pista { font-size: calc(20px * var(--fz)); }
.rep-enfoque .flash .rv { font-size: calc(20px * var(--fz)); }
.rep-enfoque .rp-pron { font-size: calc(20px * var(--fz)); }
.rep-enfoque .rp-img img { max-height: 340px; }
.rep-enfoque .rp-prod .prod-es { font-size: calc(32px * var(--fz)); }
@media (max-width: 640px) { .rep-enfoque .flash { padding: 20px 16px; min-height: 0; } .rep-enfoque .flash .fr { font-size: calc(24px * var(--fz)); } .rp-img img { max-height: 200px; } }
.rp-cks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
@media (max-width: 640px) { .rp-cks { grid-template-columns: 1fr; } }
.rp-fa li > div { min-width: 0; }

/* ---------- v3.3.0: temas de conversación ---------- */
.tm-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.tm-head h3 { margin: 0 0 4px; }
.tm-head > div { flex: 1 1 320px; }
.tm-prog { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.tm-prog .bar, .tm-bar { flex: 1; height: 6px; border-radius: 4px; background: var(--surface2); overflow: hidden; display: block; }
.tm-prog .bar i, .tm-bar i { display: block; height: 100%; background: var(--ok); }
.tm-cada { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 13px; }
.tm-cada select { padding: 4px 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.tm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 10px; }
.tm-it { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--text); box-shadow: var(--shadow); }
.tm-it:hover { border-color: var(--accent); }
.tm-it.off { opacity: .45; box-shadow: none; cursor: default; }
.tm-it.sig { border-color: var(--accent); background: var(--accent-soft); }
.tm-it.hecho .tm-n { background: var(--ok); color: #fff; }
.tm-n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--surface2); display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--muted); }
.tm-ico { font-size: 24px; flex: none; }
.tm-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tm-tx b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-tx small { color: var(--muted); font-size: 12px; }
.tm-tx .tm-bar { flex: none; height: 4px; margin-top: 4px; }
.chip.tm-sig { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.tm-hoy-t { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.tm-hoy-t small { display: block; }

.tm-ses { max-width: 760px; margin: 0 auto; }
.tm-top { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; }
.tm-top h2 { flex: 1; margin: 0; font-size: 20px; }
.tm-top h2 small { font-size: 13px; font-weight: 400; }
.tm-top .tg { width: 34px; height: 34px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; cursor: pointer; opacity: .45; }
.tm-top .tg.on { opacity: 1; background: var(--accent-soft); border-color: var(--accent); }
.tm-pasos { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 12px; }
.tm-pasos button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; font-size: 12px; }
.tm-pasos button span { font-size: 18px; }
.tm-pasos button em { font-style: normal; }
.tm-pasos button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--text); font-weight: 600; }
.tm-pasos button.ok { color: var(--ok); }
@media (max-width: 520px) { .tm-pasos button em { display: none; } .tm-top h2 small { display: block; } }
.tm-card .lugar { justify-content: space-between; }
.tm-paso { font-weight: 600; }
.tm-cont { color: var(--muted); font-size: 13px; }
.tm-tip { margin: 4px 0 8px; }
.tm-img img { display: block; width: 100%; max-height: 220px; object-fit: cover; border-radius: 14px; margin: 6px 0 10px; cursor: zoom-in; }
.tm-fr { font-size: calc(26px * var(--fz)); font-weight: 700; line-height: 1.3; margin-top: 8px; }
.tm-fr .tm-h { color: var(--accent); }
.tm-es { margin-top: 8px; color: var(--muted); font-style: italic; font-size: calc(17px * var(--fz)); }
.tm-rep { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.tm-rep i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--accent); }
.tm-rep i.on { background: var(--accent); }
.tm-ancla { padding: 10px 12px; border-radius: 10px; background: var(--surface2); margin-top: 6px; }
.tm-ancla div { font-weight: 600; margin: 2px 0; }
.tm-ancla small { display: block; }
.tm-acc { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: auto; padding-top: 18px; }
.tm-acc .btn-primary { min-width: 160px; }
.tm-recorrido { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 6px; }
.tm-recorrido li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface2); }
.tm-recorrido li.mal { box-shadow: inset 3px 0 0 var(--warn); }
.tm-recorrido li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tm-recorrido small { color: var(--muted); }
.tm-col { flex: none; width: 26px; height: 26px; border-radius: 6px; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.tm-fin { text-align: center; padding: 16px 0; }
.tm-ok { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 8px; display: grid; place-items: center; font-size: 28px; background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.tm-h2 { margin: 0 0 4px; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.tm-pasos button em { font-size: 12px; line-height: 1.2; }
.tm-pasos button span { line-height: 1; }

/* =====================================================================
   v3.4.0 · Agenda: pantalla completa en tres columnas, sin desplazamiento
   ===================================================================== */
:root { --t-trabajo: #4f7fa8; --t-evento: #8a63c7; --c-idi: #e8710a; --c-lib: #8d6e63; --c-dia: #607d8b; --ag-pie: #1A2744; --ag-pie-h: #3FA6A6; }
:root[data-theme="dark"] { --t-trabajo: #8fb6d8; --t-evento: #b99be6; --c-idi: #ffa04d; --c-lib: #c4a59a; --c-dia: #a7bcc7; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --t-trabajo: #8fb6d8; --t-evento: #b99be6; --c-idi: #ffa04d; --c-lib: #c4a59a; --c-dia: #a7bcc7; } }
.t-tarea { --tc: var(--accent); } .t-recordatorio { --tc: var(--warn); } .t-trabajo { --tc: var(--t-trabajo); } .t-evento { --tc: var(--t-evento); } .t-item { --tc: var(--ok); }
.lim { --tc: var(--danger); }
.c-rep { --cc: var(--c-n); } .c-idi { --cc: var(--c-idi); } .c-lib { --cc: var(--c-lib); } .c-dia { --cc: var(--c-dia); } .c-cla { --cc: var(--danger); }

/* barra superior: botón Agenda */
.pill-agenda.has { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); } .pill-agenda.has b { color: var(--accent); }
.pill-agenda.mal { background: color-mix(in srgb, var(--danger) 14%, var(--surface2)); border-color: var(--danger); color: var(--danger); } .pill-agenda.mal b { color: var(--danger); }
body.ag-on .toasts { bottom: 66px; right: auto; left: 50%; transform: translateX(-50%); align-items: center; }
input[type=time] { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; outline: none; }
input[type=time]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label.f > input[type=time] { display: block; margin-top: 4px; font-weight: 400; color: var(--text); }
@media (hover: none), (pointer: coarse) { input[type=time] { font-size: max(16px, calc(14px * var(--fz))); } }
body.ag-on .idi-bar { bottom: 70px; }

.ag { display: flex; flex-direction: column; height: 100%; position: relative; background: var(--bg); overflow: hidden; }
.ag button { -webkit-user-select: none; user-select: none; }
.ag-top { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 12px; min-height: 56px; background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 45; }
.ag-nav { display: flex; align-items: center; gap: 4px; flex: none; min-width: 0; }
.ag-nav .icon-btn { font-size: 22px; font-weight: 700; }
.ag-nav h2 { font-size: calc(19px * var(--fz)); font-weight: 800; letter-spacing: -.3px; margin-left: 6px; white-space: nowrap; }
.ag-nav h2 small { font-size: 12px; color: var(--muted); font-weight: 700; margin-left: 6px; letter-spacing: 0; }
.ag-vistas { display: flex; gap: 2px; background: var(--surface2); padding: 3px; border-radius: 10px; flex: none; }
.ag-vistas button { border: 0; background: transparent; padding: 6px 11px; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; }
.ag-vistas button:hover { color: var(--text); }
.ag-vistas button.on { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
.ag-add { flex: 1 1 auto; min-width: 150px; position: relative; display: flex; align-items: center; gap: 2px; background: var(--surface2); border: 1px solid var(--line); border-radius: 11px; padding: 0 4px 0 10px; }
.ag-add:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.ag-add-i { color: var(--accent); font-weight: 900; font-size: 17px; }
.ag-add input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 9px 6px; min-width: 0; }
.ag-mic { flex: none; width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; font-size: 17px; }
.ag-mic:hover { background: var(--surface2); }
.ag-mic.on { background: var(--danger); animation: vzp 1.4s infinite; }
.ag-mic.wait { opacity: .5; animation: tin .6s infinite alternate; }
.ag-prev { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 90; display: none; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.ag-prev.on { display: flex; }
.ag-prev b { font-size: 14px; margin-right: 4px; }
.ag-prev span { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.ag-prev small { width: 100%; color: var(--muted); font-size: 11px; }
.ag-add.solo { flex: none; margin-bottom: 10px; }
.ag-add.solo .ag-prev { position: static; display: flex; border: 0; box-shadow: none; padding: 8px 2px 4px; background: transparent; }
.ag-add.solo { flex-wrap: wrap; }
.ag-herr { display: flex; gap: 2px; flex: none; }
.ag-only-n, .ag-only-md { display: none !important; }
.ag.m-estrecho .ag-only-n { display: inline-grid !important; }
.ag.m-medio .ag-only-md, .ag.m-estrecho .ag-only-md { display: inline-grid !important; }

.ag-body { flex: 1 1 auto; min-height: 0; display: flex; position: relative; }
.ag-izq, .ag-der { flex: none; display: flex; flex-direction: column; min-height: 0; background: var(--side); }
.ag-izq { width: 276px; border-right: 1px solid var(--line); }
.ag-der { width: 348px; border-left: 1px solid var(--line); }
.ag-main { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--surface); }
.ag-velo { display: none; position: absolute; inset: 0; background: rgba(15, 18, 24, .3); z-index: 35; }
.ag.velo .ag-velo { display: block; }
.ag.m-medio .ag-der, .ag.m-estrecho .ag-der, .ag.m-estrecho .ag-izq { display: none; position: absolute; top: 0; bottom: 0; z-index: 40; box-shadow: var(--shadow); }
.ag.m-medio.der-on .ag-der, .ag.m-estrecho.der-on .ag-der { display: flex; right: 0; width: min(380px, 100%); }
.ag.m-estrecho.izq-on .ag-izq { display: flex; left: 0; width: min(310px, 100%); }

/* acordeón: la sección abierta ocupa el alto libre de su columna */
.ag-accs { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.ag-acc { flex: none; display: flex; flex-direction: column; min-height: 0; border-top: 1px solid var(--line); }
.ag-acc.open { flex: 1 1 0; }
.ag-acc-h { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; padding: 10px 12px; font: inherit; font-size: 13px; font-weight: 800; color: var(--text); cursor: pointer; text-align: left; flex: none; }
.ag-acc-h:hover { background: var(--side-h); }
.ag-acc-h b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 800; }
.ag-acc-h .ai { width: 20px; text-align: center; }
.ag-acc-h em { font-style: normal; font-size: 11px; font-weight: 800; background: var(--accent-soft); color: var(--accent); padding: 1px 8px; border-radius: 99px; white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.ag-acc-h em.warn { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.ag-acc-h i { font-style: normal; color: var(--muted); transition: transform .15s; }
.ag-acc:not(.open) .ag-acc-h i { transform: rotate(-90deg); }
.ag-acc-b { display: none; }
.ag-acc.open .ag-acc-b { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; padding: 0 10px 10px; gap: 8px; }
.ag-box { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.ag-pl { display: flex; flex-direction: column; gap: 4px; min-height: 0; }
.ag-pg { flex: none; display: flex; align-items: center; justify-content: center; gap: 14px; padding-top: 6px; margin-top: auto; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ag-pg button { min-width: 42px; height: 30px; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 8px; font-size: 18px; line-height: 1; cursor: pointer; }
.ag-pg button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.ag-pg button:disabled { opacity: .35; cursor: default; }
.ag-vacio { margin: auto; text-align: center; color: var(--muted); padding: 16px 10px; font-size: 13px; }
.ag-vacio .big { font-size: 30px; display: block; margin-bottom: 4px; }
.ag-tip { font-size: 11.5px; color: var(--muted); margin: 2px 0 4px; line-height: 1.4; }
.ag-tip code, .ag-aj code { font-size: 11px; background: var(--surface2); padding: 1px 5px; border-radius: 4px; word-break: break-all; }
.ag-acc-pie { display: flex; gap: 6px; align-items: center; flex: none; flex-wrap: wrap; }
.ag-acc-pie .sp { flex: 1; }
.ag-seg { display: flex; gap: 3px; background: var(--surface2); padding: 3px; border-radius: 10px; flex: none; align-items: center; }
.ag-seg > button { flex: 1; border: 0; background: transparent; padding: 6px 9px; border-radius: 8px; font: inherit; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap; }
.ag-seg > button.on { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.ag-seg > button.warn b { color: var(--danger); }
.ag-seg > b { padding: 0 8px; }

/* filas (bandeja, día, listas): alto fijo para paginar sin desplazamiento */
.ag-fila { display: flex; align-items: center; gap: 8px; height: 46px; flex: none; padding: 0 9px; min-width: 0; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--tc, var(--line)); color: var(--text); cursor: pointer; text-decoration: none; touch-action: manipulation; }
.ag-fila[data-drag] { touch-action: none; }
.ag-fila:hover { border-color: var(--tc, var(--accent)); }
.ag-fila.sel { box-shadow: 0 0 0 2px var(--accent); }
.ag-fila.nc { background: var(--nc); }
.ag-fila .t { flex: 1; min-width: 0; }
.ag-fila .t b { display: block; font-size: calc(13px * var(--fz)); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-fila .t b .ic { font-size: 11px; opacity: .8; }
.ag-fila .t > span { display: block; font-size: calc(11.5px * var(--fz)); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-fila.hecho .t b { text-decoration: line-through; color: var(--muted); }
.ag-fila.hecho { opacity: .75; }
.ag-fila.venc .t > span { color: var(--danger); font-weight: 600; }
.ag-fila.virt { border-style: dashed; border-left-style: solid; opacity: .8; }
.ag-fila.lim { background: color-mix(in srgb, var(--danger) 7%, var(--surface)); }
.ag-fila input.ag-sel { width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.ag-ck { flex: none; width: 21px; height: 21px; border: 2px solid var(--tc, var(--muted)); border-radius: 6px; background: transparent; cursor: pointer; padding: 0; display: grid; place-items: center; color: #fff; font: inherit; }
.ag-ck:hover { background: color-mix(in srgb, var(--tc, var(--accent)) 18%, transparent); }
.ag-ck.on { background: var(--tc, var(--accent)); }
.ag-ck.on::after { content: "✓"; font-size: 13px; font-weight: 900; line-height: 1; }
.ag-ck-x { flex: none; width: 21px; text-align: center; font-size: 14px; }
.ag-pr { flex: none; width: 8px; height: 8px; border-radius: 50%; }
.ag-pr.p1 { background: #3da5f4; } .ag-pr.p2 { background: var(--warn); } .ag-pr.p3 { background: var(--danger); }

/* chip compacto (mes, todo el día) */
.ag-ev { display: flex; align-items: center; gap: 4px; height: 20px; flex: none; padding: 0 5px; min-width: 0; border-radius: 5px; font-size: calc(11.5px * var(--fz)); line-height: 20px; background: color-mix(in srgb, var(--tc) 15%, var(--surface)); border-left: 3px solid var(--tc); color: var(--text); cursor: pointer; white-space: nowrap; overflow: hidden; touch-action: none; }
.ag-ev:hover { background: color-mix(in srgb, var(--tc) 26%, var(--surface)); }
.ag-ev b { font-weight: 800; font-size: 10.5px; color: var(--tc); flex: none; }
.ag-ev .ic { font-size: 10px; flex: none; }
.ag-ev .tx { overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.ag-ev .rp { font-size: 9px; opacity: .7; flex: none; }
.ag-ev.nc { background: var(--nc); }
.ag-ev.hecho { opacity: .5; } .ag-ev.hecho .tx { text-decoration: line-through; }
.ag-ev.virt { background: transparent; outline: 1px dashed color-mix(in srgb, var(--tc) 60%, transparent); outline-offset: -1px; opacity: .8; }
.ag-ev.venc .tx { color: var(--danger); font-weight: 700; }
.ag-ev.lim { background: color-mix(in srgb, var(--danger) 14%, var(--surface)); font-weight: 700; }
.ag-ev.p3 .tx { font-weight: 800; }
.ag-ev.sel, .ag-blq.sel { box-shadow: 0 0 0 2px var(--accent); }
.ag-mas { border: 0; background: transparent; color: var(--accent); font: inherit; font-size: 11px; font-weight: 800; text-align: left; padding: 0 4px; height: 18px; flex: none; cursor: pointer; }
.ag-mas:hover { text-decoration: underline; }
.cp { font-size: 9.5px; font-weight: 800; padding: 0 4px; border-radius: 99px; line-height: 15px; background: color-mix(in srgb, var(--cc) 16%, transparent); color: var(--cc); white-space: nowrap; }
.cp.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }

/* columna izquierda */
.ag-mini { flex: none; padding: 10px 10px 8px; }
.ag-mini-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.ag-mini-h b { font-size: 13px; text-transform: capitalize; }
.ag-mini-h button { border: 0; background: transparent; width: 30px; height: 26px; border-radius: 7px; cursor: pointer; font-size: 17px; color: var(--text); }
.ag-mini-h button:hover { background: var(--side-h); }
.ag-mini-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.ag-mini-g i { font-style: normal; font-size: 10px; font-weight: 800; color: var(--muted); text-align: center; padding-bottom: 2px; }
.ag-md { position: relative; border: 0; background: transparent; font: inherit; font-size: 12px; height: 27px; border-radius: 7px; cursor: pointer; color: var(--text); font-variant-numeric: tabular-nums; }
.ag-md:hover { background: var(--side-h); }
.ag-md.fin { color: var(--muted); }
.ag-md.fuera { opacity: .45; }
.ag-md.fest { color: var(--danger); font-weight: 800; }
.ag-md.rg { background: var(--accent-soft); border-radius: 0; }
.ag-md.hoy { box-shadow: inset 0 0 0 2px var(--accent); font-weight: 800; }
.ag-md.sel { background: var(--accent); color: var(--accent-text); border-radius: 7px; }
.ag-md u { position: absolute; bottom: 3px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
.ag-md.sel u { background: var(--accent-text); }
.ag-izq-acc { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.ag-capas { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 6px; }
.ag-capa { display: flex; align-items: center; gap: 6px; padding: 4px 4px; border-radius: 7px; font-size: 12px; cursor: pointer; min-width: 0; white-space: nowrap; overflow: hidden; }
.ag-capa:hover { background: var(--side-h); }
.ag-capa input { accent-color: var(--accent); width: 15px; height: 15px; flex: none; }
.ag-capa .ic { width: 16px; text-align: center; flex: none; }
.ag-plz label.f { margin-bottom: 8px; }
.ag-plz-r { min-height: 64px; }
.ag-plz-f { background: var(--surface); border-radius: 10px; padding: 9px 11px; border-left: 4px solid var(--accent); }
.ag-plz-f small { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 800; }
.ag-plz-f b { display: block; font-size: 15px; text-transform: capitalize; }
.ag-plz-f span { font-size: 12px; color: var(--muted); }
.ag-plz-s { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.ag-plz .btn { width: 100%; justify-content: center; margin-top: 8px; }

/* vista mes */
.ag-mes { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.ag-mes-h, .ag-mes-f { display: grid; grid-template-columns: 26px repeat(7, minmax(0, 1fr)); }
.ag-mes-h { flex: none; border-bottom: 1px solid var(--line); }
.ag-mes-h b { padding: 7px 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-mes-h b.fin { opacity: .7; }
.ag-mes-f { flex: 1 1 0; min-height: 0; border-bottom: 1px solid var(--line); }
.ag-mes-f:last-child { border-bottom: 0; }
.ag-sn { font-style: normal; font-size: 10px; font-weight: 700; color: var(--muted); text-align: center; padding-top: 8px; cursor: pointer; background: var(--surface2); }
.ag-sn:hover { color: var(--accent); }
.ag-cel { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 2px; padding: 3px 4px 4px; border-left: 1px solid var(--line); cursor: pointer; position: relative; }
.ag-cel:hover { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.ag-cel.fin { background: color-mix(in srgb, var(--surface2) 50%, transparent); }
.ag-cel.fest { background: color-mix(in srgb, var(--danger) 6%, transparent); }
.ag-cel.fuera > * { opacity: .5; }
.ag-cel.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.ag-cel-h { display: flex; align-items: center; gap: 4px; height: 22px; flex: none; min-width: 0; }
.ag-cel-h .n { font-weight: 800; font-size: 12.5px; min-width: 22px; height: 22px; padding: 0 3px; display: grid; place-items: center; border-radius: 99px; flex: none; font-variant-numeric: tabular-nums; }
.ag-cel-h .n:hover { background: var(--surface2); }
.ag-cel.hoy .n { background: var(--accent); color: var(--accent-text); }
.ag-cel-h .fe { font-size: 10px; color: var(--danger); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.ag-cel-h .cps { margin-left: auto; display: flex; gap: 2px; flex: none; overflow: hidden; }
.ag-cel-b { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }

/* vista semana / día */
.ag-tg { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.ag-tg-h, .ag-tg-ad, .ag-tg-g { display: grid; }
.ag-tg-h { flex: none; border-bottom: 1px solid var(--line); }
.ag-tgd { padding: 6px 7px 5px; border-left: 1px solid var(--line); display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; cursor: pointer; min-width: 0; }
.ag-tgd:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.ag-tgd .d { font-size: 11px; text-transform: uppercase; font-weight: 800; color: var(--muted); }
.ag-tgd b { font-size: 19px; font-weight: 800; line-height: 1.1; }
.ag-tgd.hoy b { color: var(--accent); }
.ag-tgd.sel { box-shadow: inset 0 -3px 0 var(--accent); }
.ag-tgd.fin .d, .ag-tgd.fin b { opacity: .7; }
.ag-tgd .fe { font-size: 10px; color: var(--danger); font-weight: 700; flex-basis: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-tgd .cps { display: flex; gap: 2px; flex-basis: 100%; overflow: hidden; min-height: 15px; }
.ag-tg-ad { flex: none; height: 72px; border-bottom: 2px solid var(--line); }
.ag-tg-ad > i { font-style: normal; font-size: 9.5px; color: var(--muted); text-align: right; padding: 5px 6px 0 0; line-height: 1.15; }
.ag-adc { border-left: 1px solid var(--line); padding: 3px; display: flex; flex-direction: column; gap: 2px; overflow: hidden; min-width: 0; }
.ag-tg-g { flex: 1 1 auto; min-height: 0; position: relative; }
.ag-hrs { position: relative; }
.ag-hrs span { position: absolute; right: 6px; top: calc(var(--i) * var(--hh, 40px) + 1px); font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1; }
.ag-col { position: relative; min-width: 0; overflow: hidden; border-left: 1px solid var(--line); cursor: copy;
    background-image: repeating-linear-gradient(to bottom, var(--line) 0, var(--line) 1px, transparent 1px, transparent var(--hh, 40px)); }
.ag-col.fin { background-color: color-mix(in srgb, var(--surface2) 45%, transparent); }
.ag-col.fest { background-color: color-mix(in srgb, var(--danger) 5%, transparent); }
.ag-col.hoy { background-color: color-mix(in srgb, var(--accent) 5%, transparent); }
.ag-blq { position: absolute; z-index: 2; display: flex; flex-direction: column; padding: 3px 6px; border-radius: 7px; overflow: hidden; font-size: calc(11.5px * var(--fz)); line-height: 1.25; background: color-mix(in srgb, var(--tc) 20%, var(--surface)); border-left: 3px solid var(--tc); color: var(--text); cursor: pointer; touch-action: none; box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
.ag-blq:hover { z-index: 4; box-shadow: var(--shadow); }
.ag-blq.nc { background: var(--nc); }
.ag-blq b { font-size: 10.5px; font-weight: 800; color: var(--tc); white-space: nowrap; }
.ag-blq .tx { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-blq .sb { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-blq.corto { flex-direction: row; gap: 5px; align-items: center; padding-top: 0; padding-bottom: 0; }
.ag-blq.hecho { opacity: .5; } .ag-blq.hecho .tx { text-decoration: line-through; }
.ag-blq.virt { background: color-mix(in srgb, var(--tc) 8%, var(--surface)); outline: 1px dashed var(--tc); outline-offset: -1px; }
.ag-blq.venc .tx { color: var(--danger); }
.ag-blq.fuera { opacity: .8; }
.ag-blq .ag-ck.mini { position: absolute; right: 4px; top: 4px; width: 17px; height: 17px; border-radius: 5px; background: var(--surface); }
.ag-blq .ag-ck.mini.on { background: var(--tc); }
.ag-blq:has(.ag-ck.mini) { padding-right: 24px; }
.ag-rs { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; cursor: ns-resize; touch-action: none; }
.ag-rs::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 22px; margin-left: -11px; height: 3px; border-radius: 3px; background: var(--tc); opacity: 0; }
.ag-blq:hover .ag-rs::after { opacity: .6; }
.ag-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 5; pointer-events: none; }
.ag-now::before { content: ""; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.ag-capa-b { position: absolute; left: 0; right: 0; z-index: 1; pointer-events: none; padding: 2px 6px; font-size: 10px; font-weight: 800; overflow: hidden; }
.ag-capa-b.c-idi { color: var(--c-idi); border-left: 3px solid color-mix(in srgb, var(--c-idi) 55%, transparent); background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c-idi) 12%, transparent) 0 6px, transparent 6px 12px); }
.ag-tg.uno .ag-blq { font-size: calc(13px * var(--fz)); }
.ag-tg.uno .ag-blq b { font-size: 12px; }

/* vista año */
.ag-ano { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 8px 14px 12px; }
.ag-ano-h { display: flex; align-items: center; gap: 14px; flex: none; margin-bottom: 10px; flex-wrap: wrap; }
.ag-ano-h .ag-seg { flex: none; }
.ag-ano-t { font-size: 13px; font-weight: 700; color: var(--muted); }
.ag-ley { margin-left: auto; display: flex; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); }
.ag-ley i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.ag-ano-g { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 10px 16px; }
.ag-am { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.ag-am > b { font-size: 13px; text-transform: capitalize; cursor: pointer; margin-bottom: 3px; flex: none; }
.ag-am > b:hover { color: var(--accent); }
.ag-am-g { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: auto repeat(6, minmax(0, 1fr)); gap: 2px; }
.ag-am-g i { font-style: normal; font-size: 9px; font-weight: 800; color: var(--muted); text-align: center; }
.ag-am-g button, .ag-am-g .v { border: 0; border-radius: 4px; font: inherit; font-size: 9.5px; color: var(--muted); cursor: pointer; padding: 0; min-height: 0; min-width: 0; font-variant-numeric: tabular-nums; }
.ag-am-g .v { background: transparent; cursor: default; }
.l0 { background: var(--surface2); }
.l1 { background: color-mix(in srgb, var(--accent) 22%, var(--surface2)); color: var(--text) !important; }
.l2 { background: color-mix(in srgb, var(--accent) 45%, var(--surface2)); color: var(--text) !important; }
.l3 { background: color-mix(in srgb, var(--accent) 70%, var(--surface2)); color: var(--accent-text) !important; }
.l4 { background: var(--accent); color: var(--accent-text) !important; }
.lf { box-shadow: inset 0 0 0 2px var(--danger); }
.ag-am-g button.fest { box-shadow: inset 0 0 0 1.5px var(--danger); }
.ag-am-g button.hoy { outline: 2px solid var(--text); outline-offset: -1px; }
.ag-am-g button:hover { outline: 2px solid var(--accent); }

/* vista lista */
.ag-lst { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 10px 16px 12px; max-width: 920px; width: 100%; margin: 0 auto; }
.ag-lst .ag-pl { gap: 4px; }
.ag-lst .ag-fila, .ag-lst-d, .ag-lst-v { height: 42px; }
.ag-lst-d { display: flex; align-items: center; gap: 10px; flex: none; padding: 0 6px; border-bottom: 2px solid var(--line); cursor: pointer; }
.ag-lst-d b { font-size: 15px; }
.ag-lst-d span { color: var(--muted); font-size: 12px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-lst-d em { display: flex; gap: 3px; font-style: normal; }
.ag-lst-d.hoy b { color: var(--accent); }
.ag-lst-d.fest span { color: var(--danger); }
.ag-lst-v { display: flex; align-items: center; flex: none; padding: 0 14px; color: var(--muted); font-size: 12px; cursor: pointer; }
.ag-lst .ag-fila { margin-left: 18px; }

/* tablero de trabajos */
.ag-kb { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 10px 12px 12px; }
.ag-kcol { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--surface2); border-radius: 12px; padding: 8px; border-top: 4px solid var(--kc); }
.k-pendiente { --kc: var(--muted); } .k-curso { --kc: var(--accent); } .k-espera { --kc: var(--warn); } .k-hecho { --kc: var(--ok); }
.ag-kcol-h { display: flex; align-items: center; gap: 6px; flex: none; padding: 2px 4px 8px; }
.ag-kcol-h b { flex: 1; font-size: 13px; } .ag-kcol-h small { font-weight: 500; color: var(--muted); }
.ag-kcol-h em { font-style: normal; font-size: 11px; font-weight: 800; background: var(--surface); padding: 1px 8px; border-radius: 99px; }
.ag-kcol-b { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.ag-kcol-b .ag-pl { gap: 6px; }
.ag-card { height: 94px; flex: none; display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--kc); border-radius: 10px; cursor: grab; touch-action: none; overflow: hidden; }
.ag-card:hover { box-shadow: var(--shadow); }
.ag-card.sel { box-shadow: 0 0 0 2px var(--accent); }
.ag-card.nc { background: var(--nc); }
.ag-card > b { font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-card .cl { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-card .ft { display: flex; gap: 8px; font-size: 11.5px; font-weight: 700; color: var(--muted); margin-top: auto; white-space: nowrap; overflow: hidden; }
.ag-card .lm.ojo { color: var(--warn); } .ag-card .lm.mal { color: var(--danger); }
.ag-card .bar { flex: none; height: 4px; }
.ag-card.p3 > b::before { content: "● "; color: var(--danger); }

/* columna derecha: día */
.ag-dia-h { display: flex; align-items: center; gap: 10px; padding: 12px; flex: none; background: var(--surface); border-bottom: 1px solid var(--line); }
.ag-dia-n { font-size: 34px; font-weight: 900; line-height: 1; color: var(--text); min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }
.ag-dia-h.hoy .ag-dia-n { color: var(--accent); }
.ag-dia-h.fest .ag-dia-n { color: var(--danger); }
.ag-dia-t { flex: 1; min-width: 0; }
.ag-dia-t b { display: block; font-size: 16px; }
.ag-dia-t span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-dia-t .fe { color: var(--danger); font-weight: 700; }
.ag-cds { display: flex; flex-wrap: wrap; gap: 5px; padding: 8px 12px 6px; flex: none; }
.ag-cd { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: color-mix(in srgb, var(--cc) 14%, var(--surface)); color: var(--cc); text-decoration: none; white-space: nowrap; }
.ag-cd b { font-weight: 800; }
.ag-cd.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, var(--surface)); }
.ag-cd:hover { filter: brightness(.95); }
.ag-der-acc { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.ag-nota .ag-ck-x { font-size: 15px; }

/* editor */
.ag-ed { display: flex; flex-direction: column; flex: 1; min-height: 0; background: var(--surface); border-top: 4px solid var(--tc); }
.ag-ed-h { display: flex; align-items: center; gap: 6px; padding: 8px 8px 0 10px; flex: none; }
.ag-ed-tipos { display: flex; gap: 3px; flex: 1; background: var(--surface2); padding: 3px; border-radius: 10px; }
.ag-ed-tipos button { flex: 1; border: 0; background: transparent; border-radius: 8px; padding: 5px 2px; font: inherit; font-size: 15px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; }
.ag-ed-tipos button em { font-size: 10px; font-style: normal; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ag-ed-tipos button.on { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
.ag-ed-tipos button.on em { color: var(--tc); }
.ag-ed-t { padding: 8px 12px 4px; flex: none; }
.ag-ed-t input { font-size: calc(18px * var(--fz)) !important; font-weight: 800; border: 0 !important; border-bottom: 2px solid var(--line) !important; border-radius: 0 !important; padding: 6px 2px !important; background: transparent !important; box-shadow: none !important; }
.ag-ed-t input:focus { border-bottom-color: var(--tc) !important; }
.ag-ed.hecho .ag-ed-t input { text-decoration: line-through; color: var(--muted); }
.ag-ed-av { margin: 2px 12px 4px; padding: 6px 10px; border-radius: 8px; background: var(--accent-soft); font-size: 12px; flex: none; }
.ag-ed-av a { cursor: pointer; font-weight: 700; }
.ag-ed-acc { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.ag-ed-f { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.ag-ed-f label.f { margin-bottom: 8px; }
.ag-ed-f .row { gap: 8px; }
.ag-ed-pie { display: flex; gap: 6px; align-items: center; padding: 10px 12px; padding-bottom: max(10px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); flex: none; background: var(--surface); }
.ag-ed-pie .sp { flex: 1; }
.ag-ed-pie .btn.on { border-color: #FD7E14; color: #FD7E14; }
/* v4.0 · Eliminar bien visible: rojo, con texto */
.ag-ed-pie .btn.ag-del { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 700; }
.ag-ed-pie .btn.ag-del:hover { background: color-mix(in srgb, var(--danger) 85%, #000); border-color: color-mix(in srgb, var(--danger) 85%, #000); color: #fff; }
.ag-qd { display: flex; gap: 4px; flex-wrap: wrap; margin: 2px 0 8px; }
.ag-qd button { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 3px 10px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--text); }
.ag-qd button:hover { border-color: var(--accent); color: var(--accent); }
.ag-sw { position: relative; display: inline-block; width: 44px; height: 24px; margin-top: 6px; }
.ag-sw input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.ag-sw i { position: absolute; inset: 0; border-radius: 99px; background: var(--surface2); border: 1px solid var(--line); transition: .15s; }
.ag-sw i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: .15s; }
.ag-sw input:checked + i { background: var(--accent); border-color: var(--accent); }
.ag-sw input:checked + i::after { left: 22px; }
.ag-sw input:disabled + i { opacity: .5; }
.ag-prs { display: flex; gap: 4px; margin-top: 4px; }
.ag-prs button { width: 34px; height: 32px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; cursor: pointer; font-size: 14px; }
.ag-prs .p0 { color: var(--muted); } .ag-prs .p1 { color: #3da5f4; } .ag-prs .p2 { color: var(--warn); } .ag-prs .p3 { color: var(--danger); }
.ag-prs button.on { border-color: currentColor; box-shadow: inset 0 0 0 1px currentColor; background: var(--surface2); }
.ag-ed-pz { background: var(--surface2); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 6px; }
.ag-ed-pz > b { font-size: 12px; }
.ag-ed-pz .row { gap: 6px; }
.ag-ed-pz .row > input[type=number] { flex: .5; }
.ag-ed-pz .ag-tip { margin: 0; }
.ag-cols-c { display: flex; flex-wrap: wrap; gap: 6px; }
.ag-cols-c .nc-sw { width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 2px solid var(--line); background: var(--nc, var(--surface)); cursor: pointer; display: grid; place-items: center; }
.ag-cols-c .nc-sw.nc-0::after { content: "⊘"; color: var(--muted); font-size: 13px; line-height: 1; }
.ag-cols-c .nc-sw.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.ag-rd { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.ag-rd label { display: flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; padding: 4px 8px; border: 1px solid var(--line); border-radius: 99px; cursor: pointer; }
.ag-rd input { accent-color: var(--accent); }
.ag-ed-notas textarea { flex: none; height: 74px; min-height: 0; resize: none; font-size: 13px; }
.ag-ed-nota { display: flex; align-items: center; gap: 6px; margin: 8px 0; flex: none; }
.ag-ed-nota input { flex: 1; }
.ag-subs { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 4px; }
.ag-subs > b { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.ag-subs .ag-pl { gap: 2px; }
.ag-sub { display: flex; align-items: center; gap: 7px; height: 30px; flex: none; padding: 0 4px; border-radius: 7px; cursor: pointer; --tc: var(--accent); }
.ag-sub:hover { background: var(--surface2); }
.ag-sub .tx { flex: 1; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-sub .fd { font-size: 11px; color: var(--muted); white-space: nowrap; }
.ag-sub.hecho .tx { text-decoration: line-through; color: var(--muted); }
.ag-sub .ag-ck { width: 18px; height: 18px; }
#ed-sub { flex: none; }

/* pie de página: información de la agenda */
.ag-pie { flex: none; display: flex; align-items: center; gap: 5px; min-height: 52px; padding: 7px 12px; padding-bottom: max(7px, env(safe-area-inset-bottom)); background: var(--ag-pie); color: #fff; overflow: hidden; white-space: nowrap; position: relative; z-index: 46; }
.ag-pie .pi { display: inline-flex; align-items: center; gap: 5px; flex: none; max-width: 360px; min-width: 0; padding: 7px 11px; border: 0; border-radius: 9px; background: rgba(255, 255, 255, .09); color: #fff; font: inherit; font-size: 13.5px; font-weight: 600; text-decoration: none; cursor: pointer; }
.ag-pie .pi b { font-weight: 800; }
.ag-pie .pi em { font-style: normal; font-size: 12px; opacity: .8; }
.ag-pie .pi .tx { overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 200px; }
.ag-pie .pi:hover { background: var(--ag-pie-h); }
.ag-pie span.pi { background: transparent; cursor: default; padding-left: 4px; padding-right: 6px; }
.ag-pie span.pi:hover { background: transparent; }
.ag-pie .pi.mal { background: #c0392b; }
.ag-pie .pi.ok { color: #7be0b0; }
.ag-pie .pi.prox { flex: 0 1 auto; }
.ag-pie .pi.crono { background: #d9650a; flex: 0 1 auto; }
.ag-pie .pi-reloj b { text-transform: capitalize; }
.ag-pie .sp { flex: 1; }
.ag-pie .pi-mas { width: 38px; justify-content: center; font-size: 15px; }
.ag-pie-panel { position: absolute; left: 12px; right: 12px; bottom: 60px; z-index: 60; display: grid; grid-template-columns: 1.4fr 1.2fr .8fr 1fr; gap: 16px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); animation: tin .15s ease; }
.ag-pie-panel[hidden] { display: none; }
.ag-pp { min-width: 0; }
.ag-pp summary { font-weight: 800; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); cursor: pointer; margin-bottom: 8px; }
.ag-pp small { display: block; color: var(--muted); font-size: 11px; margin-top: 6px; text-align: center; }
.ag-sbs { display: flex; gap: 6px; height: 110px; align-items: stretch; }
.ag-sb { flex: 1; position: relative; border: 0; padding: 0; background: var(--surface2); border-radius: 7px; cursor: pointer; overflow: hidden; }
.ag-sb i { position: absolute; left: 0; right: 0; bottom: 0; background: color-mix(in srgb, var(--accent) 28%, transparent); }
.ag-sb u { position: absolute; left: 32%; right: 32%; bottom: 0; background: var(--accent); border-radius: 3px 3px 0 0; }
.ag-sb span { position: absolute; left: 0; right: 0; bottom: 3px; font-size: 10px; font-weight: 800; color: var(--text); }
.ag-sb b { position: absolute; left: 0; right: 0; top: 4px; font-size: 11px; }
.ag-sb.hoy { box-shadow: inset 0 0 0 2px var(--accent); }
.ag-pl-l { display: flex; gap: 8px; align-items: center; padding: 4px 6px; border-radius: 7px; cursor: pointer; font-size: 12.5px; }
.ag-pl-l:hover { background: var(--surface2); }
.ag-pl-l b { min-width: 38px; text-align: right; font-variant-numeric: tabular-nums; }
.ag-pl-l span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-pl-l.ojo b { color: var(--danger); }
.ag-ring { --p: 0; width: 86px; height: 86px; border-radius: 50%; margin: 4px auto 0; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface2) 0); }
.ag-ring b { width: 64px; height: 64px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 16px; }
.ag-pp-e { display: flex; flex-direction: column; gap: 6px; }
.ag-pp-e a { padding: 8px 10px; border-radius: 9px; background: var(--surface2); font-size: 13px; color: var(--text); }

/* arrastrar */
[data-drag] { touch-action: none; }
.ag-ghost { position: fixed !important; z-index: 400; pointer-events: none; opacity: .92; box-shadow: var(--shadow); margin: 0 !important; }
.ag-arr { opacity: .35; }
.ag-drop { outline: 2px dashed var(--accent) !important; outline-offset: -2px; background-color: color-mix(in srgb, var(--accent) 12%, transparent) !important; }
.ag-drop-lbl { position: fixed; left: 0; top: 0; z-index: 401; display: none; pointer-events: none; padding: 3px 9px; border-radius: 7px; background: var(--text); color: var(--bg); font-size: 12px; font-weight: 800; }
body.ag-dragging, body.ag-dragging * { cursor: grabbing !important; -webkit-user-select: none !important; user-select: none !important; }

/* avisos y deshacer */
.toast.ag-toast { display: flex; align-items: center; gap: 10px; }
.toast.ag-toast button { flex: none; border: 0; background: rgba(255, 255, 255, .2); color: inherit; font: inherit; font-weight: 800; padding: 4px 10px; border-radius: 7px; cursor: pointer; }
.toast.ag-aviso { background: var(--ag-pie); color: #fff; max-width: 400px; border-left: 4px solid var(--ag-pie-h); }
.toast.ag-aviso .x { padding: 4px 7px; background: transparent; }

/* modales de la agenda (sin desplazamiento: contenido paginado) */
.modal-body.ag-mb { display: flex; flex-direction: column; overflow: hidden; padding: 12px 16px; }
.ag-mb > .ag-accs { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ag-mb .ag-acc:first-child { border-top: 0; }
.ag-ay { overflow: hidden; font-size: 13.5px; line-height: 1.55; }
.ag-ay ul { margin: 6px 0; padding-left: 20px; }
.ag-ay p { margin: 6px 0; }
.ag-rev { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 0; }
.ag-rev-acc { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: none; }
.ag-rev-acc .n { font-size: 12px; color: var(--muted); font-weight: 700; margin-right: auto; }
.ag-rev-all { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; cursor: pointer; }
.ag-rev .ag-fila.chk { cursor: default; }
.ag-pt { display: grid; grid-template-columns: 250px 1fr; gap: 14px; flex: 1; min-height: 0; }
.ag-pt-l, .ag-pt-r { display: flex; flex-direction: column; min-height: 0; gap: 8px; }
.ag-pt-i { display: block; width: 100%; height: 52px; flex: none; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 6px 10px; cursor: pointer; font: inherit; color: var(--text); }
.ag-pt-i.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.ag-pt-i b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-pt-i span { font-size: 11.5px; color: var(--muted); }
.ag-pt-h { display: flex; align-items: center; gap: 8px; flex: none; }
.ag-pt-h h3 { flex: 1; font-size: 16px; }
.ag-pt-r label.f { margin-bottom: 6px; }
.ag-paso { display: flex; align-items: center; gap: 8px; height: 32px; flex: none; padding: 0 8px; border-radius: 8px; background: var(--surface2); font-size: 13px; }
.ag-paso b { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-paso .d { font-size: 11px; color: var(--muted); white-space: nowrap; }
.ag-paso em { font-style: normal; font-size: 11px; font-weight: 800; color: var(--accent); }
.ag-pe { display: grid; grid-template-columns: 1fr 64px 104px 56px 92px 34px; gap: 4px; align-items: center; height: 40px; flex: none; }
.ag-pe input, .ag-pe select { padding: 6px 7px; }
.ag-aj { display: flex; flex-direction: column; gap: 6px; min-height: 0; flex: 1; overflow: hidden; }
.ag-aj label.f { margin-bottom: 4px; }
.ag-aj-push { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; background: var(--surface2); border-left: 4px solid var(--muted); }
.ag-aj-push.ok { border-left-color: var(--ok); }
.ag-aj-push b { margin-right: auto; }
.ag-aj-fe .ag-pt-h .ag-seg { flex: none; }
.ag-fe { display: flex; align-items: center; gap: 10px; height: 34px; flex: none; padding: 0 4px 0 10px; border-radius: 8px; background: var(--surface2); font-size: 13px; }
.ag-fe b { width: 92px; flex: none; }
.ag-fe span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-fe em { font-style: normal; font-size: 11px; color: var(--muted); text-transform: capitalize; }
.ag-fe.est span::after { content: " · estimado"; color: var(--warn); font-size: 11px; }
.ag-fe .icon-btn { width: 28px; height: 28px; font-size: 13px; }
.ag-fe-add { flex: none; gap: 6px; }
.ag-fe-add > * { flex: 1; }
.ag-fe-add > input[type=text] { flex: 2; }
.ag-nm { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 0; }
.ag-nm-t { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 4px; }
.ag-nm-b { display: flex; gap: 8px; align-items: center; flex: none; }
.ag-nm-b .ag-seg { flex: 1; }
.ag-add input { flex: 1 1 0; width: auto; }
.ag-add.solo .ag-prev { flex-basis: 100%; }
.ag-blq.estr { padding: 2px 3px; }
.ag-blq.estr b { font-size: 9.5px; }

/* Inicio: tarjeta de la agenda */
.ag-ini-l { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ag-ini-l .ag-fila { height: 42px; }
.ag-ini-res { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.ag-ini-res span { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--surface2); }
.ag-ini-res .mal { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }

/* elementos de lista con fecha (editor de notas) */
.ck-f { flex: none; align-self: flex-start; margin-top: calc((1.6em - 22px) / 2 + 2px); height: 22px; border: 1px solid transparent; background: transparent; color: var(--muted); border-radius: 99px; padding: 0 7px; font: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer; white-space: nowrap; opacity: 0; }
.ck-it:hover .ck-f, .ck-it:focus-within .ck-f { opacity: .8; }
.ck-f.on { opacity: 1; background: var(--accent-soft); color: var(--accent); }
.ck-f.hoy { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.ck-f.venc { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.ck-it.hecho .ck-f.on { opacity: .6; background: transparent; }
.ck-f:hover { border-color: var(--accent); opacity: 1; }
.ckf-pop { position: fixed; z-index: 160; width: 270px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 10px; }
.ckf-pop .ag-qd { margin-top: 0; }
.ckf-pop .row { gap: 6px; margin-bottom: 8px; flex-direction: row !important; }
.ckf-pop .pie { display: flex; gap: 6px; justify-content: flex-end; }
@media (hover: none), (pointer: coarse) { .ck-f { opacity: .7; } }

/* responsive */
@media (max-width: 1440px) { .ag-vistas button { padding: 6px 9px; } }
@media (max-width: 1280px) { .ag-izq { width: 260px; } .ag-pie .p4 { display: none; } }
@media (max-width: 1100px) { .ag-pie .p3 { display: none; } .ag-herr .icon-btn { width: 34px; } .ag-pie-panel { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) {
    .ag-top { flex-wrap: wrap; row-gap: 6px; padding: 6px 8px; }
    .ag-nav { flex: 1 1 auto; order: 1; } .ag-herr { order: 2; } .ag-vistas { order: 3; } .ag-add { order: 4; flex: 1 1 240px; }
    .ag-kb { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); }
    .ag-ano-g { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(0, 1fr)); }
    .ag-pt { grid-template-columns: 1fr; grid-template-rows: auto 1fr; } .ag-pt-l { max-height: 150px; }
    .ag-pe { grid-template-columns: 1fr 54px 92px 50px 34px; } .ag-pe input[type=time] { display: none; }
}
@media (max-width: 640px) {
    .ag-vistas { flex: 1 1 100%; } .ag-vistas button { flex: 1; padding: 6px 2px; font-size: 12px; } .ag-add { flex-basis: 100%; }
    .ag-nav h2 { font-size: 16px; } .ag-nav h2 small { display: none; }
    .ag-pie .p2 { display: none; } .ag-pie .pi { padding: 6px 8px; font-size: 12.5px; }
    .ag-mes-h, .ag-mes-f { grid-template-columns: 0 repeat(7, minmax(0, 1fr)); } .ag-sn { visibility: hidden; }
    .ag-mes-h b { padding: 6px 2px; text-align: center; font-size: 10px; }
    .ag-cel-h .fe, .ag-cel-h .cps { display: none; }
    .ag-ev { font-size: 10px; padding: 0 2px; } .ag-ev b, .ag-ev .ic { display: none; }
    .ag-kb { grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px; }
    .ag-pie-panel { grid-template-columns: 1fr; bottom: 58px; }
    .ag-pie-panel .ag-pp:nth-child(n+3) { display: none; }
    .ag-ano-g { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(6, minmax(0, 1fr)); gap: 6px; }
}
.tab-n { display: none; position: absolute; top: 3px; left: 50%; margin-left: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--accent); color: var(--accent-text); font-size: 10px; font-style: normal; font-weight: 800; line-height: 16px; text-align: center; }
.tab-n.mal { background: var(--danger); color: #fff; }
.tab-n:empty { display: none !important; }
.tabs a[data-tab="agenda"] { position: relative; }
@media (max-width: 520px) { #btnAgenda { display: none; } .tab-n { display: block; } }
@media print { .ag-pie, .ag-izq, .ag-der, .ag-top .ag-add, .ag-herr { display: none !important; } }

/* ---------- v3.4.1: días señalados (cumpleaños, aniversarios…) ---------- */
:root { --t-senal: #d6336c; }
:root[data-theme="dark"] { --t-senal: #f783ac; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --t-senal: #f783ac; } }
.t-senal { --tc: var(--t-senal); }
.ag-ev.t-senal { font-weight: 700; }
.ag-fila.t-senal { cursor: pointer; }
.ag-pie .pi.senal.hoy { background: #b8255f; }
.ag-pp-sub { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 10px 0 4px; }
.ag-sn-add { display: grid; grid-template-columns: 150px 1fr 150px 110px 190px auto; gap: 6px; }
.ag-sn span { cursor: pointer; text-align: left; } .ag-sn span:hover { color: var(--accent); } .ag-sn em { text-transform: none; }
.ag-ini-sen { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: color-mix(in srgb, var(--t-senal) 14%, transparent); color: var(--t-senal); }
.ag-ini-sen.hoy { background: var(--t-senal); color: #fff; }
@media (max-width: 900px) { .ag-sn-add { grid-template-columns: 1fr 1fr; } }

/* ======================================================================
   v3.5 · Notas con el formato del Planteamiento
   hojas · barra con texto · bloques · Marcar como… · glosario · índice · Por estudiar
   ====================================================================== */
:root { --np-navy: #1A2744; --np-verde: #1d7a46; --np-amar: #f5c518; --np-nar: #c4580a; }
/* --- columna izquierda: Índice / Notas / Ambos --- */
.n-izq { overflow: hidden; }
.np-seg { display: flex; gap: 4px; padding: 8px 8px 6px; flex: none; }
.np-seg button { flex: 1; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 7px; padding: 6px 4px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.np-seg button.on { background: var(--np-navy); border-color: var(--np-navy); color: #fff; }
.np-indice { overflow: auto; padding: 0 8px 8px; min-height: 0; flex: none; }
.np-notas { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.notas.vi-notas .np-indice, .notas.vi-indice .np-notas { display: none; }
.notas.vi-indice .np-indice { flex: 1; }
.notas.vi-ambos .np-indice { max-height: 50%; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.np-sec { margin: 0 0 6px; border-radius: 6px; overflow: hidden; background: var(--surface); box-shadow: 0 1px 2px rgba(20, 28, 45, .1); }
.np-sec-h { width: 100%; display: flex; align-items: center; gap: 8px; border: 0; background: var(--np-navy); color: #fff; padding: 9px 11px; font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; text-align: left; }
.np-sec-h i { font-style: normal; font-size: 10px; transition: transform .15s; }
.np-sec.abierta .np-sec-h i { transform: rotate(90deg); }
.np-sec-h span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-sec-h b { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.np-sec-est .np-sec-h { background: var(--np-nar); }
.np-sec-b { display: none; padding: 4px 4px 6px; max-height: 360px; overflow: auto; }
.np-sec.abierta .np-sec-b { display: block; }
.np-it { display: flex; gap: 6px; align-items: baseline; padding: 5px 7px; border-radius: 5px; color: var(--text); font-size: 13px; cursor: pointer; text-decoration: none; word-break: break-word; }
.np-it:hover { background: var(--surface2); }
.np-it .np-hj { font-weight: 700; } .np-it .np-hj.on { color: var(--accent); }
.np-it .np-t1, .np-it .np-t2 { padding-left: 14px; font-weight: 600; } .np-it .np-t3 { padding-left: 26px; } .np-it .np-t4 { padding-left: 38px; color: var(--muted); }
.np-est { display: flex; align-items: flex-start; gap: 2px; border-left: 3px solid #e65100; margin: 3px 0; background: color-mix(in srgb, #e65100 7%, var(--surface)); border-radius: 4px; }
.np-est.aqui { border-left-color: #00838f; }
.np-est .np-it { flex: 1; flex-direction: column; gap: 1px; min-width: 0; }
.np-est .np-it b { font-size: 12px; color: var(--muted); } .np-est .np-it span { font-size: 13px; }
.np-est-t { flex: none; border: 0; background: transparent; cursor: pointer; font-size: 15px; padding: 5px; border-radius: 5px; }
.np-est-t:hover { background: var(--surface2); }
.np-vacio { color: var(--muted); font-size: 12.5px; padding: 6px 8px; line-height: 1.45; }
.np-sw { display: inline-block; width: 11px; height: 11px; border-radius: 3px; background: var(--bq-c, #999); flex: none; vertical-align: -1px; }
/* --- cabecera de la nota: iconos más grandes --- */
.np-ed .np-cab { flex-wrap: wrap; row-gap: 6px; padding: 10px 14px 8px; }
.np-ed .np-cab .ed-titulo { min-width: 200px; }
.np-acc { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; margin-left: auto; }
.np-acc .np-ico { min-width: 42px; height: 42px; font-size: 21px; border-radius: 9px; padding: 0 4px; font-weight: 400; }
.np-acc .np-ico:hover { background: var(--surface2); }
.np-acc .np-ico.on { background: var(--accent-soft); }
.np-sep { width: 1px; height: 26px; background: var(--line); margin: 0 5px; }
/* --- pestañas de hojas --- */
.np-hojas { display: flex; align-items: flex-end; gap: 10px; padding: 6px 14px 0; background: var(--surface2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.np-tabs { display: flex; gap: 4px; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: thin; }
.np-tab { flex: none; border: 1px solid var(--line); border-bottom: 0; background: color-mix(in srgb, var(--line) 55%, var(--surface2)); color: var(--text); padding: 8px 15px; border-radius: 5px 5px 0 0; font: inherit; font-size: 13.5px; cursor: pointer; white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.np-tab:hover { background: var(--surface); }
.np-tab.on { background: var(--surface); font-weight: 700; box-shadow: inset 0 3px 0 var(--np-verde); }
.np-tab-mas { border-style: dashed; background: transparent; color: var(--muted); }
.np-tabs-acc { display: flex; gap: 4px; padding-bottom: 5px; flex: none; }
.np-tabs-acc button { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 4px; padding: 4px 10px; font: inherit; font-size: 12.5px; cursor: pointer; }
.np-tabs-acc button:disabled { opacity: .45; cursor: default; }
.np-rojo { color: var(--danger) !important; border-color: color-mix(in srgb, var(--danger) 45%, var(--line)) !important; }
.n-ed.es-lista .np-hojas { display: none; }
/* --- barra de formato --- */
.np-barra { gap: 6px; padding: 8px 14px; align-items: center; }
.np-grupo { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.np-barra .np-b { height: 34px; min-width: 34px; padding: 0 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 4px; font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; font-size: 13.5px; }
.np-barra .np-b:not(.np-amar):not(.np-amar2):not(.np-gris):not(.np-verde):hover { border-color: var(--accent); background: var(--surface); }
.np-barra .np-amar2:hover { background: #ffe680; }
.np-barra .np-b.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.np-barra .np-b svg { display: block; }
.np-pct { font-size: 12.5px; color: var(--muted); min-width: 46px; text-align: center; font-variant-numeric: tabular-nums; }
.np-barra .np-amar { background: var(--np-amar); border-color: #d9a900; color: #1A2744; font-weight: 700; }
.np-barra .np-amar:hover { background: #ffd43b; border-color: #b88f00; }
.np-barra .np-amar2 { background: #fff4c2; border-color: #e6c84d; color: #5a4500; font-weight: 600; }
.np-barra .np-amar2.on { background: #ffe680; border-color: #c9a400; color: #3b2d00; }
.np-barra .np-gris { background: #8494a0; border-color: #73838f; color: #fff; font-weight: 700; }
.np-barra .np-gris:hover { background: #73838f; }
.np-barra .np-verde { background: var(--np-verde); border-color: #176238; color: #fff; font-weight: 700; }
.np-barra .np-verde:hover { background: #176238; }
/* --- buscar y reemplazar --- */
.np-buscar { display: flex; gap: 6px; align-items: center; padding: 6px 14px; background: color-mix(in srgb, #ffd600 16%, var(--surface)); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.np-buscar[hidden] { display: none; }
.np-buscar input { width: auto; flex: 1 1 170px; padding: 5px 8px; font-size: 13px; }
.np-buscar button { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 4px; padding: 4px 10px; cursor: pointer; font: inherit; font-size: 13px; }
.np-bn { font-size: 12.5px; color: var(--muted); min-width: 54px; text-align: center; font-variant-numeric: tabular-nums; }
::highlight(np-bus) { background-color: #ffe08a; color: #1f2a30; }
::highlight(np-bus-act) { background-color: #ff9800; color: #000; }
/* --- mesa: hoja de papel + glosario --- */
.np-mesa { flex: 1; display: flex; min-height: 0; background: var(--bg); }
.np-ed .np-mesa .ed-scroll { flex: 1; min-width: 0; background: transparent; padding: 22px 26px 40px; }
.np-ed .np-papel { max-width: 920px; margin: 0 auto; background: var(--surface); box-shadow: var(--shadow); border-radius: 3px; padding: 38px 58px 70px; min-height: calc(100% - 6px); box-sizing: border-box; }
.n-ed.nc .np-mesa { background: color-mix(in srgb, var(--nc) 40%, var(--bg)); }
.n-ed.nc .np-papel { background: var(--nc); }
.np-ed .ed-texto { font-size: calc(var(--np-fs, 16px) * var(--fz)); line-height: 1.65; }
.np-ed .ed-texto h1 { font-size: 1.6em; font-weight: 800; } .np-ed .ed-texto h2 { font-size: 1.38em; font-weight: 800; } .np-ed .ed-texto h3 { font-size: 1.15em; font-weight: 700; }
.np-ed .ed-texto h1:first-child, .np-ed .ed-texto h2:first-child { margin-top: 0; }
.ed-texto .al-c { text-align: center; } .ed-texto .al-r { text-align: right; } .ed-texto .al-j { text-align: justify; hyphens: auto; }
.ed-texto a.doc-l { display: inline-flex; gap: 4px; align-items: center; background: var(--surface2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 8px; text-decoration: none !important; font-size: .92em; color: var(--accent); }
/* --- bloques de color --- */
.bq-nota { --bq-c: #c99a00; } .bq-ojo { --bq-c: #c62828; } .bq-estudiar { --bq-c: #00838f; } .bq-advertencia { --bq-c: #e65100; } .bq-consejo { --bq-c: #1d7a46; } .bq-ejemplo { --bq-c: #3f51b5; }
.ed-texto .bq { position: relative; margin: 1em 0; padding: 25px 16px 6px; border-radius: 6px; border-left: 5px solid var(--bq-c); background: color-mix(in srgb, var(--bq-c) 11%, var(--surface)); }
.ed-texto .bq-nota { background: color-mix(in srgb, #ffd600 24%, var(--surface)); }
.ed-texto .bq::before { content: attr(data-b); position: absolute; top: 5px; left: 16px; font-size: 10.5px; font-weight: 800; letter-spacing: 1.3px; text-transform: uppercase; color: var(--bq-c); pointer-events: none; user-select: none; -webkit-user-select: none; }
.ed-texto .bq > :last-child { margin-bottom: .5em; }
/* --- marcas («Marcar como…») y glosario en el texto --- */
.m-tarea { --mk-c: #3e6079; } .m-tarjeta, .m-palacio { --mk-c: #7b3fa0; } .m-etiqueta { --mk-c: #2a7889; } .m-ref { --mk-c: #00838f; } .m-margen { --mk-c: #c68300; }
.ed-texto span.m { border-bottom: 2px solid var(--mk-c, var(--np-verde)); background: color-mix(in srgb, var(--mk-c, var(--np-verde)) 12%, transparent); border-radius: 2px; padding: 0 1px; cursor: pointer; }
.ed-texto span.m-res { background: #fff176; border-bottom: 0; color: #1f2a30; }
.ed-texto span.g { background: #fff4b8; border-bottom: 1px dotted #c9a400; cursor: help; border-radius: 2px; }
.ed-texto span.g.g-x { background: none; border: 0; cursor: auto; }
.ed-texto span.m span.g { border-bottom: 0; }
.np-flash { animation: npFlash 1.6s ease; }
@keyframes npFlash { 0%, 45% { box-shadow: 0 0 0 4px color-mix(in srgb, #ff9800 55%, transparent); background-color: color-mix(in srgb, #ff9800 16%, transparent); } 100% { box-shadow: 0 0 0 0 transparent; } }
/* --- menús Bloque / Marcar como… y ventanita de una marca --- */
.np-menu { position: fixed; z-index: 160; min-width: 240px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 5px; }
.np-menu button { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: transparent; color: var(--text); padding: 8px 10px; border-radius: 6px; font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.np-menu button:hover:not(:disabled) { background: var(--surface2); }
.np-menu button:disabled { opacity: .45; cursor: default; }
.np-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }
.np-menu .np-sw { width: 14px; height: 14px; }
.np-mi { width: 22px; text-align: center; font-size: 16px; }
.np-popm { position: fixed; z-index: 160; max-width: 340px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 9px 11px; font-size: 13px; }
.np-popm .x { color: var(--muted); margin-top: 4px; white-space: pre-wrap; word-break: break-word; max-height: 160px; overflow: auto; }
.np-popm .a { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.np-popm .a button { border: 1px solid var(--line); background: var(--surface2); color: var(--text); border-radius: 5px; padding: 4px 8px; font: inherit; font-size: 12.5px; cursor: pointer; }
/* --- glosario (recuadro amarillo, ampliable a columna) --- */
.np-glos { display: none; flex: none; width: 250px; background: #fffbe0; border-left: 2px solid var(--np-amar); flex-direction: column; min-height: 0; color: #2f2600; }
.n-ed.glos-on .np-glos { display: flex; }
.n-ed.glos-ancho .np-glos { width: 420px; }
.n-ed.es-lista .np-glos { display: none; }
.np-glos-h { display: flex; align-items: center; gap: 7px; padding: 8px 10px; background: var(--np-amar); color: #1A2744; font-weight: 800; }
.np-glos-h b { background: #1A2744; color: #fff; border-radius: 4px; padding: 0 6px; font-size: 12px; }
.np-glos-h .sp { flex: 1; }
.np-glos-h button { border: 1px solid rgba(0, 0, 0, .25); background: rgba(255, 255, 255, .4); border-radius: 4px; width: 30px; height: 28px; cursor: pointer; color: #1A2744; font-size: 14px; }
.np-glos-t { display: flex; gap: 6px; align-items: center; padding: 8px 10px 4px; flex-wrap: wrap; }
.np-glos-t .btn { background: #fff; color: #1A2744; border-color: #e0c65a; }
.np-seg2 { display: flex; border: 1px solid #e0c65a; border-radius: 6px; overflow: hidden; margin-left: auto; }
.np-seg2 button { border: 0; background: #fff; padding: 4px 8px; font: inherit; font-size: 12px; cursor: pointer; color: #5a4500; }
.np-seg2 button.on { background: var(--np-amar); font-weight: 700; color: #1A2744; }
.np-glos #g-q { margin: 4px 10px; width: auto; font-size: 13px; padding: 5px 8px; background: #fff; color: #2f2600; }
.np-glos-l { flex: 1; overflow: auto; padding: 4px 8px 12px; }
.np-gi { padding: 6px 8px; border-radius: 5px; cursor: pointer; }
.np-gi:hover { background: rgba(245, 197, 24, .25); }
.np-gi b { display: block; font-size: 13.5px; }
.np-gi span { display: block; font-size: 12.5px; color: #6b5a1a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-gi .gi-otra { color: #b39b3a; font-style: normal; }
.n-ed.glos-ancho .np-gi span { white-space: normal; }
.np-gi.abierta { background: #fff; border: 1px solid #e6c84d; cursor: default; margin: 4px 0; }
.np-gi.abierta input, .np-gi.abierta textarea { width: 100%; font-size: 13px; margin-bottom: 6px; background: #fff; color: #2f2600; }
.np-gi.abierta .gi-p { font-weight: 700; }
.gi-a { display: flex; flex-wrap: wrap; gap: 4px; }
.gi-a button { border: 1px solid #e0c65a; background: #fffbe0; border-radius: 4px; padding: 3px 7px; font: inherit; font-size: 12px; cursor: pointer; color: #3b3000; }
.gi-e { color: #8a7a3a; font-size: 11px; }
.np-glos-vacio { font-size: 12.5px; color: #6b5a1a; padding: 6px 4px; line-height: 1.5; }
/* --- pie: leyenda --- */
.ed-estado .np-ley { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px !important; font-weight: 600; opacity: .9; white-space: nowrap; }
.np-ley i { display: inline-block; width: 11px; height: 11px; border-radius: 2px; margin-left: 7px; }
.np-ley i:first-child { margin-left: 0; }
.ly-m { background: #2e9d5a; } .ly-g { background: var(--np-amar); } .ly-r { background: #fff176; } .ly-e { background: #00acc1; }
/* --- Inicio: Por estudiar --- */
.np-ini-est h3 { color: var(--np-nar); }
.np-ini-est { border-top: 4px solid var(--np-nar); }
/* --- tema oscuro --- */
:root[data-theme="dark"] .np-glos { background: color-mix(in srgb, #f5c518 10%, var(--surface)); color: var(--text); }
:root[data-theme="dark"] .np-gi span, :root[data-theme="dark"] .np-glos-vacio { color: var(--muted); }
:root[data-theme="dark"] .np-gi.abierta, :root[data-theme="dark"] .np-gi.abierta input, :root[data-theme="dark"] .np-gi.abierta textarea, :root[data-theme="dark"] .np-glos #g-q, :root[data-theme="dark"] .np-seg2 button { background: var(--surface); color: var(--text); }
:root[data-theme="dark"] .ed-texto .bq::before { color: color-mix(in srgb, var(--bq-c) 55%, #fff); }
:root[data-theme="dark"] .ed-texto span.g { background: color-mix(in srgb, #ffd600 28%, transparent); }
:root[data-theme="dark"] .ed-texto span.m-res { background: color-mix(in srgb, #fff176 45%, transparent); color: inherit; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .np-glos { background: color-mix(in srgb, #f5c518 10%, var(--surface)); color: var(--text); }
    :root:not([data-theme="light"]) .np-gi span, :root:not([data-theme="light"]) .np-glos-vacio { color: var(--muted); }
    :root:not([data-theme="light"]) .np-gi.abierta, :root:not([data-theme="light"]) .np-gi.abierta input, :root:not([data-theme="light"]) .np-gi.abierta textarea, :root:not([data-theme="light"]) .np-glos #g-q, :root:not([data-theme="light"]) .np-seg2 button { background: var(--surface); color: var(--text); }
    :root:not([data-theme="light"]) .ed-texto .bq::before { color: color-mix(in srgb, var(--bq-c) 55%, #fff); }
    :root:not([data-theme="light"]) .ed-texto span.g { background: color-mix(in srgb, #ffd600 28%, transparent); }
    :root:not([data-theme="light"]) .ed-texto span.m-res { background: color-mix(in srgb, #fff176 45%, transparent); color: inherit; }
}
/* --- adaptable --- */
@media (max-width: 1280px) { .np-ed .np-papel { padding: 32px 40px 60px; } .np-glos { width: 230px; } .n-ed.glos-ancho .np-glos { width: 340px; } }
@media (max-width: 1100px) { .ed-estado .np-ley { display: none; } }
@media (max-width: 900px) {
    .np-acc [data-c="izq"], .np-acc [data-c="der"], .np-sep-pan { display: none; }
    .np-mesa { flex-direction: column; }
    .np-glos, .n-ed.glos-ancho .np-glos { width: auto; max-height: 42%; border-left: 0; border-top: 2px solid var(--np-amar); }
    .np-ed .np-mesa .ed-scroll { padding: 12px; }
    .np-ed .np-papel { padding: 22px 22px 50px; }
}
@media (max-width: 520px) {
    .np-ed .np-cab .ed-titulo { min-width: 0; }
    .np-acc { margin-left: 0; width: 100%; order: 3; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .np-acc::-webkit-scrollbar { display: none; }
    .np-acc .np-ico { min-width: 40px; height: 40px; flex: none; }
    .np-hojas { flex-wrap: wrap; padding: 6px 8px 0; gap: 4px; }
    .np-tabs-acc { width: 100%; padding-bottom: 4px; order: -1; }
    .np-grupo { flex-wrap: nowrap; }
    .np-ed .np-mesa .ed-scroll { padding: 0; }
    .np-ed .np-papel { box-shadow: none; border-radius: 0; padding: 14px 14px 40px; }
}
@media (hover: none), (pointer: coarse) { .np-barra .np-b { height: 40px; min-width: 40px; } .np-tab { padding: 10px 15px; } }
@media print {
    .np-hojas, .np-barra, .np-buscar, .np-glos, .np-acc, .np-ley, .np-seg, .np-indice { display: none !important; }
    .np-mesa { display: block !important; background: #fff !important; }
    .np-ed .np-papel { box-shadow: none; padding: 0; max-width: none; }
    .ed-texto .bq { break-inside: avoid; }
}
/* v3.5 · la barra se compacta según el ancho del editor */
.np-ed { container-type: inline-size; container-name: ned; }
.np-l { margin-left: 5px; }
.ed-estado > span { white-space: nowrap; }
@container ned (max-width: 1080px) {
    .np-barra .np-l { display: none; }
    .ed-estado .np-ley { display: none; }
    .np-barra .np-b { padding: 0 8px; }
}
@container ned (max-width: 760px) {
    .np-tabs-acc button { padding: 4px 7px; }
}

/* ---------- 🕷 Extracción (Apify) · v3.6 ---------- */
.apf { max-width: 1400px; }
.apf .page-head { margin-bottom: 10px; align-items: center; }
.apf-h-sub { font-size: 13px; font-weight: 500; }
.apf-resumen { display: flex; gap: 6px; flex-wrap: wrap; }
.apf-resumen a.chip { text-decoration: none; }
.apf-tab-n { color: var(--accent); }
.apf-aviso { margin-bottom: 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; border-color: var(--warn); background: color-mix(in srgb, var(--warn) 9%, var(--surface)); }
.apf-perfiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 14px; }
.apf-pc { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; transition: .12s; }
.apf-pc:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.apf-pc.on { border-color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); background: var(--accent-soft); }
.apf-pc .ico { font-size: 24px; } .apf-pc b { font-size: 15px; } .apf-pc span { color: var(--muted); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; } .apf-pc small { color: var(--accent); font-size: 11.5px; margin-top: 4px; }
.apf-form h3 { text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--text); }
.apf-form h3 .small { font-weight: 500; }
.apf-campos { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 16px; align-items: start; }
.apf-campos label.f:has(textarea) { grid-column: 1 / -1; }
.apf-ayuda { display: block; margin-top: 3px; font-size: 11.5px; font-weight: 400; color: var(--muted); }
.apf-req { color: var(--danger); }
.apf-ck { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; margin: 6px 0 12px; cursor: pointer; }
.apf-ck input { width: 17px; height: 17px; accent-color: var(--accent); flex: none; margin-top: 1px; }
.apf-presets { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.apf-presets .chip { border: 1px dashed var(--accent); background: transparent; cursor: pointer; font: inherit; font-size: 12px; }
.apf-presets .chip.on { background: var(--accent); color: var(--accent-text); border-style: solid; }
.apf-final { border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 4px; }
.apf-max { flex: 0 0 190px !important; }
.apf-acc { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.apf-repite { background: var(--accent-soft); color: var(--accent); border-radius: 8px; padding: 8px 12px; margin: 0 0 12px; font-size: 13px; }
.apf-mono { font-family: var(--mono); font-size: 12.5px; }
.apf-def { min-height: 52vh; white-space: pre; tab-size: 2; }
.apf-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.apf-bar select { width: auto; max-width: 280px; }
.apf-bar .sp { flex: 1; }
.apf-bar-d input[type=search] { flex: 1; min-width: 200px; width: auto; }
.apf-flags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.apf-flags .chip { border: 1px solid transparent; cursor: pointer; font: inherit; font-size: 12.5px; background: var(--surface2); color: var(--muted); }
.apf-flags .chip b { color: var(--text); }
.apf-flags .chip.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); } .apf-flags .chip.on b { color: var(--accent); }
.apf-filtros { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.apf-filtros select { width: auto; max-width: 300px; padding: 5px 8px; font-size: 13px; }
.apf-selbar { position: sticky; top: 0; z-index: 5; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 8px 10px; margin-bottom: 8px; border-radius: 10px; background: var(--accent); color: var(--accent-text); box-shadow: var(--shadow); }
.apf-selbar b { margin-right: 6px; }
.apf-selbar .btn { background: var(--surface); }
.apf-tw { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.apf-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.apf-tbl th { position: sticky; top: 0; background: var(--surface2); text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 8px 10px; white-space: nowrap; border-bottom: 1px solid var(--line); z-index: 1; }
.apf-tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.apf-tbl tbody tr:last-child td { border-bottom: 0; }
.apf-tbl .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.apf-tbl td small { display: block; margin-top: 2px; font-size: 11.5px; }
.apf-sort { cursor: pointer; user-select: none; } .apf-sort:hover, .apf-sort.on { color: var(--accent); }
.apf-datos tbody tr { cursor: pointer; } .apf-datos tbody tr:hover td { background: var(--surface2); }
.apf-datos tr.aus td { opacity: .6; }
.apf-datos td { max-width: 260px; overflow-wrap: anywhere; }
.apf-nom { min-width: 220px; } .apf-nom b { font-weight: 600; }
.apf-ext { font-weight: 700; padding: 0 3px; }
.apf-badges { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.apf-b { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--surface2); color: var(--muted); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.apf-b-nuevo { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.apf-b-cambio { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.apf-b-aus { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.apf-tag { font-size: 10.5px; color: var(--accent); background: var(--accent-soft); padding: 1px 7px; border-radius: 99px; white-space: nowrap; }
.apf-ck-c { width: 34px; text-align: center !important; }
.apf-ck-c input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.apf-fav { border: 0; background: none; font-size: 17px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0; } .apf-fav.on { color: var(--warn); }
.apf-star { color: var(--warn); }
.apf-lnk { white-space: nowrap; }
.apf-img { width: 64px; height: 44px; object-fit: cover; border-radius: 5px; cursor: zoom-in; display: block; }
.apf-vis { white-space: nowrap; color: var(--muted); font-size: 12px; }
.apf-pag { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 12px; color: var(--muted); }
.apf-est { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.apf-est-ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.apf-est-err { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.apf-est-warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.apf-est-off { background: var(--surface2); color: var(--muted); }
.apf-est-run { background: var(--accent-soft); color: var(--accent); animation: apfLat 1.6s ease-in-out infinite; }
@keyframes apfLat { 50% { opacity: .55; } }
.apf-acc-r { white-space: nowrap; text-align: right; } .apf-acc-r .btn { margin-left: 4px; }
.apf-menu { display: grid; gap: 6px; } .apf-menu .btn { justify-content: flex-start; }
.apf-json { background: var(--surface2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-family: var(--mono); font-size: 12px; max-height: 50vh; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 0; }
.apf-ficha .sec-t { margin-top: 16px; }
.apf-fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 16px; }
.apf-fd span { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.apf-fd div { overflow-wrap: anywhere; }
.apf-fd .apf-img { width: 160px; height: 110px; }
.apf-fmeta { margin-top: 12px; font-size: 12px; color: var(--muted); }
.apf-cmb { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--text); font-size: 13px; }
.apf-cmb.aus { background: color-mix(in srgb, var(--danger) 11%, transparent); }
.apf-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.apf-tag-in { width: 200px !important; padding: 4px 8px !important; font-size: 12.5px; }
.apf-hist td:first-child { white-space: nowrap; }
.apf-hist tr.cmb td { background: color-mix(in srgb, var(--warn) 8%, transparent); }
.apf-raw { margin-top: 14px; } .apf-raw summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.apf-aj { grid-template-columns: 1fr 1fr; }
.apf-aj .apf-wide { grid-column: 1 / -1; }
.apf-aj .card h3 { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--text); }
.apf-aj p { margin: 0 0 10px; }
.apf-aj code { font-size: 12px; background: var(--surface2); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.apf-cuenta { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--surface2); font-size: 13px; line-height: 1.7; }
.apf-err { color: var(--danger); margin-top: 10px; }
.apf-ayuda-def summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 13px; }
.apf-ayuda-def ul { margin: 8px 0 0; padding-left: 18px; line-height: 1.6; }
@media (max-width: 900px) {
    .apf-aj { grid-template-columns: 1fr; }
    .apf-final { flex-direction: column; gap: 0; } .apf-max { flex: 1 1 auto !important; }
}
@media (max-width: 700px) {
    .apf.page { padding: 16px 10px 50px; }
    .apf-bar select, .apf-filtros select { max-width: 100%; flex: 1 1 100%; }
    .apf-runs td:nth-child(3), .apf-runs th:nth-child(3), .apf-runs td:nth-child(4), .apf-runs th:nth-child(4) { display: none; }
}
.apf .sub-tabs { overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.apf .sub-tabs::-webkit-scrollbar { display: none; }
.apf .sub-tabs a { flex: none; }

/* ===================== v3.6.1 — Menú lateral izquierdo colapsable + columna de acciones del editor ===================== */
.side-cab, .side-fila { display: contents; }
.side-tg, .side-l { display: none; }
/* v3.7.0 · Ancho del menú en --side-w: --side es el color de los paneles (en el tema oscuro lo pisaba y descolocaba la vista) */
@media (min-width: 721px) {
    :root { --side-w: 212px; --top: 0px; }
    html.side-col { --side-w: 64px; }
    #top.top { inset: 0 auto 0 0; width: var(--side-w); height: auto; flex-direction: column; align-items: stretch; gap: 6px; padding: calc(10px + env(safe-area-inset-top, 0px)) 8px 10px !important; border-bottom: 0; border-right: 1px solid var(--line); transition: width .18s; box-sizing: border-box; }
    #view.view { inset: 0 0 0 var(--side-w); transition: left .18s; }
    #top .side-cab { display: flex; align-items: center; gap: 6px; padding: 0 2px 8px; border-bottom: 1px solid var(--line); }
    #top .brand { flex: 1; min-width: 0; gap: 10px; font-size: 20px; overflow: hidden; white-space: nowrap; }
    #top .brand-logo { width: 36px; height: 36px; }
    #top .brand-txt { display: inline !important; }
    #top .side-tg { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface2); color: var(--muted); font: 700 15px/1 var(--font); cursor: pointer; transition: transform .18s; }
    #top .side-tg:hover { border-color: var(--accent); color: var(--accent); }
    #top .tabs { flex: 1 1 auto; min-height: 0; flex-direction: column; gap: 2px; margin: 4px 0 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
    #top .tabs a { flex: none; justify-content: flex-start; gap: 12px; padding: 9px 12px !important; font-size: 15px; white-space: nowrap; border-radius: 8px; }
    #top .tabs a span { width: 22px; flex: none; text-align: center; }
    #top .tabs a em { display: inline !important; }
    #top .top-actions { flex: none; margin: 0; flex-direction: column; align-items: stretch; gap: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
    #top .top-actions .pill { justify-content: flex-start; gap: 10px; padding: 8px 12px; border-radius: 8px; white-space: nowrap; }
    #top .top-actions .pill em, #top .side-l { display: inline !important; font-style: normal; }
    #top .top-actions .pill kbd { display: inline !important; margin-left: auto; }
    #top .top-actions .pill b { margin-left: auto; }
    #top #btnAgenda { display: inline-flex !important; }
    #top #ddNuevo { display: block; }
    #top #btnNuevo { width: 100%; justify-content: center; }
    #top #btnNuevo em { display: inline !important; }
    #top .side-fila { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
    #top .dd-menu { left: calc(100% + 10px); right: auto; top: auto; bottom: 0; }
    /* Contraído: solo iconos */
    html.side-col #top .side-cab { flex-direction: column; gap: 8px; }
    html.side-col #top .brand { flex: none; justify-content: center; }
    html.side-col #top .brand-txt, html.side-col #top .tabs a em, html.side-col #top .top-actions .pill em, html.side-col #top .top-actions .pill kbd, html.side-col #top .side-l, html.side-col #top #btnNuevo em { display: none !important; }
    html.side-col #top .side-tg { transform: rotate(180deg); }
    html.side-col #top .tabs a { justify-content: center; padding: 10px 0 !important; }
    html.side-col #top .top-actions .pill { justify-content: center; gap: 4px; padding: 8px 0; }
    html.side-col #top .top-actions .pill b { margin-left: 0; }
    html.side-col #top #btnNuevo { padding-left: 0; padding-right: 0; }
    html.side-col #top .side-fila { flex-direction: column; }
}
@media (min-width: 721px) and (max-height: 640px) {
    #top .tabs a { padding: 6px 12px !important; }
    html.side-col #top .tabs a { padding: 7px 0 !important; }
    #top .top-actions { gap: 4px; } #top .top-actions .pill { padding: 6px 12px; }
}
@media print { #top, .np-col { display: none !important; } #view.view { inset: 0 !important; } }

/* Columna a la derecha del texto: Al glosario, Glosario, Bloque, Marcar como… */
.np-barra.np-col { flex: none; width: 168px; display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 22px 12px 12px 10px; overflow-y: auto; box-sizing: border-box; }
.np-col .np-b { width: 100%; justify-content: flex-start; height: 36px; }
.n-ed.es-lista .np-col [data-c=alglos], .n-ed.es-lista .np-col [data-c=glosario] { display: none; }
@media (max-width: 1280px) { .np-barra.np-col { width: 156px; } .np-col .np-b { padding: 0 8px; font-size: 13px; } }
@media (max-width: 900px) {
    .np-barra.np-col { order: -1; width: auto; flex-direction: row; flex-wrap: wrap; justify-content: flex-end; gap: 6px; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--line); overflow: visible; }
    .np-col .np-b { width: auto; }
}
@media (max-width: 520px) { .np-barra.np-col { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; justify-content: flex-start; } .np-barra.np-col::-webkit-scrollbar { display: none; } .np-col .np-b { flex: none; } }

/* v3.6.2 · Sello de fecha y hora de la nota nueva y botón para pasarla a la agenda */
.ed-texto p.n-sello { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 13.5px; margin: 0 0 .6em; padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.n-sello-ag::before { content: "📅 Pasar a la agenda"; }
.n-sello-ag { white-space: nowrap; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); border: 0; border-radius: 99px; padding: 3px 10px; cursor: pointer; user-select: none; }
.n-sello-ag:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); }
@media print { .n-sello-ag { display: none; } }

/* ---------- v3.7.0 · Inicio centrado, con imagen de fondo y tarjetas translúcidas ---------- */
#view.ini-bg { background: linear-gradient(180deg, rgba(11, 27, 37, .62) 0%, rgba(11, 27, 37, .38) 38%, rgba(11, 27, 37, .58) 100%), var(--ini-img) center / cover no-repeat fixed; }
.page.ini { max-width: 1360px; padding-top: 26px; position: relative; }
.ini-cab { text-align: center; max-width: 1100px; margin: 0 auto 18px; color: var(--text); }
.ini-fecha { font-size: calc(12px * var(--fz)); font-weight: 600; letter-spacing: 2.4px; text-transform: uppercase; color: var(--muted); }
.ini-fecha::first-letter { text-transform: uppercase; }
.ini-cab h1 { font-size: calc(36px * var(--fz)); font-weight: 300; letter-spacing: -.6px; line-height: 1.15; margin: 6px 0 12px; }
.ini-cab h1 b { font-weight: 700; }
.ini-res { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.ini-acc { margin-left: 6px; }
.ini-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 99px; font-size: calc(13px * var(--fz)); background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; transition: background .15s, transform .15s; }
a.ini-chip:hover { transform: translateY(-1px); background: var(--surface2); }
.ini-chip.mal { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.ini-acc .btn { padding: 7px 20px; border-radius: 99px; font-weight: 700; background: var(--accent); border-color: var(--accent); color: var(--accent-text); box-shadow: var(--shadow); }
.ini-acc .btn:hover { transform: translateY(-1px); }
.ini .quick { gap: 14px; margin-bottom: 16px; }
/* Accesos en una línea: icono a la izquierda y dos líneas de texto */
.ini .quick button { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; row-gap: 1px; align-items: center; padding: 11px 14px; }
.ini .quick .ico { grid-row: 1 / span 2; font-size: 26px; }
.ini .quick b, .ini .quick button > span:not(.ico) { grid-column: 2; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ini .quick button, .ini .card { border-radius: 14px; }
.ini .quick button { transition: transform .15s, box-shadow .15s, border-color .15s; }
.ini .quick button:hover { transform: translateY(-2px); }
/* Las columnas no crecen con un texto largo (antes la derecha se salía por el borde) */
.ini-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ini-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; min-height: 0; }
/* v3.7.2 · Paginación de Notas recientes (de 9 en 9) */
.ini-pag { display: flex; align-items: center; justify-content: center; gap: 10px; padding-top: 8px; border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); margin-top: 6px; font-size: 12px; color: var(--muted); }
.ini-pag .icon-btn { width: 30px; height: 28px; font-size: 18px; line-height: 1; }
.ini-pag .icon-btn:disabled { opacity: .35; cursor: default; }
.ini .ini-rec .lista li > a { padding-top: 7px; padding-bottom: 7px; }
/* Tu biblioteca: cifras en mosaico */
.ini-bib-g { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ini-bib-g > div { text-align: center; padding: 8px 4px; border-radius: 10px; background: color-mix(in srgb, var(--surface2) 75%, transparent); }
.ini-bib-g b { display: block; font-size: calc(19px * var(--fz)); line-height: 1.2; }
.ini-bib-g span { font-size: 11px; color: var(--muted); }
.ini-bib h3 { margin-bottom: 10px; }
/* v3.7.1 · Sin desplazar la página: todo cabe en la pantalla y cada tarjeta desplaza dentro lo que no cabe */
@media (min-width: 1100px) and (min-height: 640px) {
    .page.ini { height: 100%; display: flex; flex-direction: column; padding-bottom: 18px; }
    .page.ini > .ini-cab, .page.ini > .quick { flex: none; }
    .ini-grid { flex: 1 1 auto; min-height: 0; }
    .ini-col > .card { display: flex; flex-direction: column; min-height: 0; flex: 0 1 auto; overflow: hidden; }
    .ini-col > .card.ini-llena { flex: 0 1 auto; }      /* v3.7.3 · Notas recientes: el alto de sus 9 filas, no hasta abajo */
    .ini-col > .card.ini-bib { flex: none; }
    .ini-col > .card > * { flex: none; }
    .ini-col > .card > ul { flex: 0 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
    .ini-col > .card > .ini-rec { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; }
    .ini-rec > ul { flex: 0 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
    .ini-rec > .ini-pag { flex: none; }
}
/* Pantallas bajas (portátil): la biblioteca en una sola fila para dejar sitio a las listas */
@media (min-width: 1100px) and (max-height: 820px) {
    .ini-bib-g { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
    .ini-bib-g > div { padding: 6px 2px; }
    .ini-bib-g b { font-size: calc(16px * var(--fz)); }
    .ini-bib-g span { font-size: 10px; }
}
@media (max-width: 1099px) {
    .ini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ini-col:first-child { grid-column: 1 / -1; }
}
.ini-fondo-bt { position: absolute; right: 20px; top: 18px; z-index: 5; display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 99px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow); opacity: .8; transition: opacity .15s; }
.ini-fondo-bt:hover { opacity: 1; }
/* Con imagen: textos claros sobre el velo y tarjetas de cristal */
#view.ini-bg .ini-cab { color: #fff; }
#view.ini-bg .ini-fecha { color: rgba(255, 255, 255, .82); }
#view.ini-bg .ini-cab h1 { text-shadow: 0 2px 18px rgba(0, 0, 0, .35); }
#view.ini-bg .ini-chip { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .3); color: #fff; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
#view.ini-bg a.ini-chip:hover { background: rgba(255, 255, 255, .27); }
#view.ini-bg .ini-chip.mal { background: rgba(210, 63, 75, .62); border-color: rgba(255, 255, 255, .35); color: #fff; }
#view.ini-bg .ini-acc .btn { background: #fff; border-color: #fff; color: #216273; box-shadow: 0 8px 24px rgba(0, 0, 0, .28); }
#view.ini-bg .ini .quick button, #view.ini-bg .ini .card { background: color-mix(in srgb, var(--surface) 87%, transparent); border-color: color-mix(in srgb, var(--line) 55%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.15); backdrop-filter: blur(14px) saturate(1.15); box-shadow: 0 12px 32px rgba(8, 22, 32, .22); }
#view.ini-bg .ini-fondo-bt { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .35); color: #fff; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: none; }
/* Ventana «Fondo de Inicio» */
.ini-fd { display: grid; gap: 8px; }
.ini-fd-op { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.ini-fd-op span { font-size: 12px; color: var(--muted); }
.ini-fd-op:hover:not(:disabled) { border-color: var(--accent); }
.ini-fd-op.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.ini-fd-op:disabled { opacity: .5; cursor: default; }
.ini-fd-sub { justify-content: center; margin-top: 4px; }
.ini-fd p { margin: 4px 0 0; }
@media (max-width: 900px) {
    .page.ini { padding-top: 46px; }
    .ini-cab h1 { font-size: calc(28px * var(--fz)); }
    .ini-grid { grid-template-columns: minmax(0, 1fr); }
    #view.ini-bg { background-attachment: scroll; }
}
@media (max-width: 600px) { .ini-fecha { letter-spacing: 1.4px; } .ini-fondo-bt { right: 10px; top: 10px; padding: 5px 10px; } .ini-acc { margin: 6px 0 0; flex-basis: 100%; } }
@media print { #view.ini-bg { background: none !important; } .ini-fondo-bt { display: none !important; } }

/* v4.0 · SaaS: marca PRO en pestañas fuera del plan e indicador sin conexión */
.tab-pro { font-size: 9px; font-weight: 800; letter-spacing: .4px; color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 1px 4px; margin-left: 4px; vertical-align: super; }
.pill-off { border-color: var(--accent); color: var(--accent); }
.pill-off.sin { border-color: var(--danger); color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--surface2)); }
.pill-off[hidden] { display: none; }
.pill-off b:empty { display: none; }

/* ---------- v4.0 · Actividad reciente («Seguir donde lo dejé») ---------- */
.modal.modal-lat { justify-content: flex-end; align-items: stretch; padding: 0; overflow: hidden; }
.modal-box.act-panel { max-width: 440px; height: 100%; border-radius: 0; border-width: 0 0 0 1px; display: flex; flex-direction: column; animation: actin .16s ease; }
@keyframes actin { from { transform: translateX(28px); opacity: 0; } }
.act-panel .modal-body { flex: 1; min-height: 0; overflow: auto; padding: 0; }
.act-bar { position: sticky; top: 0; z-index: 1; background: var(--surface); padding: 12px 14px 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.act-q { width: 100%; }
.act-mods { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.act-mods::-webkit-scrollbar { display: none; }
.act-mods button { flex: none; border: 1px solid var(--line); background: var(--surface2); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 700; padding: 5px 11px; border-radius: 99px; cursor: pointer; white-space: nowrap; }
.act-mods button:hover { border-color: var(--accent); }
.act-mods button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.act-l { padding: 4px 10px 14px; }
.act-g h4 { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 8px 6px; }
.act-f { display: flex; align-items: center; gap: 2px; }
.act-i { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--text); text-decoration: none; border-left: 3px solid var(--line); }
a.act-i:hover { background: var(--surface2); text-decoration: none; }
.act-i .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.act-i .t b { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-i .t span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-ico { flex: none; width: 24px; font-size: 18px; text-align: center; }
.act-h { flex: none; font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.act-i.t-editar, .act-i.t-crear, .act-i.t-completar { border-left-color: var(--accent); }
.act-i.t-estudiar { border-left-color: var(--ok); }
.act-i.t-borrar { opacity: .6; border-left-color: var(--danger); cursor: default; }
.act-x { flex: none; border: 0; background: transparent; color: var(--muted); font: inherit; padding: 6px 8px; border-radius: 7px; cursor: pointer; opacity: 0; }
.act-f:hover .act-x, .act-x:focus-visible { opacity: 1; }
.act-x:hover { color: var(--danger); background: var(--surface2); }
@media (hover: none) { .act-x { opacity: .7; } }
.act-mas { display: block; margin: 10px auto 0; }
.act-ini .act-l { padding: 0; }
.act-ini .act-i { padding: 7px 8px; }
/* aviso al abrir: lo último que se estaba editando */
.act-aviso { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 260; display: flex; align-items: center; gap: 12px; width: max-content; max-width: min(580px, calc(100vw - 24px));
    background: var(--surface); color: var(--text); border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: 12px; box-shadow: var(--shadow); padding: 10px 10px 10px 14px; animation: actup .22s ease; transition: opacity .22s, transform .22s; }
.act-aviso .act-ico { font-size: 24px; width: 30px; }
.act-aviso .t { min-width: 0; display: flex; flex-direction: column; }
.act-aviso small { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.act-aviso b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-aviso .t span { font-size: 12.5px; color: var(--muted); }
.act-aviso .btn { flex: none; }
.act-aviso.fuera { opacity: 0; transform: translate(-50%, 10px); }
@keyframes actup { from { transform: translate(-50%, 12px); opacity: 0; } }
@media (min-width: 521px) and (max-width: 1440px) { #btnReciente kbd { display: none; } }
@media (max-width: 900px) { #btnReciente em { display: none; } }
@media (max-width: 520px) { .act-aviso { bottom: 76px; } .modal-box.act-panel { max-width: none; border-width: 0; } }

/* ===================== v4.0.7 · Móvil (hasta 720 px): menos iconos ===================== */
/* Elementos que solo existen en el móvil */
.mv-solo { display: none !important; }
/* Hoja inferior (secciones de «Más») */
.mv-hoja { position: fixed; inset: 0; z-index: 90; background: rgba(15, 18, 24, 0); transition: background .18s; }
.mv-hoja.in { background: rgba(15, 18, 24, .38); }
.mv-hoja-box { position: absolute; left: 0; right: 0; bottom: 0; background: var(--surface); border-radius: 18px 18px 0 0; box-shadow: 0 -10px 30px rgba(0, 0, 0, .2); padding: 8px 14px max(16px, env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .18s; }
.mv-hoja.in .mv-hoja-box { transform: none; }
.mv-hoja-h { display: flex; align-items: center; justify-content: space-between; padding: 4px 2px 10px; font-size: 15px; }
.mv-hoja-g { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mv-hoja-g button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface2); color: var(--text); font: inherit; cursor: pointer; }
.mv-hoja-g button span { font-size: 26px; line-height: 1; }
.mv-hoja-g button b { font-size: 13.5px; }
.mv-hoja-g button small { font-size: 11px; color: var(--muted); }
.mv-hoja-g button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
#menuMv { min-width: 240px; }
#menuMv .mv-quien { padding: 8px 11px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
#menuMv .mv-quien b { display: block; font-size: 14.5px; } #menuMv .mv-quien span { font-size: 12px; color: var(--muted); }
#menuMv .fz-row b { font-size: 13px; color: var(--muted); }

@media (max-width: 720px) {
    /* --- Barra superior: logo, buscar, nuevo y 👤 (Reciente, letra, tema, cuenta y salir van dentro de 👤) --- */
    :root { --bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }
    .top { gap: 6px; padding-left: 10px !important; padding-right: 8px !important; }
    .brand { display: flex !important; gap: 8px; font-size: 18px; } .brand-txt { display: inline !important; } .brand-logo { width: 32px; height: 32px; }
    .top-actions { margin-left: auto; gap: 6px !important; flex: none; }
    #btnReciente, #btnAgenda, #btnRepaso, .side-fila { display: none !important; }
    #btnBuscar em, #btnBuscar kbd, #btnNuevo em { display: none !important; }
    #btnBuscar { padding: 7px 12px; }
    #ddMv { display: block !important; }
    #btnMv { width: 40px; height: 40px; font-size: 19px; background: var(--surface2); border-radius: 50%; }
    /* --- Barra inferior: Inicio, Agenda, Notas, Repaso y Más --- */
    .tabs { position: fixed !important; left: 0; right: 0; bottom: 0; height: var(--bottom); padding: 0 4px env(safe-area-inset-bottom, 0px) !important; margin: 0 !important; background: var(--surface); border-top: 1px solid var(--line); display: flex; justify-content: space-around; align-items: stretch; overflow: visible !important; z-index: 55; }
    .tabs a { flex: 1 1 0 !important; flex-direction: column; justify-content: center; gap: 1px; padding: 4px 0 !important; border-radius: 12px; margin: 5px 3px; font-size: 11px; position: relative; }
    .tabs a em { display: block !important; font-size: 11.5px; font-weight: 700; font-style: normal; }
    .tabs a em .tab-pro { display: none; }
    .tabs a span { font-size: 21px; }
    .tabs a.mv-mas { display: none !important; }
    .tabs a.mv-solo { display: flex !important; }
    .tab-n { display: block; }
    .view { bottom: var(--bottom); }
    .toasts { bottom: calc(var(--bottom) + 10px); }
    .voz-player { bottom: calc(var(--bottom) + 10px); }

    /* --- Notas: sin las dos columnas de iconos; las listas y paneles ocupan la pantalla --- */
    .notas .n-rail, .notas.rail-izq .n-rail-izq, .notas.rail-der .n-rail-der { display: none !important; }
    .notas.izq-flot .n-izq { left: 0 !important; width: 100% !important; }
    .notas.izq-flot.con-nota .n-izq { width: calc(100% - 44px) !important; }
    .notas.der-flot .n-der { right: 0 !important; left: auto; width: calc(100% - 44px) !important; }

    /* Cabecera de la nota: ☰ · título · ⋯ */
    #n-ed .np-cab { flex-wrap: nowrap; gap: 6px; padding: 8px 8px 6px; align-items: center; }
    #n-ed #e-back { display: inline-grid !important; flex: none; width: 40px; height: 40px; }
    #n-ed .np-cab input.ed-titulo { flex: 1 1 auto !important; order: 0 !important; min-width: 0 !important; font-size: calc(19px * var(--fz)) !important; }
    #n-ed #e-mv { display: inline-grid !important; flex: none; width: 40px; height: 40px; font-size: 22px; font-weight: 700; background: var(--surface2); }
    #n-ed #e-mv.on { background: var(--accent); color: var(--accent-text); }
    #n-ed #e-tipo, #n-ed #e-acc { display: none; }
    #n-ed .ed-meta { display: none; }
    /* Panel ⋯ abierto: tipo de nota en la cabecera, etiquetas bajo la barra y opciones en una hoja inferior */
    #n-ed.mv-acc #e-tipo { display: block; flex: none; max-width: 118px; margin: 0; padding: 6px 4px; font-size: 13px; }
    #n-ed.mv-acc .ed-meta { display: flex; }
    #n-ed.mv-acc #e-acc { display: grid !important; position: fixed; left: 0; right: 0; bottom: var(--bottom); z-index: 56; max-height: 62vh; overflow-y: auto; margin: 0; width: auto;
        grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 12px 10px 14px; background: var(--surface); border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; box-shadow: 0 -10px 30px rgba(0, 0, 0, .18); }
    #n-ed.mv-acc #e-acc::before { content: "Opciones de la nota"; grid-column: 1 / -1; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 4px 2px; }
    #n-ed.mv-acc #e-acc .np-ico { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; width: auto; min-width: 0; height: 68px; padding: 4px 2px; font-size: 22px; border-radius: 12px; background: var(--surface2); }
    #n-ed.mv-acc #e-acc .np-ico::after { content: attr(data-l); font-size: 10.5px; font-weight: 600; color: var(--muted); line-height: 1.15; text-align: center; max-width: 100%; }
    #n-ed.mv-acc #e-acc .np-ico.mv-solo { display: flex !important; }
    #n-ed.mv-acc #e-acc .np-ico:disabled { opacity: .4; }
    #n-ed.mv-acc #e-acc .np-sep, #n-ed.mv-acc #e-acc [data-c="izq"], #n-ed.mv-acc #e-acc [data-c="der"] { display: none !important; }

    /* Hojas: la fila solo sale si hay más de una; renombrar y borrar van al panel ⋯ */
    #n-ed .np-hojas.una { display: none; }
    #n-ed .np-tabs-acc { display: none !important; }
    #n-ed .np-hojas { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 4px 8px 0; }
    #n-ed .np-tabs { flex-wrap: nowrap; }

    /* Barra de formato: una fila con lo básico; «Aa ▾» despliega el resto */
    #e-tb { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 6px 8px; }
    #e-tb .np-grupo { flex-wrap: nowrap; gap: 4px; }
    #e-tb .tb-sep, #e-tb .np-pct { display: none; }
    #e-tb:not(.mv-todo) .np-grupo > .tb:not([data-c="bold"]):not([data-c="italic"]):not([data-c="ul"]):not([data-c="wiki"]):not([data-c="deshacer"]) { display: none; }
    #e-tb .mv-fin { display: contents !important; }
    #e-tb .np-b { height: 38px !important; min-width: 36px !important; padding: 0 7px !important; font-size: 15px; }
    #e-tb [data-c="mv-aa"] { margin-left: auto; font-weight: 700; }
    #e-tb.mv-todo, #e-tb.mv-todo .np-grupo { flex-wrap: wrap; overflow: visible; }
    #e-tb.mv-todo .np-pct { display: inline-block; }
    #e-tb.mv-todo .tb.mv-extra { display: inline-flex !important; }
    #n-ed.es-lista #e-tb [data-c="alglos"], #n-ed.es-lista #e-tb [data-c="glosario"] { display: none !important; }
    /* La columna de botones de colores pasa a la barra */
    #n-ed #e-col { display: none !important; }

    /* Pie de la nota más bajo: solo el estado de guardado */
    #n-ed .ed-estado { min-height: 34px !important; padding: 6px 14px !important; font-size: 13px !important; gap: 10px; }
    #n-ed .ed-estado > span:not(#e-est) { display: none !important; }
    #n-ed .ed-estado #e-est { font-size: 13px !important; }
}
