/* Pitágoras — estilos (sin Node ni compilación: CSS tal cual) */

:root {
  --bg: #F4F2ED;
  --bg-side: #EFECE5;
  --card: #FFFFFF;
  --ink: #1C1B19;
  --ink-2: #3D3A34;
  --muted: #6E6A61;
  --faint: #8C887E;
  --line: #E2DED5;
  --line-2: #ECE8E0;
  --chip: #E7E3DA;
  --hl: #FFD2A6;          /* fosforito de "importante" */
  --curso: #7A4F00;
  --curso-bg: #FFF0CF;
  --ok: #1B5E34;
  --danger: #B42318;
  --blue: #2F5FD0;
  --blue-ink: #1F45A8;
  --blue-soft: #E3EBFC;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 14px;
  --side-w: 272px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sans); background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.4; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); }
a:hover { color: var(--blue-ink); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }

.h1 { font-family: var(--serif); font-weight: 600; font-size: 32px; line-height: 1.1; margin: 0; }
.h2 { font-family: var(--serif); font-weight: 600; font-size: 22px; margin: 0 0 4px; }
.h3 { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 18px 0 6px; }
.muted { color: var(--muted); font-size: 14px; }
.hint { color: var(--muted); font-size: 12.5px; }
.small-link { font-size: 13px; }
.spacer { flex: 1; }
.inline { display: inline; }
.link { border: 0; background: none; color: var(--blue); padding: 0; text-decoration: underline; }

/* ---------- Estructura ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
  width: var(--side-w); flex-shrink: 0; background: var(--bg-side); border-right: 1px solid var(--line);
  padding: 22px 16px; display: flex; flex-direction: column; gap: 16px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side > * { flex-shrink: 0; }
.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main { flex: 1; padding: 28px 32px 40px; min-width: 0; }
.only-mobile { display: none !important; }

.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--ink); color: var(--bg); display: grid; place-items: center; }
.brand-name { font-family: var(--serif); font-size: 22px; font-weight: 600; flex: 1; }

.search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); color: var(--muted); }
.search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; font-size: 14px; color: var(--ink); }

.side-title { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 8px 6px; display: flex; justify-content: space-between; align-items: center; }
.side-title a { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 13px; }
.side-nav { display: flex; flex-direction: column; gap: 1px; }
.side-nav a, .side-note {
  display: flex; align-items: center; gap: 11px; min-height: 36px; padding: 0 10px; border-radius: 9px;
  color: var(--ink); text-decoration: none; font-size: 15px;
}
.side-nav a svg { color: var(--muted); flex-shrink: 0; }
.side-nav a span:nth-child(2), .side-note-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-nav em, .side-note em { font-style: normal; font-size: 13px; color: var(--muted); }
.side-nav a:hover, .side-note:hover { background: rgba(255,255,255,.55); color: var(--ink); }
.side-nav a.active, .side-note.active { background: var(--card); box-shadow: 0 1px 2px rgba(28,27,25,.07); font-weight: 600; }
.side-nav a.is-danger, .side-nav a.is-danger svg { color: var(--danger); }
.hl-swatch { width: 16px; height: 10px; border-radius: 3px; background: var(--hl); flex-shrink: 0; }
.hl-swatch.big { width: 22px; height: 14px; }
.side-block { display: flex; flex-direction: column; gap: 4px; }
.note-dot { width: 11px; height: 11px; border-radius: 4px; flex-shrink: 0; background: var(--c-dot, var(--muted)); display: inline-block; }
.note-dot.big { width: 14px; height: 14px; }
.side-foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 14px 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.side-foot a, .side-foot button { color: var(--muted); text-decoration: none; background: none; border: 0; padding: 0; font-size: 14px; }
.side-foot a:hover, .side-foot button:hover { color: var(--ink); }
/* Holocron: volver al portal, usuario y salir */
.hub-link { font-size: 13px; color: var(--muted); text-decoration: none; padding: 0 6px; margin-bottom: -6px; }
.hub-link:hover { color: var(--ink); }
.side-user { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 8px 0; font-size: 14px; color: var(--muted); }
.side-user-name { font-weight: 600; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user a { color: var(--muted); text-decoration: none; }
.side-user a:hover { color: var(--ink); }
.logout-form { margin: 0; }
.logout-form button { border: 0; background: none; padding: 0; color: var(--muted); }
.logout-form button:hover { color: var(--ink); }

/* ---------- Botones y chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid #D0CBBF; background: var(--card); font-size: 15px; font-weight: 600; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.btn:hover { background: #FAF9F6; color: var(--ink); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #33312D; color: #fff; }
.btn-block { width: 100%; height: 44px; }
.btn-danger-soft { color: var(--danger); border-color: #E8C4C0; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; display: inline-grid; place-items: center; color: var(--ink-2); text-decoration: none; flex-shrink: 0; }
.icon-btn:hover { background: rgba(0,0,0,.05); }
.icon-btn.soft { background: rgba(255,255,255,.7); color: var(--c-ink, var(--ink)); }
.icon-btn.bordered { border: 1px solid #D0CBBF; background: var(--card); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 4px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 15px; border: 1px solid #D0CBBF; background: var(--card); font-size: 13px; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.chip:hover { color: var(--ink); border-color: #A9A396; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip-color { background: var(--c-soft); color: var(--c-ink); border-color: transparent; font-weight: 600; }
.chip-color:hover { color: var(--c-ink); border-color: var(--c-dot); }
.chip-color.on { background: var(--c-ink); color: #fff; border-color: var(--c-ink); }
.chip-lg { height: 38px; padding: 0 14px; font-size: 14px; gap: 8px; cursor: pointer; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

.seg { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--chip); gap: 2px; }
.seg a { height: 34px; padding: 0 14px; border-radius: 9px; display: inline-flex; align-items: center; font-size: 14px; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.seg a.on { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg.scroll { max-width: 100%; overflow-x: auto; }
.hl-text { background: var(--hl); padding: 0 4px; border-radius: 3px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--ink); }

.flash { background: var(--blue-soft); color: #152A5C; padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; font-size: 14px; }
.flash.error { background: #FDE7E4; color: var(--danger); }
.flash code { background: rgba(255,255,255,.7); padding: 2px 6px; border-radius: 6px; font-size: 14px; }

/* ---------- Cabecera de página y filtros ---------- */
.page-head { display: flex; align-items: center; gap: 16px 20px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .h1 { margin-right: auto; }
.filters { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.list > .filters, .main > .filters { margin-bottom: 16px; }

/* ---------- Cuadro de progreso (como en la libreta) ---------- */
.sq {
  --p: 0;
  width: 22px; height: 22px; flex-shrink: 0; padding: 0; border: 2px solid var(--ink); border-radius: 5px;
  background: linear-gradient(to top right, var(--ink) calc(var(--p) * 1%), #fff calc(var(--p) * 1%));
  display: inline-grid; place-items: center; color: #fff; transition: transform .08s ease;
}
button.sq:hover { transform: scale(1.08); }
button.sq:active { transform: scale(.94); }
.sq svg { width: 13px; height: 13px; }
.sq-mini { width: 14px; height: 14px; border-width: 2px; border-radius: 3px; }
.sq-ghost { border-style: dashed; border-color: #A9A396; background: transparent; }

/* ---------- Fila de tarea ---------- */
.task { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 3px 6px; border-radius: 9px; position: relative; }
.task { --row-hover: color-mix(in srgb, var(--c-soft, #ECE8E0) 60%, #fff); }
.task:hover, .task:focus-within { background: var(--row-hover); }
.add-sub { width: 30px; height: 30px; border: 0; background: none; padding: 0; display: grid; place-items: center; border-radius: 8px; color: var(--muted); flex-shrink: 0; }
.add-sub svg { width: 16px; height: 16px; }
.add-sub:hover { background: rgba(0,0,0,.06); color: var(--ink); }
.quick-add.inline-sub { padding-left: 38px; min-height: 38px; background: var(--row-hover, #F7F5F0); border-radius: 9px; margin: 2px 0 4px; }
.quick-add.inline-sub input { font-size: 14px; }
.task > form { display: contents; }
.task.is-sub { min-height: 36px; padding-left: 34px; }
.task.is-sub .sq { width: 18px; height: 18px; border-radius: 4px; }
.task.is-sub .sq svg { width: 11px; height: 11px; }
.task-title { flex: 1; min-width: 0; border: 0; background: none; padding: 4px 0; text-align: left; display: flex; flex-direction: column; gap: 2px; }
.task-name { font-size: 15px; line-height: 1.3; align-self: flex-start; padding: 0 3px; margin: 0 -3px; border-radius: 3px; }
.task.is-sub .task-name { font-size: 14px; }
.task.is-important .task-name { background: var(--hl); }
.task.is-closed .task-name { color: var(--faint); text-decoration: line-through; }
.has-notes { width: 13px; height: 13px; margin-left: 6px; vertical-align: -1px; color: var(--muted); }
.task-notes { font-size: 12.5px; color: var(--muted); white-space: pre-line; padding: 0 3px; }
.field textarea { padding: 10px 12px; border-radius: 10px; border: 1px solid #D0CBBF; background: #fff; font-size: 15px; resize: vertical; min-height: 70px; width: 100%; line-height: 1.4; }
.field textarea:focus { border-color: var(--blue); outline: 2px solid var(--blue-soft); }
.task-where { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.task-where .note-dot { width: 8px; height: 8px; border-radius: 3px; }
.task-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; font-size: 13px; color: var(--muted); }
.pct { color: var(--curso); font-weight: 600; font-size: 12.5px; }
.pill { font-size: 12px; background: #F1EEE7; padding: 1px 8px; border-radius: 10px; }
.dates { white-space: nowrap; }
.when { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--blue-ink); background: var(--blue-soft); padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.when svg { width: 12px; height: 12px; }
.when.is-overdue { color: var(--danger); background: #FDE7E4; }
.task.is-closed .when { color: var(--faint); background: #F1EEE7; }

.star { width: 30px; height: 30px; border: 0; background: none; padding: 0; display: grid; place-items: center; border-radius: 8px; }
.star svg { width: 17px; height: 17px; fill: none; stroke: #A9A396; }
.star.on svg { fill: #F2B200; stroke: #C98F00; }
.star:hover { background: rgba(0,0,0,.05); }

.menu { position: relative; }
/* La fila con el menú abierto queda por encima de las demás (si no, las filas de abajo tapan el menú) */
.task:has(.menu[open]), .note-head:has(.menu[open]) { z-index: 40; }
.col:has(.menu[open]) { position: relative; z-index: 40; }
.menu > summary { list-style: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary svg { width: 16px; height: 16px; }
.menu > summary:hover, .menu[open] > summary { background: var(--line-2); color: var(--ink); }
.menu-list { position: fixed; z-index: 60; min-width: 200px; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(28,27,25,.16); display: flex; flex-direction: column; }
.menu-list form { display: contents; }
.menu-list button, .menu-list a { height: 38px; padding: 0 10px; border: 0; background: none; text-align: left; border-radius: 8px; font-size: 14px; color: var(--ink); text-decoration: none; display: flex; align-items: center; }
.menu-list button:hover, .menu-list a:hover { background: #F4F2ED; }
.menu-list .danger { color: var(--danger); }

/* En el tablero la estrella y el menú flotan a la derecha y solo aparecen al pasar el ratón:
   así el nombre de la tarea usa todo el ancho (la importancia ya se ve con el fosforito) */
/* sin transform: un transform haría que el menú (position: fixed) se colocara mal */
.col .task .star, .col .task .menu, .col .task .add-sub { position: absolute; top: 5px; opacity: 0; pointer-events: none; }
.col .task.is-sub .star, .col .task.is-sub .menu, .col .task.is-sub .add-sub { top: 3px; }
.col .task:hover .task-meta, .col .task:focus-within .task-meta { visibility: hidden; }
.col .task .add-sub { right: 70px; background: var(--row-hover); }
.col .task .star { right: 38px; background: var(--row-hover); }
.col .task .menu { right: 6px; }
.col .task .menu > summary { background: var(--row-hover); }
.col .task .add-sub:hover, .col .task .star:hover, .col .task .menu > summary:hover { background: #fff; }
.col .task:hover .star, .col .task:hover .menu, .col .task:hover .add-sub, .col .task:focus-within .star, .col .task:focus-within .menu, .col .task:focus-within .add-sub, .col .task .menu[open] { opacity: 1; pointer-events: auto; }

/* ---------- Tablero ---------- */
.board {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px;
  padding: 4px 2px 16px; align-items: start;
  background-image: radial-gradient(#D9D4C9 1.2px, transparent 1.2px); background-size: 22px 22px;
  margin: 0 -8px; padding-left: 8px; padding-right: 8px;
}
.col { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 12px 12px; box-shadow: inset 0 6px 0 var(--c-dot); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.col-head { display: flex; align-items: baseline; gap: 10px; padding: 0 6px; }
.col-title { flex: 1; min-width: 0; font-family: var(--serif); font-weight: 600; font-size: 26px; line-height: 1.1; color: var(--c-ink); text-decoration: none; }
.col-title:hover { color: var(--c-dot); }
.col-count { font-size: 14px; color: var(--muted); }
.col-desc { margin: -2px 6px 0; font-size: 13.5px; color: var(--muted); }
.bar { height: 6px; border-radius: 3px; background: var(--c-soft, var(--line-2)); overflow: hidden; margin: 0 6px 4px; }
.bar > span { display: block; height: 100%; border-radius: 3px; background: var(--c-dot, var(--ink)); }
.col-tasks { display: flex; flex-direction: column; max-height: 414px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #CFC9BC transparent; margin-right: -6px; padding-right: 4px; }
/* Cuando solo caben 2 columnas (o menos): 4 tareas visibles por columna */
.board { container-type: inline-size; container-name: tablero; }
@container tablero (max-width: 905px) {
  .col-tasks { max-height: 172px; }
}
/* Si todas las notas caben en una sola fila, se ven todas sus tareas sin recortar */
.board.one-row .col-tasks { max-height: none !important; overflow: visible; }
.col-tasks.has-more { box-shadow: inset 0 -14px 10px -10px rgba(28,27,25,.10); }
.col-count-more { font-size: 12.5px; color: var(--muted); padding: 2px 8px 0; }
.task-extra { display: contents; }
/* En columnas y pizarra: la fila se adapta. Si nombre + partes/fecha caben, una línea;
   si no, el nombre ocupa la primera línea completa (hasta 2 si es muy largo)
   y las partes, la fecha y el resto bajan a una segunda línea, alineados a la derecha. */
.col .task { flex-wrap: wrap; row-gap: 0; min-height: 40px; }
.col .task-title { flex: 1 1 auto; min-width: 0; max-width: calc(100% - 34px); }
.col .task.is-sub .task-title { max-width: calc(100% - 30px); }
.col .task-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; max-width: 100%; align-self: stretch; margin: 0; }
.col .task-extra { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px 8px; margin-left: auto; max-width: 100%; padding-bottom: 2px; }
.col .task.is-important .task-name { align-self: flex-start; }
.col .task-title.is-long .task-name { font-size: 13.5px; }
.col .task-meta { flex-shrink: 0; }
.col .task-meta .when { padding: 2px 6px; }
.all-done { margin: 2px 6px 6px; color: var(--ok); font-size: 14px; font-weight: 600; }
.col-new { border: 2px dashed #C9C3B6; background: transparent; box-shadow: none; min-height: 140px; align-items: center; justify-content: center; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.col-new:hover { border-color: #A9A396; background: rgba(255,255,255,.5); }
.more { font-size: 13px; color: var(--muted); padding: 0 8px; text-decoration: none; }

.quick-add { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 6px; color: var(--muted); }
.quick-add input[type=text] { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; color: var(--ink); }
.quick-add.big { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; min-height: 50px; margin-bottom: 10px; }
.quick-add.sub { padding-left: 38px; min-height: 36px; }
.quick-add.sub input { font-size: 14px; }
kbd { font-family: var(--sans); font-size: 12px; color: var(--muted); border: 1px solid #D8D3C8; border-radius: 6px; padding: 2px 6px; }

.empty { grid-column: 1 / -1; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 40px; text-align: center; }
.empty h2 { font-family: var(--serif); margin: 0 0 6px; }
.empty-small { color: var(--muted); font-size: 14px; padding: 8px 6px; }

/* ---------- Página de nota ---------- */
.note-head { background: var(--c-soft); color: var(--c-ink); border-radius: 16px; padding: 18px 20px; margin-bottom: 18px; display: flex; flex-direction: column; gap: 12px; }
.note-head-top { display: flex; align-items: flex-start; gap: 12px; }
.note-head-text { flex: 1; min-width: 0; }
.note-head-text p { margin: 4px 0 0; opacity: .85; }
.note-head .h1 { color: var(--c-ink); }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 15px; background: rgba(255,255,255,.7); font-size: 13px; font-weight: 600; white-space: nowrap; }
.tag .dot { background: var(--c-dot); }
.note-progress { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.note-progress .bar { flex: 1; margin: 0; height: 8px; background: rgba(0,0,0,.08); }
.note-head .menu > summary { width: 40px; height: 40px; }
.note-head .menu-list { color: var(--ink); }

.list { background: transparent; max-width: 980px; }
.group { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; padding: 4px; }
.group .subs { border-top: 1px solid #F0EDE6; margin-top: 2px; padding-top: 2px; }
.group .subs.no-add .quick-add.sub { display: none; }
.group .subs.no-add:not(:has(.task)) { display: none; }
.list > .task { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 6px; padding: 4px 10px; }

.row-card { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 8px; }
.row-card .note-dot { background: var(--c-dot); }
.row-card-title { font-weight: 600; flex: 1; min-width: 160px; color: var(--ink); text-decoration: none; }
.row-card form { display: inline; }

/* ---------- Calendario ---------- */
.cal-nav { display: flex; gap: 8px; align-items: center; }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.cal { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow span { padding: 8px 10px; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); background: #FAF9F6; border-bottom: 1px solid var(--line-2); }
.cal-cell { min-height: 118px; padding: 7px; border-right: 1px solid #F0EDE6; border-bottom: 1px solid #F0EDE6; display: flex; flex-direction: column; gap: 3px; text-decoration: none; color: var(--ink); min-width: 0; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell:hover { background: #FAF9F6; }
.cal-cell.out { background: #FAF9F6; color: var(--faint); }
.cal-cell.weekend .cal-num { color: var(--muted); }
.cal-cell.sel { background: #F2F6FE; box-shadow: inset 0 0 0 2px var(--blue); }
.cal-num { font-size: 13px; font-weight: 600; align-self: flex-start; min-width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 11px; }
.cal-cell.today .cal-num { background: var(--ink); color: #fff; }
.cal-chip { font-size: 12px; padding: 2px 6px; border-radius: 6px; background: var(--c-soft); color: var(--c-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip.done { text-decoration: line-through; opacity: .6; }
.cal-chip.overdue { box-shadow: inset 3px 0 0 var(--danger); }
.cal-more { font-size: 11.5px; color: var(--muted); padding-left: 4px; }
.cal-dots { display: none; gap: 3px; justify-content: center; }
.cal-dots i { width: 5px; height: 5px; border-radius: 50%; }
.cal-day { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; position: sticky; top: 20px; }
.day-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.day-item { display: flex; align-items: flex-start; gap: 6px; background: #F7F5F0; border-radius: 12px; padding: 6px 6px 6px 10px; }
.day-item .task { flex: 1; min-width: 0; padding: 0; }
.day-item .task:hover { background: none; }
.day-item .task .when { display: none; }
.day-time { font-weight: 600; color: var(--blue-ink); font-size: 14px; padding-top: 11px; width: 42px; flex-shrink: 0; }
.day-time.is-overdue { color: var(--danger); }

/* ---------- Ventanas (editor) ---------- */
.dialog { border: 0; padding: 0; border-radius: 18px; width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 40px); box-shadow: 0 24px 60px rgba(28,27,25,.3); background: var(--card); color: var(--ink); }
.dialog::backdrop { background: rgba(28,27,25,.45); }
#dialog-body { padding: 20px 22px 22px; }
.dialog { overflow-x: hidden; }
.dialog-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.dialog-head h2 { font-family: var(--serif); font-size: 22px; margin: 0; flex: 1; }
.dialog-foot { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 8px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span:not(.hint), .field legend { font-size: 13px; font-weight: 600; color: #4A4740; padding: 0; }
.field input, .field select { height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid #D0CBBF; background: #fff; font-size: 15px; min-width: 0; width: 100%; }
.field input:focus, .field select:focus { border-color: var(--blue); outline: 2px solid var(--blue-soft); }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-errors { background: #FDE7E4; color: var(--danger); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.form-error { color: var(--danger); font-size: 14px; margin: 0; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }

.imp-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; padding: 6px 10px; border-radius: 10px; background: #F4F2ED; }
.imp-toggle input { width: 17px; height: 17px; accent-color: #C98F00; }

.progress-pick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.progress-pick button { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 10px; border-radius: 10px; border: 1px solid #D0CBBF; background: #fff; font-size: 14px; }
.progress-pick button .sq { width: 16px; height: 16px; border-radius: 3px; }
.progress-pick button .sq svg { width: 10px; height: 10px; }
.progress-pick button.on { border: 2px solid var(--ink); font-weight: 600; }
.pct-input { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--muted); }
.pct-input input { width: 64px; height: 38px; border-radius: 10px; border: 1px solid #D0CBBF; padding: 0 8px; }
.progress-auto { display: flex; align-items: center; gap: 10px; }

.schedule { background: #F7F5F0; border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.schedule-head { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; color: var(--blue); }
.schedule-head span { flex: 1; color: var(--ink); }
.schedule-head input { width: 20px; height: 20px; accent-color: var(--blue); }
.schedule:not(.on) .schedule-fields, .schedule:not(.on) .quick-days { display: none; }
.quick-days { display: flex; gap: 6px; flex-wrap: wrap; }
.quick-days button { height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid #D0CBBF; background: #fff; font-size: 13px; }

.color-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.color-opt { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; border-radius: 12px; border: 2px solid transparent; cursor: pointer; font-size: 15px; font-weight: 600; background: var(--c-soft); color: var(--c-ink); }
.color-opt:hover { border-color: var(--c-dot); }
.color-opt input { position: absolute; opacity: 0; pointer-events: none; }
.color-opt:has(input:checked) { background: var(--c-ink); color: #fff; border-color: var(--c-ink); }
.color-opt:has(input:checked)::after { content: '✓'; margin-left: auto; }
.color-opt:has(input:focus-visible) { outline: 2px solid var(--blue); }
.swatch { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; }

/* ---------- Ajustes / login ---------- */
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; max-width: 1100px; align-items: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.color-row { display: flex; align-items: center; gap: 12px; }
.color-row input { flex: 1; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid #D0CBBF; }
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login { width: min(380px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 28px; display: flex; flex-direction: column; gap: 20px; }

.next-up { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); text-align: left; margin-bottom: 14px; color: var(--blue); }
.next-up-text { flex: 1; display: flex; flex-direction: column; color: var(--ink); font-weight: 600; font-size: 15px; }
.next-up-text small { font-weight: 400; color: var(--muted); font-size: 12px; }
.next-up strong { font-size: 13px; color: var(--blue-ink); }

.topbar { position: sticky; top: 0; z-index: 20; height: 56px; padding: 0 8px; display: flex; align-items: center; gap: 6px; background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar-title { flex: 1; font-family: var(--serif); font-weight: 600; font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bottom-nav { position: sticky; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(3, 1fr); height: 64px; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; color: var(--muted); text-decoration: none; }
.bottom-nav a.active { color: var(--ink); font-weight: 600; }
.side-backdrop { display: none; }


/* ---------- Partes (LR / V…) ---------- */
.parts { display: inline-flex; gap: 5px; flex-shrink: 0; flex-wrap: wrap; }
.parts form { display: contents; }
.part { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 7px 0 4px; border-radius: 12px; border: 1px solid #D0CBBF; background: #fff; font-size: 12px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.part:hover { border-color: var(--ink); }
.part.done { background: var(--ink); border-color: var(--ink); color: #fff; }
.part small { font-weight: 500; opacity: .8; margin-left: 2px; }
.part-box { width: 13px; height: 13px; border: 2px solid currentColor; border-radius: 3px; display: inline-grid; place-items: center; flex-shrink: 0; }
.part.done .part-box { background: #fff; color: var(--ink); border-color: #fff; }
.part-box svg { width: 9px; height: 9px; }
.parts-edit { display: flex; flex-direction: column; gap: 8px; }
.part-row { display: flex; align-items: center; gap: 10px; }
.part-row input[type=text] { flex: 1; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid #D0CBBF; font-size: 15px; min-width: 0; }
.part-row .part-box { width: 18px; height: 18px; color: var(--ink); }
.part-row .part-box.done { background: var(--ink); color: #fff; }
/* Con partes: el nombre arriba y las partes siempre en la segunda línea (así los botones al pasar el ratón no las tapan) */
.col .task.has-parts .task-title { flex-basis: calc(100% - 34px); }
.col .task.has-parts .task-extra { padding-left: 32px; justify-content: flex-start; margin-left: 0; }
.col .task.has-parts:hover .task-meta, .col .task.has-parts:focus-within .task-meta { visibility: visible; }
.col .task.has-parts .add-sub { display: none; }

/* ---------- Colaboradores ---------- */
.avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--c-soft); color: var(--c-ink); border: 1.5px solid var(--c-dot); font-size: 10.5px; font-weight: 700; display: inline-grid; place-items: center; flex-shrink: 0; letter-spacing: .02em; }
.avatar.big { width: 38px; height: 38px; font-size: 14px; }
.who-filter { display: inline-flex; }
.who-filter .chip { gap: 6px; cursor: pointer; }
.who-filter select { border: 0; background: transparent; font: inherit; font-weight: 600; color: inherit; padding: 0 2px; cursor: pointer; outline: none; }
.who-filter .chip.on select option { color: var(--ink); }
.person-name { flex: 1; min-width: 180px; }
.person-name input { width: 100%; height: 38px; border: 1px solid transparent; border-radius: 9px; padding: 0 10px; font-size: 16px; font-weight: 600; background: transparent; }
.person-name input:hover, .person-name input:focus { border-color: #D0CBBF; background: #fff; }
.person-off { opacity: .6; }
.col .task .avatar { width: 22px; height: 22px; font-size: 9.5px; }

/* ---------- Archivos ---------- */
.clip { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; color: var(--muted); }
.clip svg { width: 13px; height: 13px; }
.files { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 10px; }
.files-head { display: flex; align-items: baseline; gap: 10px; }
.file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.file-list li { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 10px; background: #F7F5F0; }
.file-list form { display: contents; }
.file-list .icon-btn { width: 32px; height: 32px; }
.file-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-size: 14px; }
.file-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-name svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--muted); }
.file-name:hover span { text-decoration: underline; }
.dropzone label { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px; border: 2px dashed #C9C3B6; border-radius: 12px; color: var(--muted); font-size: 14px; cursor: pointer; text-align: center; padding: 8px; }
.dropzone label:hover, .dropzone.over label { border-color: var(--blue); color: var(--blue-ink); background: var(--blue-soft); }
.dropzone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone.busy label { opacity: .6; pointer-events: none; }
.dropzone.busy label span::after { content: ' · subiendo…'; }

/* ---------- Orden manual ---------- */
.tgroup { display: flex; flex-direction: column; }
.drag { width: 14px; flex-shrink: 0; color: #B9B3A7; cursor: grab; display: grid; place-items: center; margin-right: -4px; touch-action: none; }
.drag svg { width: 14px; height: 14px; }
.drag:hover { color: var(--ink); }
.task.is-sub .drag { margin-left: -18px; margin-right: 4px; }
[data-drag-item].dragging { opacity: .45; }
[data-drag-item].dragging .task { background: var(--row-hover); }
.order-form { display: contents; }
.order-btn { width: 26px; height: 26px; border: 0; border-radius: 7px; background: transparent; color: #B9B3A7; display: grid; place-items: center; padding: 0; }
.order-btn svg { width: 15px; height: 15px; }
.order-btn:hover { background: var(--line-2); color: var(--ink); }
.order-btn.on { background: var(--c-soft); color: var(--c-ink); }
.note-tools { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.note-tools .filters { margin-bottom: 0; }
.seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; font-size: 13px; color: var(--ink-2); }
.seg button.on { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); cursor: default; }

/* ---------- Tableros ---------- */
.side-boards { display: flex; flex-direction: column; gap: 1px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--blue); font-size: 13px; font-weight: 500; text-transform: none; letter-spacing: 0; cursor: pointer; }
.link-btn:hover { color: var(--blue-ink); }
.board-link { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border-radius: 9px; color: var(--ink); text-decoration: none; font-size: 15px; }
.board-link:hover { background: rgba(255,255,255,.55); color: var(--ink); }
.board-link.active { background: var(--c-soft); color: var(--c-ink); font-weight: 600; }
.board-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-link em { font-style: normal; font-size: 13px; color: var(--muted); }
.board-mark { width: 14px; height: 14px; border-radius: 4px; background: var(--c-dot); flex-shrink: 0; box-shadow: 3px 3px 0 var(--c-soft); }
.board-mark.big { width: 18px; height: 18px; border-radius: 5px; }
.board-title { display: flex; align-items: center; gap: 12px; margin-right: auto; flex-wrap: wrap; }
.board-title .h1 { margin: 0; color: var(--c-ink); }
.board-title .menu-list { color: var(--ink); }
.seg.small a { height: 30px; padding: 0 12px; font-size: 13px; }
.page-head .board-title + .filters { margin-left: 0; }
.side-nav a em:not(:empty) { min-width: 18px; text-align: right; }

/* ---------- Pizarra ---------- */
.pz-stats { display: flex; flex-direction: column; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; margin-bottom: 18px; }
.pz-nums { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; color: var(--ink-2); align-items: center; }
.pz-nums span { display: inline-flex; align-items: center; gap: 6px; }
.pz-nums strong { font-size: 18px; color: var(--ink); }
.pz-nums i { display: inline-block; }
.pz-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--line-2); }
.pz-bar .b-done { background: var(--ink); }
.pz-bar .b-curso { background: repeating-linear-gradient(135deg, var(--ink) 0 3px, #fff 3px 6px); }
.pz-bar .b-open { background: #D8D3C8; }
.pz-board { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 24px; font-weight: 600; margin: 26px 0 12px; }
.pz-board a { color: var(--c-ink); text-decoration: none; }
.pz-board em { font-family: var(--sans); font-style: normal; font-size: 14px; font-weight: 400; color: var(--muted); }
/* Bloques repartidos en columnas por JS (tipo muro); sin JS, una rejilla normal */
.pz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; align-items: start; padding: 8px; margin: 0 -8px; background-image: radial-gradient(#D9D4C9 1.2px, transparent 1.2px); background-size: 22px 22px; border-radius: 12px; }
.pz-grid.masonry { display: flex; align-items: flex-start; }
.pz-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.pz-card .note-grip { display: none; }
.pz-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -4px 0 14px; }
.pz-zoom-val { min-width: 54px; text-align: center; font-weight: 600; font-size: 14px; }
.pz-toolbar .btn { height: 36px; padding: 0 12px; font-size: 14px; }
.pz-toolbar .icon-btn { width: 36px; height: 36px; }
.pz-stage { overflow: auto; border-radius: 12px; }
.pz-zoom { zoom: var(--z, 1); }
.pz-card { display: flex; }
.pz-subcount { margin: -4px 6px 2px; font-size: 12.5px; color: var(--muted); }
.pz-tasks { display: flex; flex-direction: column; }
.pz-tasks .task { min-height: 34px; }
.pz-tasks .task-name { font-size: 14px; }
.pz-tasks .task.is-sub .task-name { font-size: 13px; }


/* ---------- Calendario semanal ---------- */
.h1-sub { font-family: var(--sans); font-size: 16px; font-weight: 500; color: var(--muted); margin-left: 8px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: start; }
.week-day { background: var(--card); border: 1px solid var(--line); border-radius: 14px; min-height: 360px; display: flex; flex-direction: column; overflow: hidden; }
.week-day.weekend { background: #FAF9F6; }
.week-day.today { border: 2px solid var(--ink); }
.week-head { display: flex; align-items: baseline; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
.week-dow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.week-num { font-family: var(--serif); font-size: 24px; font-weight: 600; }
.week-day.today .week-num { background: var(--ink); color: #fff; border-radius: 8px; padding: 0 7px; }
.week-head em { margin-left: auto; font-style: normal; font-size: 12px; color: var(--muted); }
.week-list { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.week-item { display: flex; align-items: flex-start; gap: 7px; padding: 7px 8px; border-radius: 10px; background: var(--c-soft); color: var(--c-ink); }
.week-item form { display: contents; }
.week-item .sq { margin-top: 2px; border-color: var(--c-ink); }
.week-item .sq svg { width: 9px; height: 9px; }
.week-body { flex: 1; min-width: 0; border: 0; background: none; padding: 0; text-align: left; color: inherit; display: flex; flex-direction: column; gap: 1px; }
.week-time { font-size: 12px; font-weight: 700; }
.week-title { font-size: 13.5px; line-height: 1.25; overflow-wrap: anywhere; }
.week-title.hl { background: var(--hl); color: var(--ink); border-radius: 3px; padding: 0 3px; align-self: flex-start; }
.week-where { font-size: 11.5px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week-item.done { opacity: .55; }
.week-item.done .week-title { text-decoration: line-through; }
.week-item.overdue { box-shadow: inset 3px 0 0 var(--danger); }
.week-item.overdue .week-time { color: var(--danger); }
.week-empty { color: #C9C3B6; text-align: center; padding: 8px 0; }

/* ---------- Móvil ---------- */
@media (max-width: 860px) {
  .only-mobile { display: flex !important; }
  .only-desktop { display: none !important; }
  .bottom-nav.only-mobile { display: grid !important; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  body.side-open .side { transform: none; }
  body.side-open .side-backdrop { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(28,27,25,.4); }
  .main { padding: 16px 14px 24px; }
  .h1 { font-size: 26px; }
  .page-head { margin-bottom: 14px; }
  .page-head > .h1 { display: none; }
  .note-head .h1 { display: block; font-size: 24px; }
  .filters { width: 100%; }
  .seg { max-width: 100%; overflow-x: auto; }
  .seg a { padding: 0 11px; }

  /* Tablero → lista de notas con sus 3 tareas más relevantes */
  .board { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: 1fr; background-image: none; margin: 0; padding: 0; overflow: visible; gap: 12px; }
  .col { padding: 16px 10px 10px; }
  .col-title { font-size: 21px; }
  .col:not(.pz-card) .m-hide { display: none !important; }
  /* Pizarra en pantalla estrecha: se mantiene como en grande y se usa el zoom (como una foto) */
  .pz-zoom { width: 1000px; }
  .col-tasks { max-height: none; overflow: visible; margin-right: 0; padding-right: 0; box-shadow: none !important; }
  .col-count-more { display: none; }
  .col:not(.pz-card) .task .star, .col:not(.pz-card) .task .menu, .col:not(.pz-card) .task .add-sub { display: none; }
  /* En la pizarra (vista tipo foto) los botones salen al pasar el ratón, igual que en grande */
  .col-new { min-height: 56px; }

  .task { gap: 8px; }
  .task-meta .dates { display: none; }
  .list .task-meta .pill { display: none; }
  .two { grid-template-columns: 1fr 1fr; }
  .cal-layout { grid-template-columns: 1fr; }
  .week { grid-template-columns: 1fr; }
  .week-day { min-height: 0; }
  .week-list { flex-direction: column; }
  .h1-sub { display: block; margin: 4px 0 0; }
  .cal-cell { min-height: 58px; padding: 4px; align-items: center; }
  .cal-chip, .cal-more { display: none; }
  .cal-dots { display: flex; }
  .cal-dow span { padding: 6px 2px; text-align: center; font-size: 11px; }
  .cal-day { position: static; }
  .dialog { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 20px 20px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Historial ---------- */
.linkish { border: 0; background: none; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-decoration-color: #C9C3B6; text-underline-offset: 3px; cursor: pointer; text-align: left; }
.linkish:hover { text-decoration-color: var(--ink); }
.hist-task { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: -6px 0 16px; font-size: 15px; }
.hist-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; margin-bottom: 16px; }
.hist-periods { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.field.sm input, .field.sm select { height: 38px; font-size: 14px; }
.field.sm { width: auto; }
.field.sm.grow { flex: 1; min-width: 180px; }
.hist-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.hist-stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; display: flex; flex-direction: column; text-decoration: none; color: var(--ink); }
.hist-stat strong { font-family: var(--serif); font-size: 30px; line-height: 1.1; }
.hist-stat span { font-size: 13px; color: var(--muted); }
.hist-stat.ok strong { color: var(--ok); }
.hist-stat:hover { border-color: #C9C3B6; }
.hist-tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-bottom: 20px; align-items: start; }
.hist-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; font-size: 14px; }
.hist-table caption { text-align: left; font-weight: 600; font-size: 13px; color: var(--muted); padding: 0 4px 6px; }
.hist-table th { text-align: right; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line); }
.hist-table td { text-align: right; padding: 7px 12px; border-top: 1px solid var(--line-2); font-variant-numeric: tabular-nums; }
.hist-table th:first-child, .hist-table td:first-child { text-align: left; }
.hist-table .note-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 8px; }
.hist-day { margin-bottom: 18px; }
.hist-date { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: none; margin: 0 0 6px 4px; }
.hist-list { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.hist-item { display: flex; align-items: flex-start; gap: 12px; padding: 9px 14px; border-top: 1px solid var(--line-2); }
.hist-item:first-child { border-top: 0; }
.hist-item time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 2px; min-width: 40px; }
.hist-type { flex-shrink: 0; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 9px; background: #F1EEE7; color: var(--ink-2); min-width: 78px; text-align: center; margin-top: 1px; }
.hist-type.t-creada { background: var(--blue-soft); color: var(--blue-ink); }
.hist-type.t-cerrada { background: #DDF1E3; color: var(--ok); }
.hist-type.t-avance, .hist-type.t-parte { background: var(--curso-bg); color: var(--curso); }
.hist-type.t-reabierta, .hist-type.t-eliminada, .hist-type.t-borrada { background: #FDE7E4; color: var(--danger); }
.hist-body { flex: 1; min-width: 0; }
.hist-what { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; font-size: 15px; }
.hist-detail { font-size: 13.5px; color: var(--ink-2); }
.hist-where { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.hist-where .note-dot { width: 8px; height: 8px; border-radius: 3px; }
.hist-pages { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 10px 0 20px; }
/* Historial dentro de la ventana de la tarea */
.task-hist { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.task-hist > summary { cursor: pointer; display: flex; align-items: baseline; gap: 10px; list-style: none; }
.task-hist > summary::-webkit-details-marker { display: none; }
.task-hist > summary::before { content: '▸'; color: var(--muted); font-size: 12px; }
.task-hist[open] > summary::before { content: '▾'; }
.hist-mini { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; max-height: 240px; overflow-y: auto; }
.hist-mini li { display: flex; align-items: baseline; gap: 8px; }
.hist-mini time { color: var(--muted); font-size: 12.5px; white-space: nowrap; min-width: 88px; font-variant-numeric: tabular-nums; }
.hist-mini .hist-type { min-width: 70px; font-size: 11px; }
.task-hist .linkish { font-size: 13.5px; }
@media (max-width: 860px) {
  .hist-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hist-item { flex-wrap: wrap; gap: 6px 10px; }
  .hist-body { flex-basis: 100%; }
  .field.sm { flex: 1 1 140px; }
}

/* ---------- Mover bloques y tareas entre bloques ---------- */
.col-head { position: relative; }
.note-grip { position: absolute; left: -12px; top: 2px; height: 26px; width: 16px; margin: 0; opacity: 0; transition: opacity .15s; }
.col:hover .note-grip, .note-grip:focus { opacity: 1; }
.col.dragging { opacity: .45; outline: 2px dashed var(--c-dot); outline-offset: 2px; }
.tgroup.dragging { opacity: .5; }
.col.drop-target { outline: 2px dashed var(--c-dot); outline-offset: 3px; background: color-mix(in srgb, var(--c-soft) 45%, var(--card)); }
body.drag-root .col .menu, body.drag-root .col .star, body.drag-root .col .add-sub { display: none; }
.move-group { display: flex; flex-direction: column; gap: 6px; }
.move-board { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }
.move-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.move-list form { display: contents; }
.move-note { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--c-soft); color: var(--c-ink); font-size: 14.5px; font-weight: 600; text-align: left; cursor: pointer; }
.move-note .note-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--c-dot); flex-shrink: 0; }
.move-note:hover:not(:disabled) { border-color: var(--c-dot); }
.move-note.is-here { opacity: .55; cursor: default; }
.move-note small { margin-left: auto; font-weight: 500; font-size: 11.5px; white-space: nowrap; padding-left: 6px; }
.seg a .seg-ico { margin-right: 5px; flex-shrink: 0; }

/* ---------- Tarea en negrita, subtarea normal ---------- */
.task:not(.is-sub) .task-name { font-weight: 600; }

/* ---------- Columnas: se ven 3 subtareas; «+N más» despliega el resto (en la pizarra, todo) ---------- */
.col:not(.pz-card) .tgroup.folded > .task.sub-extra { display: none; }
.more-subs { display: block; border: 0; background: none; padding: 2px 0 4px 62px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; text-align: left; }
.more-subs:hover { color: var(--ink); }
.more-subs .ms-less { display: none; }
.tgroup:not(.folded) .more-subs .ms-more { display: none; }
.tgroup:not(.folded) .more-subs .ms-less { display: inline; }
.pz-card .more-subs { display: none; }

/* Fila: [asa] [cuadro] [cuerpo = nombre + (partes, fecha…)] — el cuerpo reparte en 1 o 2 líneas */
.task-body { display: contents; }
.col .task { flex-wrap: nowrap; }
.col .task-body { flex: 1 1 0; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; }
.col .task-title, .col .task.is-sub .task-title { flex: 1 1 auto; min-width: 0; max-width: 100%; }
.col .task.has-parts .task-title { flex-basis: 100%; }
.col .task.has-parts .task-extra { padding-left: 0; }

/* ---------- Columnas y pizarra más compactas: fila de una línea más baja ---------- */
.col .task { min-height: 32px; padding-top: 1px; padding-bottom: 1px; }
.col .task.is-sub { min-height: 28px; }
.col .task-title { padding: 3px 0; }
.col .task .star, .col .task .add-sub, .col .task .menu > summary { width: 26px; height: 26px; }
.col .task .star, .col .task .menu, .col .task .add-sub { top: 3px; }
.col .task.is-sub .star, .col .task.is-sub .menu, .col .task.is-sub .add-sub { top: 1px; }
.col .task .add-sub { right: 62px; }
.col .task .star { right: 34px; }
.pz-tasks .task { min-height: 30px; }
.col-tasks { max-height: 340px; }
@container tablero (max-width: 905px) { .col-tasks { max-height: 150px; } }

/* ---------- Pizarra: elegir un área para imprimir ---------- */
.pz-print-btn { margin-left: auto; }
.pz-printbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; background: var(--blue-soft); color: var(--blue-ink); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; font-size: 14px; }
.pz-printbar[hidden] { display: none; }
.pz-print-count { margin-left: auto; }
.pz-printbar .btn { height: 34px; padding: 0 12px; font-size: 14px; }
body.pz-selecting [data-pz-stage] { cursor: crosshair; user-select: none; }
body.pz-selecting .pz-card { opacity: .55; transition: opacity .1s; }
body.pz-selecting .pz-card.pz-picked { opacity: 1; outline: 3px solid var(--blue); outline-offset: 3px; }
.pz-lasso { position: fixed; z-index: 80; border: 2px dashed var(--blue); background: rgba(47, 91, 214, .08); pointer-events: none; border-radius: 4px; }
.print-head { display: none; }

@media print {
  @page { margin: 12mm; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff; }
  .side, .side-backdrop, .topbar, .bottom-nav, .pz-toolbar, .pz-printbar, #dialog { display: none !important; }
  .only-mobile.only-mobile.only-mobile { display: none !important; }
  .main { padding: 0; }
  body.print-selection .page-head, body.print-selection .pz-stats, body.print-selection .pz-board { display: none !important; }
  body.print-selection .pz-card:not(.pz-picked) { display: none !important; }
  body.print-selection .pz-card { opacity: 1 !important; outline: none !important; }
  body.print-selection .print-head { display: block; font-family: var(--serif); font-size: 18px; font-weight: 600; margin-bottom: 10px; }
  .pz-stage { overflow: visible !important; }
  .pz-zoom { zoom: 1 !important; }
  .pz-grid { background: none; gap: 14px; }
  .pz-col { gap: 12px; }
  .pz-card { box-shadow: inset 0 5px 0 var(--c-dot); break-inside: avoid; }
  .pz-card .quick-add, .pz-card .order-btn, .pz-card .note-grip, .pz-card .drag, .pz-card .star-form, .pz-card .menu, .pz-card .add-sub { display: none !important; }
  .task { min-height: 0 !important; }
}

/* ---------- Móvil: barra de filtros compacta (caben las 5 sin barra de desplazamiento) ---------- */
@media (max-width: 860px) {
  .filters .seg { padding: 3px; gap: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .filters .seg::-webkit-scrollbar { display: none; }
  .filters .seg a { height: 30px; padding: 0 8px; font-size: 13px; border-radius: 8px; }
  .filters .seg a .seg-label { display: none; }
  .filters .seg a .seg-ico { margin-right: 0; width: 15px; height: 15px; }
  .filters .seg .hl-text { padding: 0 3px; }
  .filters .chip-lg { height: 34px; font-size: 13.5px; }
}

/* ---------- Acciones (tercer nivel: tarea → subtarea → acción) ---------- */
/* Pizarra: debajo de su subtarea, más pequeñas y metidas hacia dentro */
.pz-actions { margin: 0 0 4px 46px; padding-left: 4px; border-left: 2px solid color-mix(in srgb, var(--c-ink, #999) 22%, transparent); }
.task.is-sub.is-action { min-height: 30px; padding-left: 6px; }
.task.is-action .sq { width: 15px; height: 15px; border-radius: 3px; }
.task.is-action .sq svg { width: 9px; height: 9px; }
.task.is-action .task-name { font-size: 13px; }
.col .task.is-action .task-title.is-long .task-name { font-size: 12.5px; }
.hide-actions .pz-actions { display: none; }
.pz-actions-toggle { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-size: 14px; cursor: pointer; }
.pz-actions-toggle input { margin: 0; }
/* Contador de acciones de una subtarea (abre su ventana) */
.pill-actions { border: 0; font: inherit; font-size: 12px; color: inherit; cursor: pointer; }
.pill-actions:hover { background: #E6E1D6; color: var(--ink); }
/* Ventana de la subtarea: lista de acciones */
.crumb { align-self: flex-start; margin: -6px 0 2px; }
.actions-box { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 8px; }
.action-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.action-row { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 2px 6px; border-radius: 9px; }
.action-row:hover { background: #F7F5F0; }
.action-row > form { display: contents; }
.action-row .sq { width: 18px; height: 18px; border-radius: 4px; }
.action-row .sq svg { width: 11px; height: 11px; }
.action-title { flex: 1; min-width: 0; border: 0; background: none; padding: 4px 0; text-align: left; cursor: pointer; }
.action-row .task-name { font-size: 14px; }
.action-row.is-important .task-name { background: var(--hl); }
.action-row.is-closed .task-name { color: var(--faint); text-decoration: line-through; }
.action-row .icon-btn { width: 28px; height: 28px; }
.action-row .icon-btn:disabled { opacity: .3; cursor: default; }
.action-add { padding-left: 6px; flex-wrap: wrap; }
.action-add .form-errors { flex-basis: 100%; }
@media print { .hide-actions .pz-actions { display: none !important; } }

/* ---------- Pizarra compacta: el máximo de información en el mínimo espacio ---------- */
.pz-card.col { padding: 12px 8px 6px; gap: 4px; }
.pz-card .col-head { padding: 0 4px; }
.pz-card .bar { margin: 0 4px 2px; }
.pz-subcount { margin: -2px 4px 0; font-size: 12px; }
.pz-tasks .task, .pz-tasks .task.is-sub { min-height: 24px; padding: 1px 4px; gap: 6px; border-radius: 6px; }
.pz-tasks .task-title { padding: 1px 0; }
/* Nombre y datos (%, contador, fecha) en la misma línea: nada baja a una segunda fila */
.pz-tasks .task { flex-wrap: nowrap; }
.pz-tasks .task-title, .pz-tasks .task.is-sub .task-title { max-width: none; flex: 1 1 auto; }
.pz-tasks .task-extra { flex-wrap: nowrap; padding-bottom: 0; gap: 4px 6px; }
.pz-tasks .task-meta { gap: 5px; font-size: 12px; }
.pz-tasks .pill { font-size: 11px; padding: 0 6px; }
.pz-tasks .task-name, .col .pz-tasks .task-title.is-long .task-name { font-size: 13px; line-height: 1.25; }
.pz-tasks .task.is-sub .task-name, .col .pz-tasks .task.is-sub .task-title.is-long .task-name { font-size: 12.5px; }
.pz-tasks .task.is-action .task-name, .col .pz-tasks .task.is-action .task-title.is-long .task-name { font-size: 12px; }
/* Cuadros más pequeños por nivel */
.pz-tasks .task .sq { width: 16px; height: 16px; border-width: 2px; border-radius: 4px; }
.pz-tasks .task .sq svg { width: 10px; height: 10px; }
.pz-tasks .task.is-sub .sq { width: 14px; height: 14px; border-radius: 3px; }
.pz-tasks .task.is-action .sq { width: 12px; height: 12px; border-width: 1.5px; border-radius: 3px; }
.pz-tasks .task.is-sub .sq svg, .pz-tasks .task.is-action .sq svg { width: 8px; height: 8px; }
/* Sangría corta: subtarea 18 px, acción 34 px (con su línea guía) */
.pz-tasks .task.is-sub { padding-left: 20px; }
.pz-actions { margin: 0 0 2px 26px; padding-left: 2px; }
.pz-tasks .task.is-sub.is-action { min-height: 22px; padding-left: 4px; }
/* El asa ⠿ no ocupa sitio: aparece a la izquierda al pasar el ratón */
.pz-tasks .task .drag, .pz-tasks .task.is-sub .drag { position: absolute; left: -8px; top: 50%; transform: translateY(-50%); margin: 0; width: 12px; opacity: 0; }
.pz-tasks .task:hover .drag { opacity: 1; }
.pz-tasks .task.is-sub .drag { left: 6px; }
.pz-tasks .task.is-action .drag { left: -12px; }
/* Botones flotantes (⭐, ⋮, +) a la altura de la fila baja */
.pz-tasks .task .star, .pz-tasks .task .add-sub, .pz-tasks .task .menu > summary { width: 22px; height: 22px; }
.pz-tasks .task .star, .pz-tasks .task .menu, .pz-tasks .task .add-sub,
.pz-tasks .task.is-sub .star, .pz-tasks .task.is-sub .menu, .pz-tasks .task.is-sub .add-sub { top: 50%; margin-top: -11px; }
.pz-tasks .task .star { right: 28px; }
.pz-tasks .task .add-sub { right: 52px; }
.pz-tasks .task .menu { right: 4px; }
.pz-card .quick-add { min-height: 28px; padding: 0 4px; gap: 6px; }
.pz-card .quick-add .sq-ghost { width: 16px; height: 16px; }
.pz-card .quick-add input { font-size: 13px; }
.pz-grid { gap: 12px; }
.pz-col { gap: 12px; }
.pz-tasks .task.has-parts { flex-wrap: wrap; }
/* Títulos de bloque largos (INSTALACIONES…): nunca se meten debajo de los botones; si una palabra no cabe, la letra se reduce (fitTitles en pitagoras.js) */
.col-title { overflow-wrap: normal; hyphens: manual; }
.col-head .order-btn, .col-head .col-count { flex-shrink: 0; }
.pz-card .col-title { font-size: 21px; }
.pz-card .col-head { gap: 6px; align-items: center; }
/* Pizarra: las partes (LR, V…) a la altura de la fila compacta, sin montarse en la de abajo */
.pz-tasks .parts { gap: 3px; align-self: center; }
.pz-tasks .part { height: 18px; padding: 0 5px 0 3px; gap: 3px; border-radius: 9px; font-size: 11px; line-height: 1; }
.pz-tasks .part-box { width: 10px; height: 10px; border-width: 1.5px; border-radius: 2px; }
.pz-tasks .part-box svg { width: 7px; height: 7px; }
.pz-tasks .task.has-parts { align-items: center; padding-top: 1px; padding-bottom: 1px; }
/* Pizarra: al pasar el ratón, las partes se apartan a la izquierda para dejar sitio a ⭐ y ⋮ (no quedan tapadas) */
.pz-tasks .task.has-parts:hover .task-extra, .pz-tasks .task.has-parts:focus-within .task-extra { padding-right: 54px; }

/* ---------- Etiquetas ---------- */
/* Columnas y pizarra: puntitos de color (el nombre al pasar el ratón) */
.tag-dots { display: inline-flex; gap: 3px; align-items: center; flex-shrink: 0; }
.tag-dots i { width: 8px; height: 8px; border-radius: 50%; display: block; }
/* Nota, listas: el nombre en una pastilla del color de la etiqueta */
.tag-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.tag-chip { font-size: 11.5px; font-weight: 600; line-height: 1; padding: 3px 7px; border-radius: 9px; background: var(--c-soft); color: var(--c-ink); white-space: nowrap; }
/* Ventana de la tarea: elegir etiquetas */
.tag-pick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag-opt { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px 0 9px; border-radius: 15px; border: 1px solid var(--c-soft); background: #fff; color: var(--c-ink); font-size: 13px; font-weight: 600; cursor: pointer; user-select: none; }
.tag-opt input { position: absolute; opacity: 0; pointer-events: none; }
.tag-opt i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--c-dot); }
.tag-opt:has(input:checked) { background: var(--c-soft); border-color: var(--c-dot); }
.tag-opt:has(input:checked) i { background: var(--c-dot); }
.tag-opt:has(input:focus-visible) { outline: 2px solid var(--c-dot); outline-offset: 2px; }
.tag-new { height: 30px; border: 1px dashed #D0CBBF; border-radius: 15px; padding: 0 12px; font-size: 13px; min-width: 150px; flex: 1 1 150px; max-width: 240px; background: #fff; }
/* Ajustes: lista de etiquetas */
.tag-admin { display: flex; flex-direction: column; gap: 8px; }
.tag-admin-row { display: flex; align-items: center; gap: 6px; }
.tag-admin-row > form[data-confirm] { display: contents; }
.tag-admin-form { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; flex: 1; min-width: 0; }
.tag-admin-form input[type=text] { flex: 1 1 180px; min-width: 0; height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid #D0CBBF; font-size: 14px; }
.tag-admin-form .form-errors { flex-basis: 100%; }
.tag-color { height: 36px; border-radius: 10px; border: 1px solid var(--c-dot); background: var(--c-soft); color: var(--c-ink); font-weight: 600; padding: 0 8px; }
.tag-admin-new { margin-top: 6px; }
.small { font-size: 12.5px; }
/* Menú lateral: panel plegable (Colores) */
details.side-fold > summary { cursor: pointer; list-style: none; }
details.side-fold > summary::-webkit-details-marker { display: none; }
details.side-fold > summary::before { content: '▸'; margin-right: 6px; font-size: 10px; transition: transform .15s; display: inline-block; }
details.side-fold[open] > summary::before { transform: rotate(90deg); }
details.side-fold > summary { justify-content: flex-start; }
details.side-fold > summary a { margin-left: auto; }

/* ---------- Clave (texto libre para búsquedas, p. ej. CARP:07.2) ---------- */
.task-code { align-self: flex-start; font-family: Consolas, "Cascadia Mono", monospace; font-size: 11.5px; color: var(--ink-2); background: #F1EEE7; padding: 1px 6px; border-radius: 5px; }
.code-input { font-family: Consolas, "Cascadia Mono", monospace; letter-spacing: .02em; }

/* Pizarra: «Mostrar clave» / «Mostrar notas» (apagados por defecto; también se imprimen) */
.pz-x { display: none; }
body.pz-show-clave .pz-tasks .pz-x-code { display: inline-block; font-size: 10.5px; padding: 0 5px; margin-top: 1px; }
body.pz-show-notas .pz-tasks .pz-x-notes { display: block; font-size: 11.5px; line-height: 1.35; color: var(--muted); white-space: pre-line; margin: 1px 0 2px; }
body.pz-show-notas .pz-tasks .task, body.pz-show-clave .pz-tasks .task { align-items: flex-start; }
body.pz-show-notas .pz-tasks .task .sq, body.pz-show-clave .pz-tasks .task .sq { margin-top: 3px; }
/* Con notas o clave a la vista, el nombre no se recorta */
body.pz-show-notas .pz-tasks .task-name, body.pz-show-clave .pz-tasks .task-name { -webkit-line-clamp: unset; line-clamp: unset; display: block; }

/* ---------- Pizarra impresa: letra más grande que en pantalla (el papel no tiene zoom) ---------- */
@media print {
  .pz-card .col-title { font-size: 24px !important; }
  .pz-subcount { font-size: 13px; }
  .pz-tasks .task, .pz-tasks .task.is-sub { padding-top: 2px; padding-bottom: 2px; gap: 8px; }
  body .pz-tasks .task-name, body .col .pz-tasks .task-title.is-long .task-name { font-size: 15.5px; line-height: 1.3; }
  body .pz-tasks .task.is-sub .task-name, body .col .pz-tasks .task.is-sub .task-title.is-long .task-name { font-size: 14.5px; }
  body .pz-tasks .task.is-action .task-name, body .col .pz-tasks .task.is-action .task-title.is-long .task-name { font-size: 14px; }
  body.pz-show-notas .pz-tasks .pz-x-notes { font-size: 13px; line-height: 1.4; }
  body.pz-show-clave .pz-tasks .pz-x-code { font-size: 12px; }
  .pz-tasks .task-meta { font-size: 13px; }
  .pz-tasks .pill, .pz-tasks .part { font-size: 12px; }
  .pz-tasks .task .sq { width: 18px; height: 18px; }
  .pz-tasks .task.is-sub .sq { width: 16px; height: 16px; }
  .pz-tasks .task.is-action .sq { width: 14px; height: 14px; }
  .pz-tasks .avatar { width: 24px; height: 24px; font-size: 10px; }
}
@media print {
  /* Un bloque más largo que una hoja sigue en la siguiente (antes saltaba entero y dejaba la primera en blanco);
     lo que no se parte es cada fila */
  .pz-card, .pz-col, .pz-grid.masonry { break-inside: auto !important; }
  .pz-tasks .task, .pz-card .col-head { break-inside: avoid; }
  .pz-card .col-head { break-after: avoid; }
}
@media print {
  /* Texto corrido a dos columnas (como en Word): los bloques seguidos, partiéndose entre columnas y hojas */
  .pz-grid.print-flow { display: block !important; column-count: 2; column-gap: 14px; padding: 0; margin: 0; }
  .pz-grid.print-flow > .pz-card { display: block; width: 100%; margin: 0 0 12px; break-inside: auto !important; }
  .pz-grid.print-flow > .pz-card > * + * { margin-top: 4px; }
  .pz-grid.print-flow .pz-tasks { display: block; }
  .pz-grid.print-flow .tgroup > .task, .pz-grid.print-flow .pz-actions > .task { break-inside: avoid; }
}

/* Pizarra: los datos de la fila (quién gestiona, 0/12, %, fecha) siempre a la derecha del NOMBRE,
   también con «Mostrar notas/clave»: así no quedan sueltos entre una tarea y la siguiente */
.pz-tasks .task:not(.has-parts) .task-body { flex-wrap: nowrap; align-items: flex-start; }
.pz-tasks .task:not(.has-parts) .task-title { flex: 1 1 0; min-width: 0; }
.pz-tasks .task:not(.has-parts) .task-extra { flex: 0 0 auto; margin-left: 8px; padding-top: 1px; }

/* Pizarra: que se vea dónde empieza cada tarea principal (en pantalla y en papel)
   - su cuadro, en el color del bloque (subtareas y acciones siguen en negro)
   - una línea fina del color del bloque entre una tarea y la siguiente */
.pz-tasks .tgroup > .task:not(.is-sub) .sq { border-color: var(--c-dot); background: linear-gradient(to top right, var(--c-dot) calc(var(--p) * 1%), #fff calc(var(--p) * 1%)); }
.pz-tasks .tgroup + .tgroup { border-top: 1.5px solid color-mix(in srgb, var(--c-dot) 40%, transparent); margin-top: 3px; padding-top: 3px; }
/* Con «Mostrar notas/clave»: 1.ª línea = nombre + datos a la derecha; debajo, clave y notas a todo el ancho */
body.pz-show-notas .pz-tasks .task:not(.has-parts) .task-body,
body.pz-show-clave .pz-tasks .task:not(.has-parts) .task-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; align-items: start; }
body.pz-show-notas .pz-tasks .task:not(.has-parts) .task-title,
body.pz-show-clave .pz-tasks .task:not(.has-parts) .task-title { display: contents; }
body.pz-show-notas .pz-tasks .task:not(.has-parts) .task-name,
body.pz-show-clave .pz-tasks .task:not(.has-parts) .task-name { grid-column: 1; grid-row: 1; justify-self: start; cursor: pointer; }
body.pz-show-notas .pz-tasks .task:not(.has-parts) .task-extra,
body.pz-show-clave .pz-tasks .task:not(.has-parts) .task-extra { grid-column: 2; grid-row: 1; margin-left: 0; }
body.pz-show-notas .pz-tasks .pz-x, body.pz-show-clave .pz-tasks .pz-x { grid-column: 1 / -1; justify-self: start; cursor: pointer; }

/* ---------- Nota rápida, bandeja de entrada, Responder a y link ---------- */
.btn-quick { height: 34px; padding: 0 12px; font-size: 14px; gap: 6px; border-color: #E9A867; background: #FFF0DD; color: #7A4A12; }
.btn-quick:hover { background: #FFE3C2; color: #5C360A; }
.btn-quick svg { color: #E07A2E; }
@media (max-width: 860px) { .btn-quick span { display: none; } .btn-quick { width: 34px; padding: 0; } }

.col-inbox { border: 2px dashed var(--c-dot); box-shadow: none; background: color-mix(in srgb, var(--c-soft) 35%, var(--card)); }
.inbox-ico { display: inline-grid; place-items: center; width: 22px; height: 22px; color: var(--c-ink); flex-shrink: 0; align-self: center; }
.inbox-ico svg { width: 18px; height: 18px; }
.col.drop-target.col-inbox { outline: none; }

.avatar-reply { border-style: dashed; border-radius: 6px; }
.reply-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 6px; background: var(--c-soft); color: var(--c-ink); white-space: nowrap; }
.link-ico { color: var(--blue-ink, var(--blue)); text-decoration: none; padding: 2px; border-radius: 4px; }
.link-ico:hover { background: var(--blue-soft); }
.link-field { display: flex; gap: 8px; }
.link-field input { flex: 1; }
.link-field .btn { height: 42px; }

.dropzone-inline { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 58px; border: 2px dashed #C9C3B6; border-radius: 12px; color: var(--muted); font-size: 14px; cursor: pointer; text-align: center; padding: 8px; font-weight: 400 !important; }
.dropzone-inline:hover, .dropzone-inline.over { border-color: var(--blue); color: var(--blue-ink); background: var(--blue-soft); }
.dropzone-inline input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.pending-files li .file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.pending-thumb { width: 44px; height: 34px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); flex-shrink: 0; }

/* Tiempo estimado de intervención */
.estimate-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.estimate-pick label { display: block; cursor: pointer; }
.estimate-pick input { position: absolute; opacity: 0; pointer-events: none; }
.estimate-pick span { display: flex; align-items: center; justify-content: center; gap: 6px; height: 40px; border-radius: 10px; border: 1px solid #D0CBBF; background: #fff; font-size: 15px; }
.estimate-pick input:checked + span { border: 2px solid var(--ink); font-weight: 600; }
.estimate-pick input:checked + span::before { content: "✓"; font-size: 12px; }
.estimate-pick input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.btn-full { color: var(--blue); order: -1; margin-right: auto; }

/* «A seguimiento», debajo de «Importante» */
.head-checks { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.follow-toggle input { accent-color: var(--blue); }
.chip-clear { color: #B3261E; border-color: #E8B4AE; }
.chip-clear:hover { color: #8C1D17; border-color: #B3261E; }

/* Ajustes → Importar copia */
.import-form { display: grid; gap: 10px; margin-top: 8px; }
.account-form { display: grid; gap: 10px; margin-top: 8px; max-width: 420px; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }

/* En local (tu ordenador), todo lo de la marca en rojo para no confundirlo con la web */
.env-local { border-top: 4px solid var(--danger); }
.env-local .brand-mark { background: var(--danger); }
.env-local .brand-name { color: var(--danger); }
.env-tag { display: block; font-family: var(--sans, inherit); font-size: 10px; font-weight: 700; letter-spacing: .14em; line-height: 1; margin-top: 2px; }
.env-local .login h1 { color: var(--danger); }
.env-local .side .btn-dark, .env-local .login button[type=submit] { background: var(--danger); border-color: var(--danger); }
.env-local .side .btn-dark:hover, .env-local .login button[type=submit]:hover { background: #8F1C13; }
