/* =====================================================================
   Incidencias · NAAR IA  —  hoja de estilos «Volt»
   Grafito sereno, una sola chispa de color (volt) y el color reservado
   para lo que significa algo: estado, prioridad y proyecto.
   Tipografía Geist / Geist Mono (SIL OFL, autoalojada en /fonts).
   ===================================================================== */

@font-face {
  font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/geist-latin-wght-normal.woff2") format("woff2-variations"), url("fonts/geist-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/geist-latin-ext-wght-normal.woff2") format("woff2-variations"), url("fonts/geist-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist Mono"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/geist-mono-latin-wght-normal.woff2") format("woff2-variations"), url("fonts/geist-mono-latin-wght-normal.woff2") format("woff2");
}

/* ------------------------------------------------------------ tokens */

:root {
  color-scheme: light;
  --font: "Geist", "Segoe UI Variable Text", "Segoe UI", -apple-system, system-ui, sans-serif;
  --font-display: "Geist", "Segoe UI Variable Display", "Segoe UI", -apple-system, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* superficies */
  --window: #ffffff;
  --canvas-2: #f6f6f7;
  --alt: #f6f6f7;
  --row-alt: #fafafa;
  --card: #ffffff;
  --elevated: #ffffff;
  --mail-paper: #ffffff;
  --control: #ffffff;
  --stage: #f1f1f3;
  --stage-dot: rgba(17, 18, 22, 0.075);

  /* tinta */
  --ink: #111216;
  --ink-2: #3b3e45;
  --muted: #676b73;
  --faint: #a2a5ac;

  /* líneas y rellenos */
  --sep: #ebebee;
  --sep-strong: #dcdce1;
  --hover: rgba(17, 18, 22, 0.04);
  --selected: rgba(17, 18, 22, 0.07);
  --fill: rgba(17, 18, 22, 0.05);
  --fill-2: rgba(17, 18, 22, 0.09);

  /* chispa: volt */
  --volt: #c8f031;
  --volt-ink: #151a02;
  --accent: #4f6d00;            /* texto y anillos sobre claro (contraste AA) */
  --accent-soft: rgba(150, 196, 0, 0.16);
  --primary: #111216;           /* botón principal: tinta */
  --primary-hover: #2a2c32;
  --on-primary: #ffffff;

  /* compatibilidad con nombres anteriores */
  --blue: var(--accent);
  --blue-press: var(--primary-hover);
  --blue-soft: var(--accent-soft);
  --on-blue: #ffffff;

  --red: #e5484d;
  --red-text: #c62a2f;
  --red-soft: rgba(229, 72, 77, 0.1);
  --orange-text: #c2560b;
  --yellow-text: #8f6a00;
  --prio-muy_alta-bg: rgba(229, 72, 77, 0.12);
  --prio-alta-bg: rgba(247, 107, 21, 0.13);
  --prio-media-bg: rgba(17, 18, 22, 0.06);

  /* estados: forma + color + nombre */
  --st-pendiente: #8b8f98;
  --st-en_curso: #e3a008;
  --st-revision: #3d6ff2;
  --st-cerrado: #1d9a5f;
  --st-descartado: #b4b7bd;

  /* barra lateral: grafito en ambos temas */
  --sb-bg: #0f1013;
  --sb-bg-2: #16171b;
  --sb-ink: #ecedef;
  --sb-ink-2: #b9bcc3;
  --sb-muted: #7f838c;
  --sb-hover: rgba(255, 255, 255, 0.055);
  --sb-active: rgba(255, 255, 255, 0.085);
  --sb-line: rgba(255, 255, 255, 0.07);

  /* profundidad (sombras teñidas, nunca negro puro) */
  --shadow-1: 0 1px 2px rgba(17, 18, 30, 0.06);
  --shadow-2: 0 1px 2px rgba(17, 18, 30, 0.05), 0 6px 16px -4px rgba(17, 18, 30, 0.1);
  --shadow-3: 0 28px 70px -18px rgba(17, 18, 30, 0.35), 0 0 0 1px rgba(17, 18, 30, 0.06);
  --ring: 0 0 0 1px var(--sep);
  --backdrop: rgba(12, 13, 18, 0.38);
  --hud: rgba(17, 18, 22, 0.94);

  /* movimiento */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.55, 0, 1, 0.45);
  --spring: linear(0, 0.0284, 0.1025 3.2%, 0.3706 8.4%, 0.7023 14.5%, 0.8689 18.6%, 0.9721 23.1%, 1.0303 27.9%, 1.0492 31.2%, 1.0547 34.9%, 1.0468 41.4%, 1.0122 55.5%, 0.998 68.2%, 0.9985 84.6%, 1);
  --d1: 120ms;
  --d2: 200ms;
  --d3: 340ms;

  /* forma: controles 8, tarjetas 12, hojas 16, chips píldora */
  --r-ctl: 8px;
  --r-card: 12px;
  --r-sheet: 16px;

  --sidebar-w: 248px;
  --bar-h: 56px;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 12'%3E%3Cpath d='M1 4.5 4.5 1 8 4.5M1 7.5 4.5 11 8 7.5' fill='none' stroke='%23676b73' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --window: #111215; --canvas-2: #16171b; --alt: #17181c; --row-alt: #141518; --card: #1a1b20; --elevated: #1c1d22;
    --mail-paper: #111215; --control: #1f2025; --stage: #0c0d10; --stage-dot: rgba(255, 255, 255, 0.06);
    --ink: #ededf0; --ink-2: #c5c7cd; --muted: #8f939b; --faint: #5e6168;
    --sep: #24252b; --sep-strong: #30323a;
    --hover: rgba(255, 255, 255, 0.045); --selected: rgba(255, 255, 255, 0.08); --fill: rgba(255, 255, 255, 0.06); --fill-2: rgba(255, 255, 255, 0.1);
    --accent: #c8f031; --accent-soft: rgba(200, 240, 49, 0.14);
    --primary: #ededf0; --primary-hover: #ffffff; --on-primary: #0f1013; --on-blue: #0f1013;
    --red: #ff5a5f; --red-text: #ff7b7f; --red-soft: rgba(255, 90, 95, 0.14); --orange-text: #ff9a52; --yellow-text: #f0c24b;
    --prio-muy_alta-bg: rgba(255, 90, 95, 0.16); --prio-alta-bg: rgba(255, 140, 60, 0.15); --prio-media-bg: rgba(255, 255, 255, 0.07);
    --st-pendiente: #8f939b; --st-en_curso: #f0b429; --st-revision: #6b93ff; --st-cerrado: #3cc485; --st-descartado: #5c5f66;
    --sb-bg: #0a0b0d; --sb-bg-2: #111215; --sb-line: rgba(255, 255, 255, 0.06);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 20px -6px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    --shadow-3: 0 30px 80px -16px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.07);
    --backdrop: rgba(0, 0, 0, 0.6); --hud: rgba(34, 35, 41, 0.96);
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 12'%3E%3Cpath d='M1 4.5 4.5 1 8 4.5M1 7.5 4.5 11 8 7.5' fill='none' stroke='%238f939b' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --window: #111215; --canvas-2: #16171b; --alt: #17181c; --row-alt: #141518; --card: #1a1b20; --elevated: #1c1d22;
  --mail-paper: #111215; --control: #1f2025; --stage: #0c0d10; --stage-dot: rgba(255, 255, 255, 0.06);
  --ink: #ededf0; --ink-2: #c5c7cd; --muted: #8f939b; --faint: #5e6168;
  --sep: #24252b; --sep-strong: #30323a;
  --hover: rgba(255, 255, 255, 0.045); --selected: rgba(255, 255, 255, 0.08); --fill: rgba(255, 255, 255, 0.06); --fill-2: rgba(255, 255, 255, 0.1);
  --accent: #c8f031; --accent-soft: rgba(200, 240, 49, 0.14);
  --primary: #ededf0; --primary-hover: #ffffff; --on-primary: #0f1013; --on-blue: #0f1013;
  --red: #ff5a5f; --red-text: #ff7b7f; --red-soft: rgba(255, 90, 95, 0.14); --orange-text: #ff9a52; --yellow-text: #f0c24b;
  --prio-muy_alta-bg: rgba(255, 90, 95, 0.16); --prio-alta-bg: rgba(255, 140, 60, 0.15); --prio-media-bg: rgba(255, 255, 255, 0.07);
  --st-pendiente: #8f939b; --st-en_curso: #f0b429; --st-revision: #6b93ff; --st-cerrado: #3cc485; --st-descartado: #5c5f66;
  --sb-bg: #0a0b0d; --sb-bg-2: #111215; --sb-line: rgba(255, 255, 255, 0.06);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 20px -6px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  --shadow-3: 0 30px 80px -16px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.07);
  --backdrop: rgba(0, 0, 0, 0.6); --hud: rgba(34, 35, 41, 0.96);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 12'%3E%3Cpath d='M1 4.5 4.5 1 8 4.5M1 7.5 4.5 11 8 7.5' fill='none' stroke='%238f939b' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 400 14px/1.45 var(--font);
  font-feature-settings: "ss01", "cv11";
  letter-spacing: -0.006em;
  color: var(--ink);
  background: var(--window);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, figure { margin: 0; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--volt) 55%, transparent); color: var(--volt-ink); }

.svg { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: -3px; }
.svg-lg { width: 20px; height: 20px; }
.mono, .ref, kbd { font-family: var(--mono); font-feature-settings: normal; letter-spacing: 0; }
.num, .mono, .ref, kbd { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.boot { height: 100dvh; display: grid; place-items: center; background: var(--sb-bg); }
.boot .spinner { border-color: rgba(255, 255, 255, 0.12); border-top-color: var(--volt); }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--fill-2); border-top-color: var(--ink-2);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ controles */

.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 14px; border-radius: var(--r-ctl);
  border: 1px solid var(--sep-strong); background: var(--control); color: var(--ink);
  font-weight: 520; white-space: nowrap; box-shadow: var(--shadow-1);
  transition: background var(--d1), border-color var(--d1), transform var(--d2) var(--spring), box-shadow var(--d2);
}
.btn:hover { background: color-mix(in srgb, var(--control) 92%, var(--ink)); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn .svg { width: 15px; height: 15px; }
.btn.primary { background: var(--primary); border-color: transparent; color: var(--on-primary); box-shadow: 0 1px 2px rgba(17, 18, 30, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.volt { background: var(--volt); border-color: transparent; color: var(--volt-ink); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.btn.volt:hover { background: #d6f85a; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--hover); color: var(--ink); }
.btn.danger { background: var(--red); border-color: transparent; color: #fff; }
.btn.danger:hover { background: color-mix(in srgb, var(--red) 88%, #000); }
.btn.sm { height: 28px; padding: 0 11px; font-size: 13px; border-radius: 7px; }
.btn.block { width: 100%; }
.btn kbd { margin-left: 2px; }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--on-primary) transparent var(--on-primary) var(--on-primary); animation: spin 0.6s linear infinite;
}

.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-ctl);
  border: 0; background: transparent; color: var(--muted);
  transition: background var(--d1), color var(--d1), transform var(--d2) var(--spring);
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn:active { transform: scale(0.9); }
.icon-btn.danger:hover { color: var(--red); background: var(--red-soft); }

kbd {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 5px; background: var(--fill); box-shadow: inset 0 -1px 0 var(--fill-2);
  font: 500 11px var(--mono); color: var(--muted);
}

.segmented { position: relative; display: inline-flex; padding: 3px; border-radius: 10px; background: var(--fill); gap: 2px; }
.segmented button, .segmented a {
  position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 28px; min-width: 34px; padding: 0 12px; border: 0; border-radius: 7px;
  background: transparent; color: var(--muted); font-size: 13px; font-weight: 520; white-space: nowrap;
  transition: color var(--d1), background var(--d1);
}
.segmented button:hover, .segmented a:hover { color: var(--ink); }
.segmented .on, .segmented .on:hover {
  color: var(--ink); background: var(--control);
  box-shadow: 0 1px 2px rgba(17, 18, 30, 0.1), 0 0 0 1px rgba(17, 18, 30, 0.04);
}
.segmented .n { color: var(--muted); font-weight: 400; }
.segmented.icons button { padding: 0 9px; }
.segmented.icons .svg { width: 16px; height: 16px; }

/* ------------------------------------------------------------ formularios */

.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field > span { font-size: 13px; font-weight: 560; color: var(--ink-2); }
.field small { color: var(--muted); font-size: 12px; font-weight: 400; }
.input, .select, .textarea {
  width: 100%; min-height: 38px; padding: 7px 11px; border-radius: var(--r-ctl);
  border: 1px solid var(--sep-strong); background: var(--control); color: var(--ink);
  transition: border-color var(--d1), box-shadow var(--d2);
}
.textarea { resize: vertical; min-height: 96px; line-height: 1.55; padding: 9px 11px; }
.input:hover, .select:hover, .textarea:hover { border-color: color-mix(in srgb, var(--sep-strong) 60%, var(--ink)); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.select { appearance: none; padding-right: 30px; cursor: pointer; background: var(--control) var(--chevron) no-repeat right 11px center / 9px 12px; }
.select.sm { min-height: 28px; }
.form-grid { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.form-error {
  display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-ctl);
  background: var(--red-soft); color: var(--red-text); font-size: 13px; font-weight: 500;
  animation: shake 0.36s var(--ease);
}
@keyframes shake { 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-2px); } 80% { transform: translateX(2px); } }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--ink); }
/* Casilla con título y explicación debajo */
.check.stacked { align-items: flex-start; }
.check.stacked input { margin-top: 2px; flex: none; }
.check.stacked > span { display: grid; gap: 2px; }
.check.stacked small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.check.stacked small a { color: var(--accent); text-decoration: underline; }
.check.stacked input:disabled + span b { color: var(--muted); }
.check.stacked:has(input:disabled) { cursor: default; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 20px; }

/* Guía de prioridad para los usuarios: lo que hay por hacer en el departamento y el aviso de «Muy alta» */
.prio-guide { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: 4px; padding: 12px 14px; border-radius: var(--r-card); background: var(--canvas-2); box-shadow: inset 0 0 0 1px var(--sep); font-size: 13px; }
.pg-head { margin-bottom: 4px; font-size: 12.5px; font-weight: 560; color: var(--ink-2); }
.pg-row {
  display: grid; grid-template-columns: 70px minmax(40px, 1fr) 24px minmax(0, 2fr); align-items: center; gap: 12px;
  margin: 0 -6px; padding: 3px 6px; border-radius: 6px; color: var(--muted); transition: background var(--d1);
}
.pg-row.on { background: var(--fill); color: var(--ink-2); }
.pg-row.on .pg-label { font-weight: 640; }
.pg-label { color: var(--ink-2); }
.pg-bar { height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.pg-bar i { display: block; height: 100%; border-radius: inherit; background: var(--pc); transform-origin: left; animation: grow-x 0.6s var(--ease) both; }
.pg-n { text-align: right; font: 600 12.5px var(--mono); color: var(--ink-2); }
.pg-muy_alta { --pc: var(--red); }
.pg-alta { --pc: var(--orange-text); }
.pg-media { --pc: var(--st-en_curso); }
.pg-baja { --pc: var(--faint); }
/* Aviso al crear un proyecto desde el rol de usuario */
.project-disclaimer { display: grid; gap: 8px; padding: 12px 14px; border-radius: 10px; background: var(--fill); font-size: 13px; line-height: 1.5; }
.project-disclaimer ul { display: grid; gap: 4px; margin: 0; padding-left: 18px; color: var(--ink-2); }
.project-disclaimer .check { margin-top: 2px; font-weight: 500; }
.pg-warn { margin-top: 8px; padding: 12px 14px; border-radius: 10px; background: var(--red-soft); color: var(--ink); animation: rise var(--d3) var(--ease) both; }
.pg-warn p { margin: 0 0 10px; line-height: 1.5; }
.pg-warn p b { color: var(--red-text); }
.pg-warn ul { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; margin: 0; padding: 0; list-style: none; }
.pg-warn li { display: flex; align-items: center; gap: 10px; min-height: 28px; }
.pg-warn .ref { flex: none; color: var(--muted); font-size: 12px; }
.pg-warn .tt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-warn .who { flex: none; color: var(--muted); }
.pg-warn .prio-pick { flex: none; width: auto; min-height: 28px; height: 28px; padding: 0 26px 0 9px; font-size: 12.5px; }
@media (max-width: 560px) {
  .pg-row { grid-template-columns: 64px 1fr 24px; row-gap: 0; }
  .pg-hint { grid-column: 1 / -1; font-size: 12px; }
}

/* ------------------------------------------------------------ marca */

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark { width: 30px; height: 30px; flex: none; display: grid; place-items: center; }
.brand-mark svg { width: 100%; height: 100%; display: block; overflow: visible; }
.brand-mark .bm-tile { fill: var(--volt); }
.brand-mark .bm-glyph { fill: none; stroke: var(--volt-ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark .bm-spark { fill: var(--volt-ink); transform-origin: 22px 10px; animation: spark 5s var(--ease) 1.2s infinite; }
@keyframes spark { 0%, 88%, 100% { transform: scale(1); } 92% { transform: scale(1.6); } 96% { transform: scale(0.9); } }
.brand-name { display: flex; flex-direction: column; font: 640 14.5px/1.15 var(--font-display); letter-spacing: -0.02em; }
.brand-sub { font: 500 10.5px var(--mono); color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 2px; }

/* ------------------------------------------------------------ acceso */

.auth {
  position: relative; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.9fr);
  background: var(--sb-bg); color: var(--sb-ink); overflow: hidden;
}
.auth-art {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 44px 48px; min-width: 0;
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.07) 1px, transparent 0) 0 0 / 22px 22px,
    radial-gradient(120% 90% at 0% 100%, rgba(200, 240, 49, 0.12), transparent 55%),
    var(--sb-bg);
  border-right: 1px solid var(--sb-line);
}
.auth-art .brand-name { color: var(--sb-ink); }
.auth-art .brand-sub { color: var(--sb-muted); }
.auth-poster { font: 680 clamp(44px, 6.4vw, 92px)/0.95 var(--font-display); letter-spacing: -0.055em; color: var(--sb-ink); }
.auth-poster em { font-style: normal; color: var(--volt); }
.auth-poster span { display: block; overflow: hidden; padding-bottom: 0.06em; }
.auth-poster span > i { display: block; font-style: normal; animation: line-up 0.9s var(--ease) both; }
.auth-poster span:nth-child(2) > i { animation-delay: 0.08s; }
.auth-poster span:nth-child(3) > i { animation-delay: 0.16s; }
@keyframes line-up { from { transform: translateY(105%); } }
.auth-foot { display: flex; gap: 22px; color: var(--sb-muted); font-size: 13px; }
.auth-foot b { color: var(--sb-ink-2); font-weight: 560; }
.auth-side { display: grid; place-items: center; padding: 32px; background: var(--window); color: var(--ink); }
.auth-card {
  width: 100%; max-width: 360px; padding: 0; text-align: left; background: transparent;
  animation: rise 0.6s var(--ease) 0.15s both;
}
.auth-card > .brand { display: none; }
.auth-card h1 { font: 660 26px/1.15 var(--font-display); letter-spacing: -0.035em; }
.auth-card p.lead { color: var(--muted); margin: 8px 0 26px; }
.auth-card .form-grid { text-align: left; gap: 14px; }
.auth-card .btn { width: 100%; height: 42px; margin-top: 6px; font-size: 14.5px; }
.auth-card .remember { font-size: 13px; color: var(--ink-2); }
.auth-card .btn .svg { transition: transform var(--d2) var(--spring); }
.auth-card .btn:hover .svg { transform: translateX(3px); }
/* tarjetas sueltas (sin conexión, sin configurar) */
.auth.solo { grid-template-columns: 1fr; place-items: center; padding: 24px; }
.auth.solo .auth-card { max-width: 400px; padding: 32px 30px 28px; background: var(--sb-bg-2); border-radius: var(--r-sheet); box-shadow: 0 0 0 1px var(--sb-line), 0 40px 90px -30px rgba(0, 0, 0, 0.8); color: var(--sb-ink); }
.auth.solo .auth-card > .brand { display: flex; margin-bottom: 22px; }
.auth.solo .auth-card .brand-sub, .auth.solo .auth-card p.lead, .auth.solo .auth-card .muted { color: var(--sb-muted); }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 28px 24px 30px; border-right: 0; border-bottom: 1px solid var(--sb-line); gap: 36px; }
  .auth-poster { font-size: 48px; }
  .auth-foot { display: none; }
  .auth-side { align-items: start; padding: 32px 24px 48px; }
}

/* ------------------------------------------------------------ ventana */

.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); height: 100dvh; background: var(--sb-bg); }

.sidebar {
  display: flex; flex-direction: column; min-height: 0; padding: 14px 12px 12px;
  background: var(--sb-bg); color: var(--sb-ink);
  --hover: var(--sb-hover); --muted: var(--sb-muted); --ink: var(--sb-ink); --fill: rgba(255, 255, 255, 0.07);
}
.sidebar > .brand { padding: 4px 6px 16px; }
.side-top { display: flex; align-items: center; gap: 8px; padding: 2px 4px 16px 6px; }
.side-top .brand { flex: 1; }
.side-top .brand-sub { color: var(--sb-muted); }
.side-top .icon-btn { color: var(--sb-muted); }
.side-top .icon-btn:hover { color: var(--sb-ink); background: var(--sb-hover); }
.side-head { display: none; }

.cmd-trigger {
  display: flex; align-items: center; gap: 9px; width: 100%; height: 36px; margin-bottom: 8px; padding: 0 8px 0 11px;
  border: 0; border-radius: var(--r-ctl); background: var(--sb-bg-2); color: var(--sb-muted);
  box-shadow: inset 0 0 0 1px var(--sb-line); text-align: left; font-size: 13.5px;
  transition: background var(--d1), color var(--d1), box-shadow var(--d1);
}
.cmd-trigger:hover { color: var(--sb-ink-2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); }
.cmd-trigger span { flex: 1; }
.cmd-trigger kbd { background: rgba(255, 255, 255, 0.07); box-shadow: none; color: var(--sb-muted); }

.new-btn {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; height: 38px; margin: 0 0 6px;
  border: 0; border-radius: var(--r-ctl); background: var(--volt); color: var(--volt-ink); font-weight: 640; font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 1px 0 rgba(0, 0, 0, 0.25), 0 8px 24px -10px rgba(200, 240, 49, 0.55);
  overflow: hidden; isolation: isolate;
  transition: transform var(--d2) var(--spring), box-shadow var(--d2), filter var(--d1);
}
.new-btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform 0.7s var(--ease);
}
.new-btn:hover::before { transform: translateX(120%); }
.new-btn:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 1px 0 rgba(0, 0, 0, 0.25), 0 12px 30px -10px rgba(200, 240, 49, 0.7); }
.new-btn:active { transform: scale(0.97); }
.new-btn .svg { width: 16px; height: 16px; stroke-width: 2.4; transition: transform var(--d3) var(--spring); }
.new-btn:hover .svg { transform: rotate(90deg); }
.new-btn kbd { position: absolute; right: 8px; background: rgba(21, 26, 2, 0.12); box-shadow: none; color: rgba(21, 26, 2, 0.6); }

.nav { display: grid; gap: 1px; align-content: start; }
.nav-title {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 10px 6px; font: 600 12px var(--font); letter-spacing: 0; color: var(--muted);
}
.nav-link { border: 0; background: none; padding: 0; color: var(--sb-ink-2); font: 500 12px var(--font); letter-spacing: 0; text-transform: none; }
.nav-link:hover { color: var(--volt); }
.nav-link.alert { color: var(--volt); }
.nav a {
  position: relative; display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: var(--r-ctl);
  color: var(--sb-ink-2); white-space: nowrap; font-weight: 480;
  transition: background var(--d1), color var(--d1);
}
.nav a:hover { background: var(--sb-hover); color: var(--sb-ink); }
.nav a.active { background: var(--sb-active); color: var(--sb-ink); font-weight: 560; }
html.vt-page .sidebar .nav a.active { view-transition-name: nav-active; }
.nav a.active::before {
  content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--volt);
  box-shadow: 0 0 12px rgba(200, 240, 49, 0.6);
}
.nav a .svg { width: 17px; height: 17px; color: var(--sb-muted); transition: color var(--d1), transform var(--d2) var(--spring); }
.nav a:hover .svg { transform: scale(1.08); }
.nav a.active .svg { color: var(--volt); }
.nav a .count { margin-left: auto; font: 500 11.5px var(--mono); color: var(--sb-muted); font-variant-numeric: tabular-nums; }
.nav a .count.strong { color: var(--sb-ink); font-weight: 650; }
.nav a .count.hot { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px; display: inline-grid; place-items: center; background: var(--volt); color: var(--volt-ink); font-weight: 650; }
.nav a > span:not(.count):not(.pdot) { overflow: hidden; text-overflow: ellipsis; }
.nav-projects { overflow-y: auto; min-height: 0; flex: 1 1 auto; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.1) transparent; }
.pdot { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; display: inline-block; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); }
.nav a .pdot { margin: 0 3px; transition: transform var(--d2) var(--spring); }
/* Proyectos agrupados por departamento; los generales, aparte tras una raya */
.proj-group { display: grid; gap: 1px; }
.proj-group-title { padding: 10px 10px 4px; font: 500 11px var(--font); color: var(--sb-muted); }
.nav .proj-group.general { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--sb-line); }
.nav .proj-group:first-child.general { margin-top: 0; padding-top: 0; border-top: 0; }
.group .proj-group { gap: 0; }
.group .proj-group > * + * { box-shadow: inset 0 1px 0 var(--sep); }
.group .proj-group-title { padding: 12px 14px 4px; color: var(--muted); }
.nav a:hover .pdot { transform: rotate(45deg) scale(0.9); }
.nav a .pmeter { position: absolute; left: 10px; right: 10px; bottom: 3px; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.04); overflow: hidden; opacity: 0; transition: opacity var(--d2); }
.nav a:hover .pmeter, .nav a.active .pmeter { opacity: 1; }
.nav a .pmeter i { display: block; height: 100%; background: var(--c); border-radius: inherit; }

.sidebar-foot {
  display: flex; align-items: center; gap: 2px; margin-top: 10px; padding: 10px 4px 0 6px; border-top: 1px solid var(--sb-line);
}
.sidebar-foot .who { flex: 1; min-width: 0; line-height: 1.25; margin-left: 9px; }
.sidebar-foot .who b { display: block; font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--sb-ink); }
.sidebar-foot .who small { display: block; color: var(--sb-muted); font-size: 12px; }
.sidebar-foot .icon-btn { width: 30px; height: 30px; flex: none; color: var(--sb-muted); }
.sidebar-foot .icon-btn:hover { color: var(--sb-ink); background: var(--sb-hover); }
.sidebar-foot .icon-btn .svg { width: 16px; height: 16px; }
.sidebar-foot [data-action="toggle-theme"] .svg { transition: transform 0.5s var(--spring); }
.sidebar-foot [data-action="toggle-theme"]:hover .svg { transform: rotate(-25deg); }

.main {
  overflow-y: auto; min-width: 0; position: relative; background: var(--window);
  border-radius: 14px 0 0 14px; margin: 8px 0 8px 0; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), -20px 0 60px -30px rgba(0, 0, 0, 0.6);
}
.page { padding-bottom: 56px; min-height: 100%; }
.page > .content { padding: 22px 32px 0; }
.mobile-bar { display: none; }

.toolbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px; min-height: var(--bar-h); padding: 10px 20px 10px 32px;
  background: color-mix(in srgb, var(--window) 82%, transparent); backdrop-filter: blur(18px) saturate(1.6); -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border-bottom: 1px solid var(--sep); flex-wrap: wrap;
}
.tb-title { display: flex; flex-direction: column; min-width: 0; margin-right: 8px; }
.tb-title h1 { font: 650 17px/1.2 var(--font-display); letter-spacing: -0.025em; display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.tb-title h1 .pdot { width: 12px; height: 12px; border-radius: 4px; }
.tb-title small { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.tb-title .back { color: var(--accent); font-size: 13px; }
.toolbar .grow { flex: 1; }
.tb-search { position: relative; display: flex; align-items: center; width: 220px; transition: width var(--d3) var(--ease); }
.tb-search:focus-within { width: 280px; }
.tb-search .svg { position: absolute; left: 10px; width: 14px; height: 14px; color: var(--muted); pointer-events: none; }
.tb-search input {
  width: 100%; height: 34px; padding: 0 10px 0 32px; border-radius: var(--r-ctl); border: 1px solid transparent;
  background: var(--fill); color: var(--ink); transition: background var(--d1), border-color var(--d1), box-shadow var(--d2);
}
.tb-search input:hover { background: var(--fill-2); }
.tb-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--control); }
.tb-search input::placeholder { color: var(--muted); }
.tb-search::after { content: "/"; position: absolute; right: 8px; font: 500 11px var(--mono); color: var(--faint); padding: 1px 6px; border-radius: 5px; box-shadow: inset 0 0 0 1px var(--sep-strong); pointer-events: none; transition: opacity var(--d1); }
.tb-search:focus-within::after, .tb-search.has-q::after { opacity: 0; }
.tb-add { width: 32px; height: 32px; border-radius: var(--r-ctl); border: 0; display: grid; place-items: center; background: transparent; color: var(--ink-2); font-size: 20px; font-weight: 300; line-height: 1; }
.tb-add:hover { background: var(--hover); }
.tb-icon {
  position: relative; width: 34px; height: 34px; border-radius: var(--r-ctl); border: 0; display: grid; place-items: center;
  background: transparent; color: var(--ink-2); transition: background var(--d1), color var(--d1), transform var(--d2) var(--spring);
}
.tb-icon:hover { background: var(--hover); color: var(--ink); }
.tb-icon:active { transform: scale(0.9); }
.tb-icon.on { background: var(--fill-2); color: var(--ink); }
.tb-icon.dot::after { content: ""; position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--volt); box-shadow: 0 0 0 2px var(--window); }
.tb-icon .svg { width: 16px; height: 16px; }

.filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 32px 2px; animation: drop-in var(--d3) var(--ease) both; }
@keyframes drop-in { from { opacity: 0; transform: translateY(-6px); } }
.popup {
  display: inline-flex; align-items: center; height: 30px; border-radius: 999px; background: var(--fill);
  font-size: 13px; color: var(--ink-2); position: relative; box-shadow: inset 0 0 0 1px transparent;
  transition: background var(--d1), box-shadow var(--d1);
}
.popup:hover { background: var(--fill-2); }
.popup > span { padding-left: 12px; color: var(--muted); }
.popup select {
  appearance: none; border: 0; background: transparent var(--chevron) no-repeat right 10px center / 7px 10px;
  padding: 0 24px 0 5px; height: 30px; font-size: 13px; font-weight: 560; color: var(--ink); cursor: pointer;
  field-sizing: content; min-width: 40px;
}
.popup select:focus { outline: none; }
.popup:focus-within { box-shadow: 0 0 0 2px var(--accent); }
.popup.set { background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }
.popup.set > span { color: var(--ink-2); }
.popup.set select { color: var(--ink); }
.filterbar .spacer { flex: 1; }
.result-count { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ estado y prioridad */

.status-ic { color: var(--sc); }
.st-pendiente { --sc: var(--st-pendiente); }
.st-en_curso { --sc: var(--st-en_curso); }
.st-revision { --sc: var(--st-revision); }
.st-cerrado { --sc: var(--st-cerrado); }
.st-descartado { --sc: var(--st-descartado); }
.status-ic .spin-arc { transform-origin: 8px 8px; animation: spin 2.4s linear infinite; }
.status-pill {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; height: 24px; padding: 0 9px 0 7px; border-radius: 999px;
  color: var(--ink-2); font-size: 12.5px; font-weight: 520;
  background: color-mix(in srgb, var(--sc) 11%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sc) 18%, transparent);
}
.status-pill .svg { width: 13px; height: 13px; color: var(--sc); }

.prio { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--ink-2); font-size: 13px; }
.prio .marks { display: inline-grid; place-items: center; }
.pglyph { width: 16px; height: 16px; flex: none; display: block; color: var(--ink-2); }
.pglyph .b { fill: var(--fill-2); }
.pglyph .b.on { fill: currentColor; }
.prio-muy_alta .pglyph, .pglyph.p-muy_alta { color: var(--red); }
.prio-alta .pglyph, .pglyph.p-alta { color: var(--orange-text); }
.prio-media .pglyph, .pglyph.p-media { color: var(--ink-2); }
.prio-baja .pglyph, .pglyph.p-baja { color: var(--muted); }
.prio-muy_alta { color: var(--red-text); font-weight: 560; }
.prio-muy_alta .pglyph .urgent-bg { fill: var(--red); }
.prio .marks .pglyph .urgent-bg { transform-origin: center; animation: urgent-pulse 2.6s var(--ease) infinite; }
@keyframes urgent-pulse { 0%, 70%, 100% { transform: scale(1); } 80% { transform: scale(1.14); } }

/* Píldora de prioridad en el detalle: el color cambia con el valor */
.props .prop select.prio-sel { border-radius: 999px; padding-left: 12px; font-weight: 600; background-color: var(--fill); color: var(--ink-2); }
.props .prop select.prio-sel.p-muy_alta { background-color: var(--prio-muy_alta-bg); color: var(--red-text); }
.props .prop select.prio-sel.p-alta { background-color: var(--prio-alta-bg); color: var(--orange-text); }
.props .prop select.prio-sel.p-media { background-color: var(--prio-media-bg); color: var(--ink-2); }
.props .prop select.prio-sel.p-none { background-color: transparent; color: var(--muted); font-weight: 400; }
.props .prop select.prio-sel:hover:not(:disabled) { filter: brightness(0.97); }
.props .prop select.prio-sel:disabled { padding-right: 12px; }
.props .prop select.prio-sel.p-muy_alta:disabled { color: var(--red-text); }
.props .prop select.prio-sel.p-alta:disabled { color: var(--orange-text); }
.props .prop select.prio-sel.p-media:disabled, .props .prop select.prio-sel.p-baja:disabled { color: var(--ink-2); }

.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 999px;
  background: var(--fill); color: var(--ink-2); font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.chip.project { background: transparent; padding: 0; color: var(--muted); font-size: 12.5px; font-weight: 450; }
.chip.project .pdot { width: 8px; height: 8px; border-radius: 2.5px; box-shadow: none; }
.ref { color: var(--muted); white-space: nowrap; font-size: 12px; }
.meta-ic { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font: 500 12px var(--mono); }
.meta-ic .svg { width: 13px; height: 13px; }

.avatar {
  --h: 220;
  width: 24px; height: 24px; border-radius: 50%; flex: none; display: inline-grid; place-items: center;
  background: linear-gradient(145deg, hsl(var(--h) 62% 62%), hsl(calc(var(--h) + 28) 58% 44%));
  color: #fff; font: 650 9.5px/1 var(--font); letter-spacing: 0.02em; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.avatar.lg { width: 30px; height: 30px; font-size: 11px; }
.avatar.xl { width: 64px; height: 64px; font-size: 20px; }
.avatar.photo { background: var(--fill); overflow: hidden; }
.avatar.photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.profile-tx { display: grid; gap: 2px; min-width: 0; }
.profile-btns { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.chat-team-photo { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.chat-av { overflow: hidden; }
/* Foto del grupo: se cambia pulsándola (en la cabecera del canal) */
.chat-av.editable { position: relative; border: 0; padding: 0; cursor: pointer; }
.chat-av-edit {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%;
  background: rgba(0, 0, 0, 0.45); color: #fff; opacity: 0; transition: opacity var(--d1, .15s);
}
.chat-av-edit .svg { width: 15px; height: 15px; }
.chat-av.editable:hover .chat-av-edit, .chat-av.editable:focus-visible .chat-av-edit { opacity: 1; }
.avatar.none { background: var(--fill); box-shadow: inset 0 0 0 1px var(--sep-strong); }
.avatar.none::after { content: ""; width: 11px; height: 11px; border-radius: 50%; border: 1.5px dashed var(--muted); }
.avatar.team { background: var(--sb-bg); color: var(--volt); }
.person { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.person span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty { display: grid; place-items: center; gap: 6px; text-align: center; padding: 44px 20px; color: var(--muted); }
.empty b { color: var(--ink); font: 620 15px var(--font-display); letter-spacing: -0.015em; }
.empty span { max-width: 44ch; }
.empty .svg { width: 22px; height: 22px; margin-bottom: 6px; color: var(--ink-2); }
.empty .empty-ic {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 8px;
  background: var(--canvas-2); box-shadow: inset 0 0 0 1px var(--sep), 0 10px 24px -14px rgba(17, 18, 30, 0.3);
  animation: float-y 4s ease-in-out infinite;
}
.empty .empty-ic .svg { margin: 0; }
.empty .btn { margin-top: 10px; }
@keyframes float-y { 50% { transform: translateY(-4px); } }

/* ------------------------------------------------------------ muro */

.wall { padding: 6px 32px 0; }
.wall-group { margin-bottom: 18px; }
.wall-head {
  position: sticky; top: var(--bar-h); z-index: 2; display: flex; align-items: center; gap: 10px; margin: 0 -32px; padding: 14px 32px 12px;
  background: linear-gradient(var(--window) 70%, color-mix(in srgb, var(--window) 0%, transparent));
}
.wall-head .svg { width: 16px; height: 16px; }
.wall-head h2 { font: 650 18px/1.2 var(--font-display); letter-spacing: -0.025em; }
.wall-head span { color: var(--muted); font-size: 13px; }
.wall-head .hint { margin-left: auto; font-size: 12.5px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px 18px; }
.tile { cursor: pointer; min-width: 0; outline: none; border-radius: var(--r-card); }
.tile .ti {
  position: relative; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: var(--canvas-2);
  box-shadow: 0 0 0 1px var(--sep), var(--shadow-1);
  transition: transform var(--d3) var(--spring), box-shadow var(--d3) var(--ease);
}
.tile .ti img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform 0.6s var(--ease); }
.tile:hover .ti { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--sep-strong), 0 16px 30px -14px rgba(17, 18, 30, 0.35); }
.tile:hover .ti img { transform: scale(1.035); }
.tile:active .ti { transform: translateY(-1px) scale(0.99); }
.tile .noimg {
  height: 100%; display: grid; place-items: center; align-content: center; gap: 6px; color: var(--muted);
  background:
    radial-gradient(circle at 1px 1px, var(--stage-dot) 1px, transparent 0) 0 0 / 14px 14px,
    color-mix(in srgb, var(--c, var(--muted)) 7%, var(--canvas-2));
}
.tile .noimg b { font: 600 22px var(--mono); letter-spacing: -0.02em; color: color-mix(in srgb, var(--c, var(--muted)) 55%, var(--faint)); }
.tile .noimg small { font-size: 11.5px; color: var(--muted); }
.tile .noimg .svg { width: 18px; height: 18px; stroke-width: 1.6; opacity: 0.7; }
.tile .badge-c {
  position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: 999px; background: rgba(15, 16, 19, 0.72); color: #fff; font: 600 11px var(--mono);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.tile .badge-c .svg { width: 12px; height: 12px; }
.tile .badge-p {
  position: absolute; left: 8px; top: 8px; display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px 0 5px; border-radius: 999px;
  background: rgba(15, 16, 19, 0.74); color: #fff; font-size: 11.5px; font-weight: 600; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.tile .badge-p .pglyph { width: 14px; height: 14px; }
.tile .badge-p.p-muy_alta { background: var(--red); }
.tile .badge-p.p-muy_alta .pglyph, .tile .badge-p.p-muy_alta .pglyph .urgent-bg { color: #fff; fill: #fff; }
.tile .badge-p.p-muy_alta .pglyph .urgent-mark { stroke: var(--red); }
.tile .badge-v {
  position: absolute; left: 8px; top: 8px; height: 22px; padding: 0 9px; border-radius: 999px;
  background: var(--st-revision); color: #fff; font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center;
}
.tile .cap { margin-top: 10px; display: grid; gap: 3px; padding: 0 2px; line-height: 1.35; }
.tile .cap .tt {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  color: var(--ink); font-size: 14px; font-weight: 540; letter-spacing: -0.012em; transition: color var(--d1);
}
.tile .cap .meta { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted); font-size: 12.5px; }
.tile .cap .meta .ref { font-size: 11.5px; }
.tile .cap .meta .chip.project { min-width: 0; overflow: hidden; }
.tile .cap .meta .meta-ic { margin-left: auto; }
.tile .cap .sub { display: block; font-size: 12px; color: var(--muted); }
.tile .cap .rf { display: none; }
.tile.selected .ti, .tile:focus-visible .ti { box-shadow: 0 0 0 2px var(--window), 0 0 0 4px var(--accent); }

/* ------------------------------------------------------------ lista */

.flist { margin: 14px 32px 0; border-radius: var(--r-card); overflow: clip; box-shadow: 0 0 0 1px var(--sep); }
.flist-head, .frow {
  display: grid; grid-template-columns: 56px 64px minmax(0, 1fr) 120px 96px 150px 140px 60px;
  align-items: center; column-gap: 12px; padding: 0 16px;
}
.flist-head {
  height: 34px; font-size: 12px; font-weight: 560; color: var(--muted); border-bottom: 1px solid var(--sep);
  background: color-mix(in srgb, var(--canvas-2) 90%, transparent); backdrop-filter: blur(12px); position: sticky; top: var(--bar-h); z-index: 1;
}
.flist-head span:last-child, .frow .when { text-align: right; }
.frow { min-height: 52px; cursor: pointer; position: relative; transition: background var(--d1); }
.frow + .frow { box-shadow: inset 0 1px 0 var(--sep); }
.frow:hover { background: var(--hover); }
.frow::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); transform: scaleY(0); transition: transform var(--d2) var(--spring); }
.frow:hover::before { transform: scaleY(0.5); }
.frow.selected { background: var(--accent-soft); }
.frow.selected::before { transform: scaleY(1); }
.flist.no-proj .flist-head, .flist.no-proj .frow { grid-template-columns: 56px 64px minmax(0, 1fr) 120px 96px 140px 60px; }
.frow > .status-pill { justify-self: start; }
.flist.no-proj .proj { display: none; }
.frow .th, .grow-row .th { display: grid; place-items: center; color: var(--muted); }
.frow .th .svg, .grow-row .th .svg { width: 16px; height: 16px; stroke-width: 1.6; opacity: 0.7; }
.frow .th { width: 56px; height: 36px; border-radius: 6px; overflow: hidden; background: var(--canvas-2); box-shadow: inset 0 0 0 1px var(--sep); }
.frow .th img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.frow .title { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 520; }
.frow .title > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frow .title .chip { flex: none; }
.frow .proj { min-width: 0; overflow: hidden; }
.frow .who { min-width: 0; display: flex; font-size: 13px; }
.frow .when { color: var(--muted); font: 500 12px var(--mono); white-space: nowrap; }
.frow .ref { font-size: 12px; }
.flist .sec {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px; font-size: 12.5px; font-weight: 620; color: var(--ink-2);
  background: var(--canvas-2); box-shadow: inset 0 1px 0 var(--sep), inset 0 -1px 0 var(--sep);
}
.flist .sec .svg { width: 14px; height: 14px; }
.flist .sec .pdot, .wall-head .pdot { margin: 0 2px; }
.flist .sec .n { color: var(--muted); font-weight: 450; }

/* ------------------------------------------------------------ columnas (tablero) */

.board { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 16px; padding: 18px 32px 0; overflow-x: auto; align-items: start; }
.column {
  position: relative; background: var(--canvas-2); border-radius: 14px; display: flex; flex-direction: column;
  max-height: calc(100dvh - 150px); min-height: 220px; box-shadow: inset 0 0 0 1px var(--sep);
  transition: background var(--d2), box-shadow var(--d2);
}
.column::before { content: ""; position: absolute; left: 14px; right: 14px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--sc); opacity: 0.9; }
.column.drop { background: color-mix(in srgb, var(--sc) 8%, var(--canvas-2)); box-shadow: inset 0 0 0 2px var(--sc); }
.column.drop::after {
  content: attr(data-drop); position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  padding: 6px 12px; border-radius: 999px; background: var(--sc); color: #fff; font-size: 12.5px; font-weight: 600; white-space: nowrap;
  box-shadow: 0 8px 20px -8px var(--sc); animation: rise var(--d2) var(--ease) both; pointer-events: none;
}
.column.nodrop { opacity: 0.55; }
.column-head { display: flex; align-items: center; gap: 8px; padding: 16px 16px 10px; font-weight: 620; }
.column-head .svg { width: 15px; height: 15px; color: var(--sc); }
.column-head .n { margin-left: auto; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--fill); color: var(--ink-2); font: 600 12px var(--mono); }
.column-body { display: grid; grid-auto-rows: max-content; gap: 10px; padding: 2px 10px 14px; overflow-y: auto; align-content: start; min-height: 60px; }
.column-empty { display: grid; place-items: center; min-height: 90px; border: 1.5px dashed var(--sep-strong); border-radius: 10px; color: var(--muted); font-size: 12.5px; text-align: center; padding: 10px; }
.column-note { text-align: center; font-size: 12.5px; color: var(--muted); padding: 6px; }
.column-note a { color: var(--ink); font-weight: 560; text-decoration: underline; text-decoration-color: var(--sep-strong); text-underline-offset: 3px; }
.tcard {
  position: relative; background: var(--card); border-radius: 10px; overflow: hidden; cursor: grab;
  box-shadow: 0 0 0 1px var(--sep), var(--shadow-1);
  transition: box-shadow var(--d2), transform var(--d3) var(--spring), opacity var(--d2);
}
html.vt-cards .tcard { view-transition-name: var(--vtn); view-transition-class: card; }
.tcard[draggable="false"] { cursor: pointer; }
.tcard:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--sep-strong), 0 14px 28px -14px rgba(17, 18, 30, 0.35); }
.tcard:active { cursor: grabbing; }
.tcard.dragging { opacity: 0.35; transform: scale(0.98); box-shadow: 0 0 0 1.5px dashed var(--sep-strong); }
.tcard.landed { animation: landed 0.9s var(--ease); }
@keyframes landed { 0% { box-shadow: 0 0 0 2px var(--sc, var(--accent)), 0 0 0 8px color-mix(in srgb, var(--sc, var(--accent)) 25%, transparent); } 100% { box-shadow: 0 0 0 1px var(--sep), var(--shadow-1); } }
.tcard .cv { aspect-ratio: 16 / 8; background: var(--canvas-2); overflow: hidden; }
.tcard .cv img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.tcard .cb { padding: 11px 12px 12px; display: grid; gap: 8px; }
.tcard .t { font-weight: 540; line-height: 1.38; letter-spacing: -0.01em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tcard .meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.tcard .meta .avatar { margin-left: auto; width: 22px; height: 22px; font-size: 8.5px; }
.tcard .meta .avatar.none { visibility: hidden; }
.tcard .grip { position: absolute; right: 6px; top: 6px; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: var(--muted); background: color-mix(in srgb, var(--card) 85%, transparent); opacity: 0; transition: opacity var(--d1); }
.tcard:hover .grip { opacity: 1; }
.tcard .grip .svg { width: 14px; height: 14px; }
.board-hint { display: flex; align-items: center; gap: 8px; margin: 14px 32px 0; color: var(--muted); font-size: 13px; }
.board-hint .svg { width: 15px; height: 15px; }

/* ------------------------------------------------------------ resumen */

.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 6px 0 22px; flex-wrap: wrap; }
.hello h2 { font: 660 30px/1.1 var(--font-display); letter-spacing: -0.04em; }
.hello p { color: var(--muted); margin-top: 8px; font-size: 15px; max-width: 64ch; }
.hello p b { color: var(--ink); font-weight: 600; }
.hello p a { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--ink) 25%, transparent); text-underline-offset: 3px; }
.hello p a:hover { text-decoration-color: var(--ink); }

.stats { display: grid; grid-template-columns: 1.35fr repeat(3, minmax(0, 1fr)); gap: 14px; }
.stats.three { grid-template-columns: 1.35fr repeat(2, minmax(0, 1fr)); }
.stat {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 128px; padding: 16px 18px 14px;
  border-radius: 14px; background: var(--canvas-2); box-shadow: inset 0 0 0 1px var(--sep); overflow: hidden; isolation: isolate;
  transition: transform var(--d3) var(--spring), box-shadow var(--d2), background var(--d2);
}
.stat:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--sep-strong), 0 16px 30px -18px rgba(17, 18, 30, 0.35); }
.stat .top { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-weight: 560; font-size: 13.5px; }
.stat .top .svg { width: 16px; height: 16px; color: var(--muted); }
.stat .top .go { margin-left: auto; color: var(--muted); opacity: 0; transform: translateX(-4px); transition: opacity var(--d1), transform var(--d2) var(--spring); }
.stat:hover .top .go { opacity: 1; transform: none; }
.stat .value, .stat .label { display: block; }
.stat .value { font: 640 40px/1 var(--font-display); letter-spacing: -0.045em; font-variant-numeric: tabular-nums; margin-top: 18px; }
.stat .label { color: var(--muted); margin-top: 6px; font-size: 13px; }
.stat.alert .value { color: var(--red); }
.stat.alert .top .svg { color: var(--red); }
.stat.good .value { color: var(--st-cerrado); }
.stat .spark { position: absolute; right: 16px; bottom: 16px; width: 46%; height: 44px; display: flex; align-items: flex-end; gap: 3px; z-index: -1; }
.stat .spark i { flex: 1; height: calc(var(--v) * 100%); border-radius: 2px; background: var(--spark, var(--ink-2)); opacity: 0.28; transform-origin: bottom; }
.stat .spark i.today { opacity: 1; }
.stat .spark i.z { height: 3px; opacity: 0.14; }
.stat:hover .spark i { opacity: 0.45; }
.stat:hover .spark i.today { opacity: 1; }
.stat.feature { background: var(--sb-bg); color: var(--sb-ink); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); --spark: var(--volt); }
.stat.feature .top { color: var(--sb-ink); }
.stat.feature .top .svg, .stat.feature .top .go { color: var(--volt); }
.stat.feature .label { color: var(--sb-muted); }
.stat.feature .spark i { opacity: 0.4; }
.stat.feature:hover { box-shadow: inset 0 0 0 1px rgba(200, 240, 49, 0.35), 0 20px 40px -20px rgba(0, 0, 0, 0.6); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 32px; margin-top: 32px; align-items: start; }
.dash-col { display: grid; gap: 30px; min-width: 0; }
.panel { min-width: 0; }
.panel h2 { font: 640 16px/1.2 var(--font-display); letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.panel h2 a, .panel h2 .aside { margin-left: auto; font: 520 13px var(--font); letter-spacing: 0; color: var(--ink-2); display: inline-flex; align-items: center; gap: 4px; }
.panel h2 a:hover { color: var(--ink); }
.panel h2 a .svg { width: 14px; height: 14px; transition: transform var(--d2) var(--spring); }
.panel h2 a:hover .svg { transform: translateX(3px); }
.panel h2 .n { font: 500 12px var(--mono); color: var(--muted); padding: 2px 7px; border-radius: 999px; background: var(--fill); }
.panel h2 .aside.btn { color: var(--ink); }
.panel-sub { color: var(--muted); font-size: 13px; margin: -6px 0 12px; }
.strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 14px; }
.strip .tile .ti { aspect-ratio: 16 / 10; }

.group { border-radius: var(--r-card); background: var(--window); overflow: hidden; box-shadow: 0 0 0 1px var(--sep); }
.group > * + * { box-shadow: inset 0 1px 0 var(--sep); }
.grow-row { position: relative; display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 9px 14px; cursor: pointer; transition: background var(--d1); }
.grow-row:hover { background: var(--hover); }
.grow-row .th { width: 52px; height: 36px; border-radius: 6px; overflow: hidden; background: var(--canvas-2); flex: none; box-shadow: inset 0 0 0 1px var(--sep); }
.grow-row .th img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.grow-row .tx { flex: 1; min-width: 0; display: grid; gap: 4px; }
.grow-row .tx b { display: block; font-weight: 540; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -0.01em; }
.grow-row .tx small { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 12px; }
.grow-row .tx small .status-pill { height: 20px; font-size: 11.5px; padding: 0 7px 0 5px; }
.grow-row .end { color: var(--muted); font: 500 12px var(--mono); white-space: nowrap; }
.grow-row .chev { color: var(--faint); width: 15px; height: 15px; transition: transform var(--d2) var(--spring), color var(--d1); }
.grow-row:hover .chev { transform: translateX(3px); color: var(--ink-2); }
.group .empty { padding: 26px; }
.group .empty .svg { color: var(--st-cerrado); }

.legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--ink-2); font-size: 12.5px; margin-bottom: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--sc); }
.bars { display: grid; gap: 12px; padding: 16px; border-radius: var(--r-card); box-shadow: 0 0 0 1px var(--sep); }
.bar-row { display: grid; grid-template-columns: 140px minmax(0, 1fr) 30px; gap: 12px; align-items: center; cursor: pointer; border-radius: 6px; }
.bar-row .name { display: flex; align-items: center; gap: 8px; overflow: hidden; white-space: nowrap; font-size: 13px; }
.bar-row .name span:last-child { overflow: hidden; text-overflow: ellipsis; }
.bar-row:hover .name { color: var(--ink); font-weight: 560; }
.bar-row .num { text-align: right; color: var(--ink-2); font: 600 12.5px var(--mono); }
.bar { display: flex; gap: 2px; height: 12px; transform-origin: left center; transition: filter var(--d1); }
.bar-row:hover .bar { filter: saturate(1.2) brightness(1.03); }
.bar .seg { background: var(--sc); height: 100%; min-width: 4px; }
.bar .seg:first-child { border-radius: 4px 0 0 4px; }
.bar .seg:last-child { border-radius: 0 4px 4px 0; }
.bar .seg:only-child { border-radius: 4px; }
.bar .zero { height: 100%; width: 100%; border-radius: 4px; background: var(--fill); }

.feed { display: grid; }
.log { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 11px 14px; }
.log .what { color: var(--ink-2); min-width: 0; line-height: 1.45; }
.log .what b { color: var(--ink); font-weight: 580; }
.log .on { display: flex; gap: 8px; margin-top: 3px; cursor: pointer; min-width: 0; font-size: 12.5px; align-items: baseline; }
.log .on span:last-child { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color var(--d1); }
.log .on:hover span:last-child { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.log time { color: var(--muted); font: 500 11.5px var(--mono); white-space: nowrap; }

#tooltip {
  position: fixed; z-index: 100; pointer-events: none; padding: 8px 11px; border-radius: 9px;
  background: var(--hud); color: #fff; font-size: 12.5px; line-height: 1.5;
  transform: translate(-50%, calc(-100% - 12px)); white-space: nowrap; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.5);
}

.proposal { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.proposal > div { flex: 1; min-width: 0; display: grid; gap: 3px; }
.proposal b { font-weight: 620; }
.proposal span { color: var(--muted); font-size: 12.5px; }
.proposal p { color: var(--ink-2); font-size: 13px; }
.proposal.rechazado span { color: var(--red-text); }
.proposal-info { display: grid; gap: 6px; padding: 12px 14px; border-radius: 10px; background: var(--canvas-2); box-shadow: inset 0 0 0 1px var(--sep); font-size: 13px; }
.proposal-info span { color: var(--ink-2); }
.proj-row { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; transition: background var(--d1); }
.proj-row:hover { background: var(--hover); }
.proj-row .num { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.only-admin {
  display: inline-flex; align-items: center; height: 19px; padding: 0 8px; margin-left: 6px; border-radius: 999px;
  background: var(--fill); color: var(--ink-2); font-size: 11px; font-weight: 600; letter-spacing: 0;
}

/* ------------------------------------------------------------ visor (detalle) */

.drawer-backdrop { display: none; }
.drawer {
  position: fixed; top: 8px; right: 0; bottom: 8px; left: var(--sidebar-w); z-index: 31;
  display: grid; grid-template-rows: var(--bar-h) minmax(0, 1fr); background: var(--window);
  border-radius: 14px 0 0 14px; overflow: hidden; box-shadow: -30px 0 80px -30px rgba(0, 0, 0, 0.55);
}
.drawer.dragover::after {
  content: "Suelta aquí para adjuntar"; position: absolute; inset: 14px; z-index: 5; display: grid; place-items: center;
  border: 2px dashed var(--accent); border-radius: var(--r-sheet); background: color-mix(in srgb, var(--window) 86%, transparent);
  color: var(--ink); font-size: 17px; font-weight: 620; backdrop-filter: blur(4px);
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes grow-x { from { transform: scaleX(0); } }
.drawer-loading { display: grid; grid-template-columns: minmax(0, 1fr) 380px; grid-row: 1 / -1; }
.drawer-loading .sk-stage { background: var(--stage); display: grid; place-items: center; }
.drawer-loading .sk-img { width: 70%; aspect-ratio: 16 / 10; border-radius: 10px; }
.drawer-loading .sk-side { padding: 24px 22px; display: grid; gap: 14px; align-content: start; border-left: 1px solid var(--sep); }
.sk { background: linear-gradient(90deg, var(--fill) 25%, var(--fill-2) 50%, var(--fill) 75%) 0 0 / 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.vbar {
  display: flex; align-items: center; gap: 8px; padding: 0 14px 0 14px; border-bottom: 1px solid var(--sep);
  background: color-mix(in srgb, var(--window) 88%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.vbar .back {
  display: inline-flex; align-items: center; gap: 4px; height: 34px; border: 0; background: var(--fill); color: var(--ink);
  font-size: 13.5px; font-weight: 560; padding: 0 12px 0 8px; border-radius: var(--r-ctl);
  transition: background var(--d1), transform var(--d2) var(--spring);
}
.vbar .back:hover { background: var(--fill-2); }
.vbar .back:active { transform: scale(0.96); }
.vbar .back .svg { width: 16px; height: 16px; transition: transform var(--d2) var(--spring); }
.vbar .back:hover .svg { transform: translateX(-2px); }
.vbar .back kbd { margin-left: 6px; }
.vbar .ctitle { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 10px; font: 600 13.5px var(--mono); }
.vbar .ctitle .muted { font: 450 13px var(--font); display: inline-flex; align-items: center; gap: 6px; }
.vbar .navs { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 10px; background: var(--fill); color: var(--muted); font-size: 12.5px; }
.vbar .navs .icon-btn { width: 28px; height: 28px; color: var(--ink-2); }
.vbar .navs .icon-btn:hover { background: var(--control); box-shadow: var(--shadow-1); }
.vbar .navs span { padding: 0 6px; font: 500 12px var(--mono); }
.vbar .remove-btns { display: contents; }
.vbar > .icon-btn { color: var(--ink-2); }

.viewer { display: grid; grid-template-columns: minmax(0, 1fr) 400px; min-height: 0; }
.stage {
  display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0;
  background: radial-gradient(circle at 1px 1px, var(--stage-dot) 1px, transparent 0) 0 0 / 18px 18px, var(--stage);
}
.stage-main { display: grid; place-items: center; padding: 36px; min-height: 0; overflow: hidden; position: relative; }
.stage-main img {
  max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; cursor: zoom-in;
  box-shadow: 0 0 0 1px rgba(17, 18, 30, 0.08), 0 30px 60px -24px rgba(17, 18, 30, 0.45);
  view-transition-name: shot; transition: transform var(--d3) var(--ease);
}
.stage-main img:hover { transform: scale(1.01); }
.stage-main .zoom-hint {
  position: absolute; right: 18px; bottom: 16px; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
  border-radius: 999px; background: var(--hud); color: #fff; font-size: 12px; opacity: 0; transform: translateY(4px);
  transition: opacity var(--d2), transform var(--d2) var(--ease); pointer-events: none;
}
.stage-main .zoom-hint .svg { width: 13px; height: 13px; }
/* ------------------------------------------------------------ mis tareas */
.todos { max-width: 760px; margin: 18px auto 40px; padding: 0 24px; display: grid; gap: 14px; }
.todo-add { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 12px; background: var(--window); box-shadow: 0 0 0 1px var(--sep-strong, var(--sep)); }
.todo-add > .svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.todo-add .input { border: 0; box-shadow: none; background: transparent; height: 46px; padding: 0; font-size: 14px; }
.todo-add .input:focus { box-shadow: none; }
.todo-group { border-radius: 12px; background: var(--window); box-shadow: 0 0 0 1px var(--sep); overflow: hidden; }
.todo { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; min-height: 46px; padding: 6px 12px; }
/* Tareas pendientes: la prioridad en una columna fija tras el círculo, todas alineadas */
.todo.has-prio { grid-template-columns: 28px 76px minmax(0, 1fr) auto auto; }
.todo-prio-cell { display: flex; }
.todo-prio-cell .todo-prio { width: 100%; text-align: center; text-align-last: center; }
.todo + .todo { border-top: 1px solid var(--sep); }
.todo-check { display: grid; place-items: center; cursor: pointer; }
.todo-check input { position: absolute; opacity: 0; pointer-events: none; }
.todo-check .box { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px var(--sep-strong, var(--muted)); color: transparent; transition: background var(--d1, .15s), box-shadow var(--d1, .15s); }
.todo-check .box .svg { width: 12px; height: 12px; stroke-width: 3; }
.todo-check:hover .box { box-shadow: inset 0 0 0 1.5px var(--st-cerrado); }
.todo-check input:checked + .box { background: var(--st-cerrado); box-shadow: none; color: #fff; }
.todo-check input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }
.todo-text { font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.todo-text a { color: var(--accent); text-decoration: underline; }
.todo.done .todo-text { color: var(--muted); text-decoration: line-through; }
.todo-when { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.todo-acts { display: inline-flex; opacity: 0; transition: opacity var(--d1, .15s); }
.todo-acts .icon-btn { width: 28px; height: 28px; }
.todo-acts .svg { width: 14px; height: 14px; }
.todo:hover .todo-acts, .todo-acts:focus-within { opacity: 1; }
.todo-done-head { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.todo-empty { padding: 36px 16px; }
.todo-title { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 0; font: 650 15px var(--font-display, inherit); }
.todo-title .n { color: var(--muted); font-weight: 500; font-size: 13px; }
.todo-title a { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.todo-title a .svg { width: 13px; height: 13px; }
.todo-none { font-size: 13px; }
/* Prioridad de las tareas: pastilla con el color de la prioridad; sin prioridad, solo al pasar el ratón */
.todo-prio {
  appearance: none; -webkit-appearance: none; border: 0; border-radius: 999px; height: 22px; padding: 0 10px; flex: none;
  font: 600 11.5px var(--font, inherit); background: var(--fill); color: var(--ink-2); cursor: pointer; transition: opacity var(--d1, .15s);
}
.todo-prio:hover { filter: brightness(0.96); }
.todo-prio:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.todo-prio.p-muy_alta { background: var(--prio-muy_alta-bg); color: var(--red-text); }
.todo-prio.p-alta { background: var(--prio-alta-bg); color: var(--orange-text); }
.todo-prio.p-media { background: var(--prio-media-bg); }
.todo-prio.p-none { background: transparent; color: var(--muted); font-weight: 500; box-shadow: inset 0 0 0 1px var(--sep); }
.todo .todo-prio.p-none { opacity: 0; }
.todo:hover .todo-prio.p-none, .todo .todo-prio.p-none:focus-visible { opacity: 1; }
@media (max-width: 860px) { .todo .todo-prio.p-none { opacity: 1; } }
.todo-none .svg { width: 13px; height: 13px; vertical-align: -2px; }
.todo-title .btn { margin-left: auto; }
.todo-title .btn .svg { width: 13px; height: 13px; }
.todo-tag {
  display: inline-flex; align-items: center; height: 18px; margin-left: 8px; padding: 0 7px; border-radius: 9px; vertical-align: 1px;
  background: var(--fill); color: var(--ink-2); font-size: 11px; font-weight: 600; white-space: nowrap; text-decoration: none;
}
@media (max-width: 860px) { .todo-acts { opacity: 1; } .todo-when { display: none; } }

/* ------------------------------------------------------------ mensajes (chat) */
.chat { display: grid; grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); min-height: 0; border-top: 1px solid var(--sep); }
.chat-side { min-height: 0; overflow-y: auto; border-right: 1px solid var(--sep); background: var(--canvas-2, var(--alt)); padding: 8px; }
.chat-items { display: grid; gap: 2px; }
.chat-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--ink); }
.chat-item:hover { background: var(--hover); }
.chat-item.on { background: var(--selected, var(--fill)); }
.chat-item .chat-tx { display: grid; min-width: 0; }
.chat-item .chat-tx b { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item .chat-tx small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item.has-unread .chat-tx b, .chat-item.has-unread .chat-tx small { color: var(--ink); font-weight: 650; }
.chat-item .chat-meta { display: grid; justify-items: end; gap: 4px; }
.chat-item .chat-meta small { color: var(--muted); font-size: 11px; }
.chat-av { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--fill); color: var(--ink-2); flex: none; }
.chat-av .avatar { width: 34px; height: 34px; font-size: 12px; }
.chat-av .svg { width: 17px; height: 17px; }
.chat-none { padding: 16px; font-size: 13px; }
.chat-pane { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; min-width: 0; }
.chat-pane > .chat-empty { grid-row: 1 / -1; align-self: center; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--sep); }
.chat-head > div { display: grid; min-width: 0; }
.chat-head small { color: var(--muted); font-size: 12px; }
.chat-back { display: none; }
.chat-msgs { overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.chat-loading { display: grid; place-items: center; padding: 40px; }
.chat-first { margin: auto; }
.chat-day { display: flex; justify-content: center; margin: 12px 0 6px; }
.chat-day span { padding: 2px 10px; border-radius: 999px; background: var(--fill); color: var(--muted); font-size: 11.5px; }
.cmsg { display: grid; justify-items: start; margin-top: 8px; max-width: min(640px, 82%); }
.cmsg.cont { margin-top: 2px; }
.cmsg.mine { align-self: flex-end; justify-items: end; }
.cmsg-author { font-size: 12px; font-weight: 600; color: var(--ink-2); margin: 0 0 3px 10px; display: flex; align-items: center; gap: 6px; }
.cmsg-tag { padding: 0 6px; border-radius: 6px; background: var(--fill); color: var(--muted); font-size: 10.5px; font-weight: 600; }
.cmsg-row { display: flex; align-items: flex-end; gap: 4px; }
.cmsg.mine .cmsg-row { flex-direction: row-reverse; }
.cmsg-bubble { position: relative; padding: 8px 12px 18px; border-radius: 16px; background: var(--window); box-shadow: 0 0 0 1px var(--sep); font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; min-width: 64px; }
.cmsg.mine .cmsg-bubble { background: color-mix(in srgb, var(--st-revision) 14%, var(--window)); box-shadow: none; }
.cmsg-body a { color: var(--accent); text-decoration: underline; }
.cmsg-time { position: absolute; right: 10px; bottom: 4px; font-size: 10.5px; color: var(--muted); }
.cmsg-img img { display: block; max-width: min(360px, 100%); max-height: 300px; border-radius: 10px; margin-top: 4px; }
.cmsg-file { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--ink); font-size: 12.5px; }
.cmsg-file .svg { width: 15px; height: 15px; }
.cmsg-acts { display: inline-flex; gap: 0; opacity: 0; transition: opacity var(--d1, .15s); }
.cmsg-acts .icon-btn { width: 26px; height: 26px; }
.cmsg-acts .svg { width: 14px; height: 14px; }
.cmsg:hover .cmsg-acts, .cmsg-acts:focus-within { opacity: 1; }
.cmsg.deleted .cmsg-bubble { background: transparent; box-shadow: 0 0 0 1px var(--sep); }
.cmsg-deleted { color: var(--muted); font-style: italic; }
.chat-composer { padding: 10px 18px 14px; border-top: 1px solid var(--sep); }
.chat-composer .box { display: flex; align-items: flex-end; gap: 8px; padding: 8px 8px 8px 12px; border-radius: 14px; background: var(--window); box-shadow: 0 0 0 1px var(--sep-strong, var(--sep)); }
.chat-composer textarea { flex: 1; min-width: 0; border: 0; outline: 0; resize: none; background: transparent; color: var(--ink); font: inherit; font-size: 13.5px; max-height: 160px; padding: 5px 0; }
.chat-contacts { display: grid; gap: 6px; max-height: 50vh; overflow-y: auto; }
.chat-contacts .check { gap: 8px; }
.chat-contacts .avatar { width: 24px; height: 24px; font-size: 10px; }
@media (max-width: 860px) {
  .chat { grid-template-columns: 1fr; }
  .chat.has-open .chat-side { display: none; }
  .chat:not(.has-open) .chat-pane { display: none; }
  .chat-back { display: inline-grid; }
  .cmsg { max-width: 92%; }
}

/* Mensajes: foto de quien habla, ticks de «leído» y «marcar como no leída» */
.cmsg:not(.mine) .cmsg-author { margin-left: 46px; }
.cmsg-av { width: 30px; flex: none; align-self: flex-start; margin-right: 6px; }
.cmsg-av .avatar { width: 30px; height: 30px; font-size: 11px; }
.cmsg-time { display: inline-flex; align-items: center; gap: 3px; }
.cmsg-ticks { display: inline-flex; }
.cmsg-ticks svg { width: 18px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cmsg-ticks.sent, .cmsg-ticks.some { color: var(--muted); }
.cmsg-ticks.read { color: #3b82f6; }
.cmsg.mine .cmsg-bubble { padding-right: 14px; }
.chat-head .grow { flex: 1; }
.chat-item { position: relative; }
.chat-item-unread { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; opacity: 0; background: var(--window); transition: opacity var(--d1, .15s); }
.chat-item-unread .svg { width: 15px; height: 15px; }
.chat-item:hover .chat-item-unread, .chat-item-unread:focus-visible { opacity: 1; }
/* Al pasar el ratón, el botón ocupa el sitio de la hora (como en el correo) en lugar de taparla. */
.chat-item:has(.chat-item-unread) .chat-meta { transition: opacity var(--d1, .15s); }
.chat-item:has(.chat-item-unread):hover .chat-meta, .chat-item:has(.chat-item-unread:focus-visible) .chat-meta { opacity: 0; }

/* Conversación: comentarios sin leer y a quién le toca responder */
.unread-badge {
  display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 9px; flex: none;
  background: var(--st-revision); color: #fff; font-size: 11px; font-weight: 650; white-space: nowrap;
}
.reply-chip {
  display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 9px; flex: none;
  background: color-mix(in srgb, var(--st-en_curso) 18%, transparent); color: var(--ink); font-size: 11px; font-weight: 600; white-space: nowrap;
}
.ask-chip {
  display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 9px; flex: none;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--ink); font-size: 11px; font-weight: 600; white-space: nowrap;
}
.resolved-chip {
  display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 9px; flex: none;
  background: var(--st-cerrado); color: #fff; font-size: 11px; font-weight: 650; white-space: nowrap;
}
.reply-state {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; padding: 7px 10px;
  border-radius: 8px; background: var(--fill); font-size: 12.5px; color: var(--ink-2);
}
.reply-state > span { display: inline-flex; align-items: center; gap: 7px; }
.reply-state .svg { width: 14px; height: 14px; flex: none; }
.reply-state.mine { background: color-mix(in srgb, var(--st-en_curso) 14%, transparent); color: var(--ink); font-weight: 550; }

/* Quién de NAAR IA está con la incidencia */
.work-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px; padding: 9px 12px;
  border-radius: 10px; background: var(--fill); font-size: 13px; color: var(--ink-2);
}
.work-banner > span { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.work-banner .svg { width: 15px; height: 15px; flex: none; }
.work-banner.mine, .work-banner.other { background: color-mix(in srgb, var(--st-en_curso) 12%, transparent); }
.work-banner.mine .svg, .work-banner.other .svg { color: var(--st-en_curso); }
/* Por validar: la captura de la corrección va primero y se marca */
.stage-main .fix-tag {
  position: absolute; left: 18px; top: 16px; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px;
  border-radius: 999px; background: var(--st-revision); color: #fff; font-size: 12.5px; font-weight: 600; pointer-events: none;
}
.stage-main .fix-tag .svg { width: 13px; height: 13px; stroke-width: 2.4; }
.film.fix::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--st-revision); }
.stage-main:hover .zoom-hint { opacity: 1; transform: none; }
.dropzone {
  display: grid; justify-items: center; gap: 8px; width: min(440px, 100%); padding: 48px 32px; text-align: center;
  border: 1.5px dashed var(--sep-strong); border-radius: 18px; background: var(--window); color: var(--muted);
  transition: border-color var(--d2), transform var(--d3) var(--spring), box-shadow var(--d2);
}
.dropzone:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 20px 40px -24px rgba(17, 18, 30, 0.3); }
.dropzone .svg { width: 30px; height: 30px; stroke-width: 1.5; margin-bottom: 4px; color: var(--ink-2); }
.dropzone b { color: var(--ink); font: 620 16px var(--font-display); letter-spacing: -0.015em; }
.dropzone span { font-size: 13px; max-width: 34ch; }
.dropzone kbd { font-size: 11px; }
.filmstrip { display: flex; gap: 10px; padding: 12px 18px 16px; overflow-x: auto; justify-content: center; }
.film {
  position: relative; width: 84px; height: 56px; border-radius: 8px; overflow: hidden; flex: none; border: 0; padding: 0;
  background: var(--fill); cursor: pointer; box-shadow: 0 0 0 1px var(--sep-strong);
  transition: transform var(--d2) var(--spring), box-shadow var(--d2), opacity var(--d2);
}
.film:not(.on) { opacity: 0.72; }
.film:hover { opacity: 1; transform: translateY(-2px); }
.film img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.film.on { box-shadow: 0 0 0 2px var(--window), 0 0 0 4px var(--accent); opacity: 1; }
.film.file { display: grid; place-items: center; color: var(--ink-2); font: 600 11px var(--mono); padding: 4px; text-align: center; background: var(--window); }
.film.add { display: grid; place-items: center; color: var(--muted); font-size: 22px; font-weight: 300; background: transparent; box-shadow: inset 0 0 0 1.5px var(--sep-strong); opacity: 1; }
.film.add:hover { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--accent); }
.film .del {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; padding: 0; border: 0;
  background: rgba(15, 16, 19, 0.75); color: #fff; opacity: 0; display: grid; place-items: center; transition: opacity var(--d1), background var(--d1);
}
.film .del:hover { background: var(--red); }
.film .del .svg { width: 11px; height: 11px; }
.film:hover .del, .film:focus-within .del { opacity: 1; }

.inspector { border-left: 1px solid var(--sep); display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; background: var(--window); view-transition-name: inspector; }
.insp-scroll { overflow-y: auto; padding: 22px 22px 24px; display: grid; grid-auto-rows: max-content; gap: 20px; align-content: start; scrollbar-width: thin; }
.title-edit {
  width: 100%; border: 0; resize: none; overflow: hidden; background: transparent;
  font: 650 20px/1.3 var(--font-display); letter-spacing: -0.03em; padding: 4px 8px; margin: -4px -8px; border-radius: var(--r-ctl);
  transition: background var(--d1), box-shadow var(--d2); width: calc(100% + 16px);
}
.title-edit:hover:not([readonly]) { background: var(--hover); }
.title-edit:focus { outline: none; background: var(--control); box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-soft); }
.meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; margin-top: -12px; }
.meta-line .ref { font-size: 12px; }

.validate {
  position: relative; border-radius: 14px; padding: 16px; display: grid; gap: 14px; overflow: hidden;
  background: color-mix(in srgb, var(--st-revision) 9%, var(--window));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--st-revision) 30%, transparent);
  animation: rise var(--d3) var(--ease) both;
}
.validate > div:first-child { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 2px 12px; }
.validate .v-ic { grid-row: span 2; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--st-revision); color: #fff; }
.validate .v-ic .svg { width: 18px; height: 18px; }
.validate b { font-weight: 640; font-size: 14.5px; letter-spacing: -0.01em; }
.validate span { color: var(--ink-2); font-size: 13px; line-height: 1.45; }
.validate .btns { display: grid; grid-template-columns: 1fr 1.3fr; gap: 8px; }
.validate .btns .btn { height: 38px; }
.validate .btns .btn.primary { background: var(--st-cerrado); color: #fff; }
.validate .btns .btn.primary:hover { background: color-mix(in srgb, var(--st-cerrado) 88%, #000); }
.validate.waiting { background: var(--canvas-2); box-shadow: inset 0 0 0 1px var(--sep); }
.validate.waiting .v-ic { background: var(--fill-2); color: var(--ink-2); }
/* Petición de NAAR IA al departamento: «Hecha» */
.validate.ask {
  background: color-mix(in srgb, var(--accent) 9%, var(--window));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}
.validate.ask .v-ic { background: var(--accent); }
.validate.ask .btns { grid-template-columns: auto; justify-content: start; }
.validate.ask .btns .btn.primary { background: var(--accent); color: #fff; }
/* Creada por NAAR IA y resuelta: no se valida, se puede reabrir */
.validate.resolved {
  background: color-mix(in srgb, var(--st-cerrado) 9%, var(--window));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--st-cerrado) 30%, transparent);
}
.validate.resolved .v-ic { background: var(--st-cerrado); }
.validate.resolved .btns { grid-template-columns: auto; justify-content: start; }

.props { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 4px 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--sep); border-bottom: 1px solid var(--sep); }
.props > label, .props > .plabel { color: var(--muted); font-size: 13px; }
.prop { position: relative; display: flex; align-items: center; min-height: 36px; min-width: 0; }
.prop .lead-ic { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); pointer-events: none; display: flex; }
.prop .lead-ic .svg { width: 14px; height: 14px; }
.prop .lead-ic .avatar { width: 20px; height: 20px; font-size: 8px; }
.prop select, .prop input {
  appearance: none; max-width: 100%; height: 32px; padding: 0 9px; border-radius: var(--r-ctl);
  border: 0; background: transparent; cursor: pointer; font-size: 13.5px; font-weight: 500; color: var(--ink);
  transition: background-color var(--d1), box-shadow var(--d2);
}
.prop select { padding-right: 26px; background: var(--chevron) no-repeat right 9px center / 7px 10px; }
.prop .lead-ic + select { padding-left: 30px; }
.prop input { cursor: text; width: 100%; }
.prop select:hover:not(:disabled), .prop input:hover:not([readonly]) { background-color: var(--fill); }
.prop select:focus, .prop input:focus { outline: none; background-color: var(--control); box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-soft); }
.prop select:disabled { cursor: default; background-image: none; opacity: 1; color: var(--ink); }
.prop input[readonly] { cursor: default; }
.prop input::placeholder { color: var(--faint); }
.prop .static { padding: 0 9px; display: flex; align-items: center; gap: 8px; font-size: 13.5px; min-width: 0; }
.prop .static .person span:last-child { max-width: 150px; }
.prop.saved::after { content: "Guardado"; position: absolute; right: 0; font-size: 11.5px; font-weight: 600; color: var(--st-cerrado); animation: saved 1.6s var(--ease) both; pointer-events: none; }
@keyframes saved { 0% { opacity: 0; transform: translateY(3px); } 15%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; } }

.block { display: grid; gap: 8px; }
.block-head { display: flex; align-items: center; gap: 8px; }
.block-head h3 { font-size: 13px; font-weight: 620; color: var(--ink-2); }
.block-head .n { color: var(--muted); font-size: 12px; }
.block-head .btn { margin-left: auto; }
.desc-edit {
  min-height: 48px; resize: none; overflow: hidden; border: 0; border-radius: var(--r-ctl); background: transparent;
  padding: 7px 8px; margin: 0 -8px; width: calc(100% + 16px); line-height: 1.6; color: var(--ink-2);
  transition: background var(--d1), box-shadow var(--d2);
}
.desc-edit:hover:not([readonly]) { background: var(--hover); }
.desc-edit:focus { outline: none; background: var(--control); color: var(--ink); box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-soft); }
.desc-edit[readonly] { cursor: default; }
.desc-edit::placeholder { color: var(--faint); }
.bubble a, .linkable a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 1px; background: var(--sep-strong); }
.ev { position: relative; display: grid; gap: 1px; padding: 6px 0 6px 32px; color: var(--ink-2); font-size: 13px; animation: rise var(--d3) var(--ease) both; }
.ev::before { content: ""; position: absolute; left: 7px; top: 12px; width: 9px; height: 9px; border-radius: 50%; background: var(--window); box-shadow: inset 0 0 0 2px var(--sep-strong); }
.ev.is-status::before { box-shadow: inset 0 0 0 5px var(--sc, var(--sep-strong)); }
.ev > time { order: 2; color: var(--muted); font: 500 11px var(--mono); }
.ev b { color: var(--ink); font-weight: 580; }
.ev .inline-status { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); font-weight: 560; }
.ev .inline-status .svg { width: 12px; height: 12px; color: var(--sc); }
.ev.comment { gap: 4px; padding-left: 32px; }
.ev.comment::before { display: none; }
.ev.comment .avatar { position: absolute; left: 0; top: 6px; width: 24px; height: 24px; z-index: 1; box-shadow: 0 0 0 3px var(--window); }
.ev.comment > time { order: 0; }
.bubble { border-radius: 4px 12px 12px 12px; background: var(--canvas-2); padding: 9px 12px 10px; box-shadow: inset 0 0 0 1px var(--sep); }
.bubble-head { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.bubble-head b { font-weight: 620; }
.bubble-head .icon-btn { margin-left: auto; width: 24px; height: 24px; opacity: 0; }
.bubble-head .icon-btn .svg { width: 14px; height: 14px; }
.bubble:hover .bubble-head .icon-btn, .bubble:focus-within .bubble-head .icon-btn { opacity: 1; }
.bubble p { white-space: pre-wrap; word-wrap: break-word; line-height: 1.5; color: var(--ink); font-size: 13.5px; margin-top: 3px; }

.composer { padding: 12px 16px 14px; border-top: 1px solid var(--sep); background: var(--window); }
.composer .box { border-radius: 12px; background: var(--canvas-2); box-shadow: inset 0 0 0 1px var(--sep-strong); transition: box-shadow var(--d2), background var(--d1); }
.composer .box:focus-within { background: var(--control); box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-soft); }
.composer textarea { display: block; width: 100%; border: 0; resize: none; background: transparent; padding: 10px 12px 2px; min-height: 40px; max-height: 180px; line-height: 1.5; }
.composer textarea:focus { outline: none; }
.composer textarea::placeholder { color: var(--muted); }
.composer .bar-actions { display: flex; align-items: center; gap: 4px; padding: 4px 6px 6px 12px; }
.composer .hint { color: var(--muted); font-size: 11.5px; margin-right: auto; display: inline-flex; align-items: center; gap: 4px; }
.composer .hint kbd { height: 18px; font-size: 10px; }

@keyframes fade-out { to { opacity: 0; } }

/* ------------------------------------------------------------ hojas (modales) */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; background: var(--backdrop); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: grid; place-items: start center; padding: 9vh 16px 16px; overflow-y: auto; animation: fade-in var(--d2) both;
}
.modal-backdrop.closing { animation: fade-out 0.16s var(--ease-in) forwards; }
.modal-backdrop.closing .modal { animation: sheet-out 0.16s var(--ease-in) forwards; }
.modal { width: 100%; max-width: 520px; background: var(--elevated); border-radius: var(--r-sheet); box-shadow: var(--shadow-3); animation: sheet var(--d3) var(--spring) both; }
.modal.wide { max-width: 680px; }
@keyframes sheet { from { transform: translateY(14px) scale(0.97); opacity: 0; } }
@keyframes sheet-out { to { transform: translateY(8px) scale(0.98); opacity: 0; } }
.modal-head { display: flex; align-items: center; position: relative; padding: 20px 56px 0 24px; }
.modal-head h2 { font: 650 18px/1.3 var(--font-display); letter-spacing: -0.025em; text-align: left; }
.modal-head .icon-btn { position: absolute; right: 12px; top: 12px; }
.modal-body { padding: 18px 24px 20px; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--sep); background: var(--canvas-2); border-radius: 0 0 var(--r-sheet) var(--r-sheet); }
.modal-foot .left { margin-right: auto; color: var(--muted); font-size: 12.5px; display: inline-flex; gap: 5px; align-items: center; }
.title-input { font-size: 16px; font-weight: 560; height: 44px; letter-spacing: -0.01em; }
.pending-files { display: flex; flex-wrap: wrap; gap: 10px; }
.pending-file { position: relative; width: 96px; height: 64px; border-radius: 8px; overflow: hidden; background: var(--fill); display: grid; place-items: center; font-size: 11px; color: var(--muted); text-align: center; padding: 4px; box-shadow: 0 0 0 1px var(--sep); animation: pop 0.4s var(--spring) both; }
@keyframes pop { from { transform: scale(0.7); opacity: 0; } }
.pending-file img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pending-file button { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(15, 16, 19, 0.72); color: #fff; display: grid; place-items: center; padding: 0; }
.pending-file button:hover { background: var(--red); }
.pending-file button .svg { width: 11px; height: 11px; }
.attach-zone {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-card); border: 1.5px dashed var(--sep-strong);
  color: var(--muted); font-size: 13px; transition: border-color var(--d1), background var(--d1), color var(--d1);
}
.attach-zone > .svg { width: 20px; height: 20px; color: var(--ink-2); flex: none; }
.attach-zone b { color: var(--ink); }
.attach-zone.dragover { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.attach-zone .btn { margin-left: auto; }

/* ------------------------------------------------------------ paleta de comandos */

.cmdk-backdrop { padding-top: 14vh; }
.cmdk {
  width: 100%; max-width: 620px; background: var(--elevated); border-radius: var(--r-sheet); box-shadow: var(--shadow-3); overflow: hidden;
  animation: sheet var(--d3) var(--spring) both;
}
.cmdk-input { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--sep); }
.cmdk-input .svg { width: 18px; height: 18px; color: var(--muted); }
.cmdk-input input { flex: 1; height: 56px; border: 0; background: transparent; font-size: 16.5px; letter-spacing: -0.01em; }
.cmdk-input input:focus { outline: none; }
.cmdk-input input::placeholder { color: var(--faint); }
.cmdk-list { max-height: min(56vh, 460px); overflow-y: auto; padding: 8px; scroll-padding: 8px; }
.cmdk-group { padding: 10px 10px 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.cmdk-item {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 10px; border-radius: 10px; cursor: pointer; color: var(--ink-2);
}
.cmdk-item .svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.cmdk-item .ci-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-item .ref { flex: none; font-size: 12px; min-width: 54px; }
.cmdk-item .ci-end { flex: none; color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.cmdk-item.on { background: var(--fill); color: var(--ink); }
.cmdk-item.on .ci-enter { opacity: 1; }
.cmdk-item .ci-enter { opacity: 0; }
.cmdk-item mark { background: none; color: var(--ink); font-weight: 650; text-decoration: underline; text-decoration-color: var(--volt); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.cmdk-empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.cmdk-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--sep); background: var(--canvas-2); color: var(--muted); font-size: 12px; }
.cmdk-foot span { display: inline-flex; align-items: center; gap: 5px; }

/* ------------------------------------------------------------ visor a pantalla completa */

.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(8, 9, 11, 0.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); display: grid; grid-template-rows: auto 1fr; animation: fade-in var(--d2); }
.lightbox-bar { display: flex; align-items: center; gap: 12px; height: 54px; padding: 0 12px 0 20px; color: #d6d8dc; font-size: 13px; }
.lightbox-bar .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox-bar .icon-btn { color: #d6d8dc; }
.lightbox-bar .icon-btn:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.lightbox-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 12px 72px 32px; }
.lightbox-stage img { max-width: 100%; max-height: calc(100dvh - 100px); object-fit: contain; border-radius: 6px; animation: zoom-in var(--d3) var(--spring) both; }
@keyframes zoom-in { from { transform: scale(0.94); opacity: 0; } }
.lightbox .nav-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.12); color: #fff; display: grid; place-items: center; transition: background var(--d1), transform var(--d2) var(--spring); }
.lightbox .nav-btn:hover { background: rgba(255, 255, 255, 0.24); transform: translateY(-50%) scale(1.06); }
.lightbox .prev { left: 16px; }
.lightbox .next { right: 16px; }

/* ------------------------------------------------------------ avisos */

#toast-root { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 70; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px; border-radius: 12px;
  background: var(--hud); color: #fff; font-weight: 520; font-size: 13.5px; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06);
  animation: toast-in 0.42s var(--spring) both; pointer-events: auto; max-width: min(560px, calc(100vw - 32px));
}
.toast .t-ic { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--volt); color: var(--volt-ink); flex: none; }
.toast .t-ic .svg { width: 12px; height: 12px; stroke-width: 3; }
.toast.error .t-ic { background: var(--red); color: #fff; }
.toast.error { background: #2a1416; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 90, 95, 0.35); }
.toast.out { animation: toast-out 0.22s var(--ease-in) forwards; }
@keyframes toast-in { from { transform: translateY(16px) scale(0.96); opacity: 0; } }
@keyframes toast-out { to { transform: translateY(8px) scale(0.98); opacity: 0; } }

/* ------------------------------------------------------------ ajustes */

.tabs-wrap { padding: 18px 32px 0; }
.settings-body { padding: 18px 32px 0; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 560; color: var(--muted); padding: 0 14px; height: 36px; border-bottom: 1px solid var(--sep); background: var(--canvas-2); }
.table td { padding: 11px 14px; vertical-align: middle; }
.table tbody tr { transition: background var(--d1); }
.table tbody tr + tr td { border-top: 1px solid var(--sep); }
.table tbody tr:hover td { background: var(--hover); }
.table td.num { color: var(--ink-2); font-family: var(--mono); font-size: 13px; }
.table td.actions { text-align: right; }
.table .r { text-align: right; }
.table.compact td { padding: 9px 14px; }
.table-wrap { overflow-x: auto; border-radius: var(--r-card); box-shadow: 0 0 0 1px var(--sep); }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--fill); color: var(--ink-2); font-size: 12px; font-weight: 520; }
.badge.ok { background: color-mix(in srgb, var(--st-cerrado) 14%, transparent); color: var(--ink); }
.badge.ok::before, .badge.warn::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--st-cerrado); }
.badge.warn { background: color-mix(in srgb, var(--st-en_curso) 18%, transparent); color: var(--ink); }
.badge.warn::before { background: var(--st-en_curso); }
.badge.accent { background: var(--sb-bg); color: var(--volt); }
.settings-card { padding: 22px 24px; max-width: 520px; border-radius: var(--r-sheet); background: var(--window); box-shadow: 0 0 0 1px var(--sep), var(--shadow-1); }
.settings-card h2 { font: 650 16px/1.3 var(--font-display); letter-spacing: -0.02em; margin-bottom: 3px; }
.settings-card p { color: var(--muted); margin-bottom: 16px; }
.settings-card p a { color: var(--accent); text-decoration: underline; }
.settings-card h2:not(:first-child) { margin-top: 26px; }
.settings-card .profile-head + h2 { margin-top: 0; }
.user-mail { font-family: inherit; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.toolbar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.toolbar-row .spacer { flex: 1; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--c); padding: 0; transition: transform var(--d2) var(--spring), box-shadow var(--d2); }
.swatch:hover { transform: scale(1.12); }
.swatch.on { box-shadow: 0 0 0 2px var(--elevated), 0 0 0 4px var(--c); }
.swatches input[type="color"] { width: 30px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer; }
.danger-text { color: var(--red); }
.note { color: var(--muted); font-size: 13px; margin-top: 14px; line-height: 1.55; max-width: 80ch; }
.note b { color: var(--ink-2); }

/* ------------------------------------------------------------ correo */

.mail-page { height: calc(100dvh - 16px); display: grid; grid-template-rows: auto minmax(0, 1fr); padding-bottom: 0; }
.mail-page .toolbar { position: static; }
.mail { display: grid; grid-template-columns: 216px minmax(280px, 360px) minmax(0, 1fr); min-height: 0; }
.mail-narrow { display: none; align-items: center; gap: 6px; }

.mail-boxes { display: flex; flex-direction: column; min-height: 0; padding: 14px 12px 12px; border-right: 1px solid var(--sep); overflow-y: auto; background: var(--canvas-2); }
.mail-boxes .new-btn { margin: 0 0 6px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 1px 0 rgba(0, 0, 0, 0.12); }
.mail-boxes .new-btn .svg { stroke-width: 2; }
.mail-boxes .nav-title { padding-top: 14px; color: var(--muted); }
.mail-boxes .nav a { color: var(--ink-2); }
.mail-boxes .nav a:hover { background: var(--hover); color: var(--ink); }
.mail-boxes .nav a.active { background: var(--fill-2); color: var(--ink); }
.mail-boxes .nav a.active::before { display: none; }
.mail-boxes .nav a .svg { color: var(--muted); }
.mail-boxes .nav a.active .svg { color: var(--ink); }
.mail-boxes .nav a .count { color: var(--muted); }
.mail-boxes .nav a .count.strong { color: var(--ink); font-weight: 650; }
.boxes-foot { margin-top: auto; display: flex; align-items: center; gap: 4px; padding: 10px 2px 0 8px; border-top: 1px solid var(--sep); color: var(--muted); font-size: 12px; }
.boxes-foot span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.boxes-foot .icon-btn { width: 28px; height: 28px; }
.boxes-foot .icon-btn .svg { width: 15px; height: 15px; }
.mail-empty { display: grid; place-items: center; height: 100%; padding: 24px; }
.mail-list { overflow-y: auto; border-right: 1px solid var(--sep); padding: 8px 8px 16px; }
.mrow {
  display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; column-gap: 8px; row-gap: 2px; align-items: center;
  padding: 10px 12px 11px 8px; border-radius: 10px; position: relative; transition: background var(--d1);
}
.mrow + .mrow::before { content: ""; position: absolute; top: 0; left: 26px; right: 12px; border-top: 1px solid var(--sep); }
.mrow:hover { background: var(--hover); }
.mrow.on { background: var(--primary); color: var(--on-primary); }
.mrow.on::before, .mrow.on + .mrow::before { display: none; }
.mrow .dot { grid-row: 1; width: 8px; height: 8px; border-radius: 50%; }
.mrow.unread .dot { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mrow.on.unread .dot { background: var(--volt); }
.mrow .mfrom { font-weight: 520; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mrow.unread .mfrom { font-weight: 700; }
.mrow time { color: var(--muted); font: 500 11.5px var(--mono); white-space: nowrap; }
.mrow .msubj { grid-column: 2; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.mrow .mic { grid-column: 3; display: flex; gap: 3px; justify-content: flex-end; color: var(--muted); }
.mrow .mic .svg { width: 13px; height: 13px; }
.mrow .mic .fl { color: var(--orange-text); display: inline-flex; }
.mrow.on time, .mrow.on .msubj, .mrow.on .mic { color: inherit; opacity: 0.8; }
.mail-more { display: flex; margin: 10px auto 0; }

.mail-reader { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; min-width: 0; }
.mail-reader > .mail-empty { grid-row: 1 / -1; }
.mail-head { padding: 12px 28px 18px; border-bottom: 1px solid var(--sep); display: grid; gap: 14px; animation: rise var(--d3) var(--ease) both; }
.mail-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: -2px -6px 0; }
.tb-group { display: inline-flex; align-items: center; gap: 1px; }
.tb-group + .tb-group { padding-left: 6px; margin-left: 2px; border-left: 1px solid var(--sep); }
.tb-icon.flagged { color: var(--orange-text); }
.tb-icon.flagged .svg { fill: currentColor; }
.tb-icon.danger:hover { color: var(--red); background: var(--red-soft); }
.mail-actions .grow { flex: 1; }
.mail-actions .back { display: none; align-items: center; gap: 2px; color: var(--ink); font-weight: 560; }
.mail-actions .btn .svg { width: 14px; height: 14px; }
.mail-head h2 { font: 650 22px/1.25 var(--font-display); letter-spacing: -0.03em; overflow-wrap: anywhere; }
.mail-from { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mail-from .avatar.lg { width: 38px; height: 38px; font-size: 12.5px; }
.mail-from .who { flex: 1; min-width: 0; line-height: 1.4; }
.mail-from .who b { display: block; font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-from .who b .muted { font-weight: 400; margin-left: 4px; }
.mail-from .who small { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-from time { color: var(--muted); font-size: 12.5px; white-space: nowrap; align-self: start; }
.mail-from time .short { display: none; }
.mail-atts { display: flex; flex-wrap: wrap; gap: 8px; }
.mail-att {
  display: flex; align-items: center; gap: 9px; max-width: 250px; padding: 6px 12px 6px 6px; border-radius: 10px;
  background: var(--canvas-2); box-shadow: inset 0 0 0 1px var(--sep); transition: background var(--d1), transform var(--d2) var(--spring);
}
.mail-att:hover { background: var(--hover); transform: translateY(-1px); }
.mail-att .fi { width: 42px; height: 32px; flex: none; border-radius: 6px; overflow: hidden; display: grid; place-items: center; background: var(--fill); color: var(--muted); }
.mail-att .fi img { width: 100%; height: 100%; object-fit: cover; }
.mail-att .an { min-width: 0; font-size: 12.5px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-att .an small { display: block; color: var(--muted); font: 500 11px var(--mono); }
.mail-frame { width: 100%; height: 100%; border: 0; background: var(--mail-paper); display: block; }
.mail-reader.paper { background: var(--canvas-2); }
.mail-reader.paper .mail-frame { background: #fff; width: calc(100% - 36px); height: calc(100% - 36px); margin: 18px; border-radius: 12px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 12px 30px rgba(0, 0, 0, 0.4); }
.mail-reader.paper .mail-head { background: var(--window); }

.mail-connect { width: 100%; max-width: 400px; display: grid; gap: 8px; text-align: center; animation: rise 0.5s var(--ease) both; }
.mail-connect-ic { justify-self: center; width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 8px; background: var(--sb-bg); color: var(--volt); box-shadow: 0 16px 30px -14px rgba(0, 0, 0, 0.5); }
.mail-connect-ic .svg { width: 28px; height: 28px; stroke-width: 1.7; }
.mail-connect h2 { font: 650 22px/1.25 var(--font-display); letter-spacing: -0.03em; }
.mail-connect > p { color: var(--muted); margin-bottom: 16px; }
.mail-connect form { text-align: left; }
.mail-adv summary { cursor: pointer; color: var(--ink-2); font-size: 13px; font-weight: 560; margin-bottom: 12px; width: max-content; }
.mail-form-foot { display: flex; gap: 8px; align-items: center; }
.mail-connect .mail-form-foot .btn.primary { width: 100%; height: 40px; }
.mail-none .btn { margin-top: 10px; }
.mail-none .btn .svg { width: 14px; height: 14px; }

.compose { display: grid; margin: -18px -24px -20px; }
.crow { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 24px; border-bottom: 1px solid var(--sep); }
.crow > span:first-child { color: var(--muted); width: 58px; flex: none; }
.crow input { flex: 1; min-width: 0; height: 40px; border: 0; background: transparent; padding: 0; }
.crow input:focus { outline: none; }
.crow input[name=subject] { font-weight: 620; }
.crow .cfrom { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Sugerencias de contactos bajo Para / Cc / Cco */
.crow { position: relative; }
.addr-suggest {
  position: absolute; left: 90px; right: 24px; top: calc(100% - 2px); z-index: 5; max-width: 440px; padding: 4px;
  background: var(--elevated); border-radius: 10px; box-shadow: var(--shadow-3);
}
.addr-opt { display: flex; align-items: baseline; gap: 8px; padding: 7px 10px; border-radius: 7px; cursor: pointer; min-width: 0; }
.addr-opt b { font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; max-width: 60%; }
.addr-opt span { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.addr-opt.on { background: var(--fill-2); }
.compose-body { display: block; width: 100%; min-height: 300px; height: 42vh; resize: vertical; border: 0; background: transparent; padding: 16px 24px; line-height: 1.6; font-size: 14px; }
.compose-body:focus { outline: none; }
.compose .attach-zone { margin: 0 24px; }
.compose .attach-zone .svg { width: 14px; height: 14px; vertical-align: -2px; }
.compose .pending-files { padding: 12px 24px 0; }
.mail-note { color: var(--muted); font-size: 12px; margin-top: 14px !important; margin-bottom: 0 !important; }

/* ------------------------------------------------------------ movimiento */

/* Entrada de una vista: los elementos llegan en cascada (solo al cambiar de vista, no al refrescar). */
.enter .stat, .enter .panel, .enter .hello,
.enter .tile, .enter .frow, .enter .tcard, .enter .settings-card, .enter .table-wrap, .enter .wall-head, .enter .column {
  animation: rise 0.5s var(--ease) both;
  animation-delay: calc(min(var(--i, 0), 14) * 28ms);
}
.enter .bar { animation: grow-x 0.8s var(--ease) both; animation-delay: calc(200ms + min(var(--i, 0), 10) * 50ms); }
.enter .spark i { animation: grow-y 0.6s var(--spring) both; animation-delay: calc(250ms + var(--i) * 25ms); }
@keyframes grow-y { from { transform: scaleY(0); } }

/* View Transitions: la vista principal cambia con un fundido corto; la captura vuela al visor. */
@view-transition { navigation: none; }
::view-transition-group(root) { animation-duration: 0.22s; }
::view-transition-old(root) { animation: none; }
::view-transition-new(root) { animation: fade-in 0.24s var(--ease) both; }
html.vt-page .main { view-transition-name: page; }
html.vt-page .segmented .on { view-transition-name: var(--seg, none); }
::view-transition-group(page) { animation: none; }
::view-transition-old(page) { animation: vt-out 0.1s var(--ease-in) both; }
::view-transition-new(page) { animation: vt-in 0.3s var(--ease) both; }
::view-transition-group(seg-estado), ::view-transition-group(seg-vista), ::view-transition-group(seg-tabs) { animation-duration: 0.32s; animation-timing-function: var(--spring); z-index: 2; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }

::view-transition-group(shot) { animation-duration: 0.42s; animation-timing-function: var(--ease); z-index: 3; }
::view-transition-old(shot), ::view-transition-new(shot) { height: 100%; width: 100%; object-fit: cover; object-position: top; animation-duration: 0.42s; overflow: clip; border-radius: 8px; }
::view-transition-group(inspector) { animation-duration: 0.36s; }
::view-transition-new(inspector):only-child { animation: panel-in 0.4s var(--ease) both; }
::view-transition-old(inspector):only-child { animation: panel-out 0.2s var(--ease-in) both; }
@keyframes panel-in { from { transform: translateX(40px); opacity: 0; } }
@keyframes panel-out { to { transform: translateX(30px); opacity: 0; } }

/* Anterior / siguiente: la captura se desliza en la dirección del movimiento. */
html[data-nav="next"]::view-transition-old(shot) { animation: slide-out-l 0.28s var(--ease-in) both; }
html[data-nav="next"]::view-transition-new(shot) { animation: slide-in-r 0.38s var(--ease) both; }
html[data-nav="prev"]::view-transition-old(shot) { animation: slide-out-r 0.28s var(--ease-in) both; }
html[data-nav="prev"]::view-transition-new(shot) { animation: slide-in-l 0.38s var(--ease) both; }
html[data-nav]::view-transition-group(shot) { animation: none; }
@keyframes slide-out-l { to { transform: translateX(-60px); opacity: 0; } }
@keyframes slide-out-r { to { transform: translateX(60px); opacity: 0; } }
@keyframes slide-in-r { from { transform: translateX(60px); opacity: 0; } }
@keyframes slide-in-l { from { transform: translateX(-60px); opacity: 0; } }

/* Tablero y muro: cada tarjeta viaja a su nuevo sitio. */
::view-transition-group(*.card) { animation-duration: 0.45s; animation-timing-function: var(--spring); }
::view-transition-old(*.card), ::view-transition-new(*.card) { height: 100%; }
/* El indicador activo de la barra lateral se desliza. */
::view-transition-group(nav-active) { animation-duration: 0.35s; animation-timing-function: var(--spring); }

/* ------------------------------------------------------------ adaptable */

@media (max-width: 1280px) {
  .flist-head, .frow { grid-template-columns: 56px 64px minmax(0, 1fr) 120px 96px 140px 60px; }
  .frow .proj, .flist-head .proj { display: none; }
  .viewer { grid-template-columns: minmax(0, 1fr) 360px; }
  .drawer-loading { grid-template-columns: minmax(0, 1fr) 360px; }
}
@media (max-width: 1180px) {
  .dash-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mail { grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); }
  .mail-boxes { display: none; }
  .mail-narrow { display: inline-flex; }
  .segmented .lbl { display: none; }
}
@media (max-width: 860px) {
  :root { --bar-h: 52px; }
  .shell { grid-template-columns: 1fr; background: var(--window); }
  .main { border-radius: 0; margin: 0; box-shadow: none; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 284px; z-index: 40; transform: translateX(-102%);
    transition: transform 0.36s var(--ease), box-shadow 0.36s;
  }
  .sidebar.open { transform: none; box-shadow: 30px 0 80px -20px rgba(0, 0, 0, 0.6); }
  .shell:has(.sidebar.open)::after { content: ""; position: fixed; inset: 0; z-index: 39; background: var(--backdrop); animation: fade-in var(--d2); }
  .mobile-bar {
    position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 10px;
    background: var(--sb-bg); color: var(--sb-ink);
  }
  .mobile-bar .icon-btn { color: var(--sb-ink); width: 40px; height: 40px; }
  .mobile-bar .brand { flex: 1; }
  .mobile-bar .brand-sub { color: var(--sb-muted); }
  .mobile-bar .mb-new { width: 40px; height: 40px; border-radius: 10px; border: 0; display: grid; place-items: center; background: var(--volt); color: var(--volt-ink); }
  .mobile-bar .mb-new .svg { width: 18px; height: 18px; stroke-width: 2.4; }
  .toolbar { position: static; padding: 12px 16px; gap: 8px; }
  .tb-title h1 { font-size: 20px; }
  .tb-search, .tb-search:focus-within { width: 100%; order: 10; }
  .tb-search input { height: 40px; }
  .tb-search::after { display: none; }
  .toolbar .segmented { order: 11; }
  .toolbar .segmented:not(.icons) { flex: 1 1 0; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .toolbar .segmented:not(.icons) button { flex: none; padding: 0 10px; }
  .filterbar, .wall, .page > .content, .tabs-wrap, .settings-body { padding-left: 16px; padding-right: 16px; }
  .wall-head { margin: 0 -16px; padding-left: 16px; padding-right: 16px; top: 0; }
  .wall-head .hint { display: none; }
  .flist { margin-left: 16px; margin-right: 16px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
  .tile .cap .tt { font-size: 13.5px; }
  .tile .cap .meta .chip.project { display: none; }
  .stats, .stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stats.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { min-height: 104px; padding: 12px; border-radius: 12px; }
  .stat .top { font-size: 12.5px; align-items: flex-start; line-height: 1.25; }
  .stat .top .svg { display: none; }
  .stat .value { font-size: 28px; margin-top: 10px; }
  .stat .label { font-size: 11.5px; line-height: 1.3; }
  .stat:not(.feature) .spark { display: none; }
  .stat.feature { grid-column: 1 / -1; min-height: 116px; }
  .stat.feature .top .svg { display: inline-block; }
  .modal-foot .left { display: none; }
  .hello h2 { font-size: 24px; }
  .flist-head { display: none; }
  .frow { grid-template-columns: 56px minmax(0, 1fr) auto; padding: 8px 12px; row-gap: 4px; }
  .frow .ref, .frow .who, .frow .when, .frow .proj, .frow > span:nth-child(5), .frow .title .chip, .frow .title .meta-ic { display: none; }
  .frow .status-pill { grid-column: 3; grid-row: 1; }
  .drawer { left: 0; top: 0; bottom: 0; border-radius: 0; }
  .viewer { grid-template-columns: 1fr; grid-template-rows: auto auto; overflow-y: auto; }
  .drawer-loading { grid-template-columns: 1fr; }
  .drawer-loading .sk-side { border-left: 0; }
  .stage-main { min-height: 260px; padding: 18px; }
  .inspector { border-left: 0; border-top: 1px solid var(--sep); display: block; }
  .insp-scroll { overflow: visible; }
  .composer { position: sticky; bottom: 0; }
  .vbar .ctitle .muted, .vbar .back kbd, .vbar .navs span { display: none; }
  .board { padding: 14px 16px 0; grid-template-columns: repeat(4, minmax(260px, 82vw)); scroll-snap-type: x mandatory; }
  .column { scroll-snap-align: start; }
  .board-hint { margin-left: 16px; margin-right: 16px; }
  .modal-backdrop { padding: 0; place-items: end center; }
  .modal { border-radius: 20px 20px 0 0; max-height: 94dvh; overflow-y: auto; animation-name: sheet-up; }
  @keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
  .modal-foot { position: sticky; bottom: 0; border-radius: 0; }
  .cmdk-backdrop { padding-top: 8vh; place-items: start center; padding-left: 12px; padding-right: 12px; }
  .mail-page { height: calc(100dvh - 54px); }
  .mail { grid-template-columns: 1fr; }
  .compose-body { height: 34vh; min-height: 200px; }
  .mail-list { border-right: 0; }
  .mail.has-msg .mail-list, .mail:not(.has-msg) .mail-reader { display: none; }
  .mail-actions .back { display: inline-flex; }
  .mail-head { padding: 10px 16px 14px; }
  .mail-from time .long { display: none; }
  .mail-from time .short { display: inline; }
  .lightbox-stage { padding: 8px 8px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .toolbar, .vbar, .flist-head { backdrop-filter: none; background: var(--window); }
}
@media (forced-colors: active) {
  .status-pill, .chip, .badge, .btn, .popup { border: 1px solid CanvasText; }
}

/* ------------------------------------------------------------ añadidos */
.filters-btn .fcount { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--volt); color: var(--volt-ink); font: 650 11px var(--mono); }
.auth.solo .btn.primary { background: var(--volt); color: var(--volt-ink); }
.auth.solo .btn.primary:hover { background: #d6f85a; }
.hello .btn { height: 40px; }
.shortcuts { display: grid; grid-template-columns: 1fr auto; gap: 10px 24px; align-items: center; font-size: 14px; }
.shortcuts dt { color: var(--ink-2); }
.shortcuts dd { margin: 0; display: inline-flex; gap: 4px; justify-self: end; }
.shortcuts h3 { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 6px; }

/* ------------------------------------------------------------ vista previa en la lista */
.peek {
  position: fixed; z-index: 45; width: 384px; max-width: calc(100vw - 16px); border-radius: 14px; overflow: hidden;
  background: var(--elevated); box-shadow: var(--shadow-3); pointer-events: none;
}
.peek.in { animation: peek-in 0.18s var(--ease) both; }
.peek.in.up { animation-name: peek-in-up; }
@keyframes peek-in { from { opacity: 0; transform: translateY(-4px) scale(0.985); } }
@keyframes peek-in-up { from { opacity: 0; transform: translateY(4px) scale(0.985); } }
.peek .pk-shot { aspect-ratio: 16 / 8; background: var(--canvas-2); border-bottom: 1px solid var(--sep); overflow: hidden; }
.peek .pk-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.peek .pk-body { display: grid; gap: 9px; padding: 12px 14px; }
.peek .pk-top { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; }
.peek .pk-top .chip.project { min-width: 0; overflow: hidden; }
.peek .pk-sp { flex: 1; }
.peek .pk-title { font: 620 15px/1.35 var(--font-display); letter-spacing: -0.015em; }
.peek .pk-desc { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.peek .pk-desc.muted { color: var(--muted); }
.peek .pk-meta { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 5px 10px; margin: 0; font-size: 12.5px; }
.peek .pk-meta dt { color: var(--muted); }
.peek .pk-meta dd { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.peek .pk-comment { font-size: 12.5px; line-height: 1.45; padding: 8px 10px; border-radius: 4px 10px 10px 10px; background: var(--canvas-2); box-shadow: inset 0 0 0 1px var(--sep); overflow-wrap: anywhere; }
.peek .pk-comment span { display: block; margin-bottom: 2px; color: var(--muted); font-size: 11.5px; }
.peek .pk-foot { display: flex; align-items: center; gap: 12px; padding-top: 9px; border-top: 1px solid var(--sep); color: var(--muted); font-size: 12px; }
.peek .pk-foot > span:not(.pk-sp) { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); }
.peek .pk-foot .svg { width: 13px; height: 13px; }
@media (hover: none) { .peek { display: none !important; } }

/* Listas desplegables nativas: que las opciones sigan el tema (en oscuro salían en blanco sobre blanco). */
select { color-scheme: inherit; }
select option, select optgroup { background-color: var(--elevated); color: var(--ink); }
/* Color opaco: el desplegable nativo pinta sobre blanco, así que un relleno translúcido se veía blanco. */
select option:checked { background: linear-gradient(var(--volt), var(--volt)); background-color: var(--volt); color: var(--volt-ink); font-weight: 600; }
select option:disabled { color: var(--muted); }

/* ------------------------------------------------------------ mensajes: grupos */
.chat-group-ic { width: 100%; height: 100%; display: grid; place-items: center; border-radius: 50%; background: var(--sb-bg); color: var(--volt); }
.chat-group-ic .svg { width: 17px; height: 17px; }
.chat-head-title { display: grid; min-width: 0; flex: 1; text-align: left; border: 0; background: none; padding: 4px 8px; margin: -4px -8px; border-radius: var(--r-ctl); color: inherit; cursor: pointer; }
.chat-head-title:hover { background: var(--hover); }
.chat-head-title b, .chat-head-title small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head-title small { color: var(--muted); font-size: 12px; }
.cmsg-notice { display: flex; justify-content: center; margin: 10px 0; }
.cmsg-notice span { max-width: 80%; padding: 4px 12px; border-radius: 999px; background: var(--fill); color: var(--muted); font-size: 12px; text-align: center; }
.chat-find { width: 100%; }
.chat-find::after { display: none; }
.chat-pick-hint { margin: 0; font-size: 12.5px; }
.group-members { display: grid; gap: 2px; max-height: 40vh; overflow-y: auto; }
.group-member { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 6px; border-radius: var(--r-ctl); }
.group-member:hover { background: var(--hover); }
.group-member > span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-member .avatar { width: 28px; height: 28px; font-size: 10.5px; }
.chat-pick-hint.is-warn { color: var(--orange-text); font-weight: 600; }

/* Avisos de mensajes: tarjetas abajo a la derecha y la franja que pide permiso */
#chat-pops { position: fixed; bottom: 20px; right: 20px; z-index: 75; display: grid; gap: 10px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.chat-pop {
  position: relative; pointer-events: auto; border-radius: 14px; background: var(--elevated); color: var(--ink);
  box-shadow: var(--shadow-3), 0 0 0 1px var(--sep); animation: pop-in 0.42s var(--spring) both; overflow: hidden;
}
.chat-pop::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--volt); }
.chat-pop.out { animation: pop-out 0.22s var(--ease-in) forwards; }
.chat-pop-main { display: flex; gap: 11px; align-items: flex-start; padding: 12px 40px 12px 15px; color: inherit; text-decoration: none; }
.chat-pop-main:hover { background: var(--hover); }
.chat-pop-main .avatar { flex: none; margin-top: 1px; }
.chat-pop-tx { display: grid; gap: 2px; min-width: 0; }
.chat-pop-head { display: flex; align-items: center; gap: 7px; min-width: 0; }
.chat-pop-head b { font-size: 13.5px; font-weight: 640; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-pop-head small { margin-left: auto; color: var(--faint); font-size: 11.5px; flex: none; }
.chat-pop-body { font-size: 13px; color: var(--ink-2); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.chat-pop-x { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; }
@keyframes pop-in { from { transform: translateY(16px) scale(0.97); opacity: 0; } }
@keyframes pop-out { to { transform: translateX(16px); opacity: 0; } }
@media (max-width: 560px) { #chat-pops { top: 10px; bottom: auto; right: 10px; left: 10px; width: auto; } .chat-pop { animation-name: pop-in-top; } }
@keyframes pop-in-top { from { transform: translateY(-16px) scale(0.97); opacity: 0; } }

.chat-ask {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 32px 14px; padding: 10px 12px 10px 14px;
  border-radius: var(--r-card); background: var(--accent-soft); color: var(--ink); font-size: 13px;
}
.chat-page:has(.chat-ask) { grid-template-rows: auto auto minmax(0, 1fr); }
.chat-ask > .svg { flex: none; color: var(--accent); }
.chat-ask > span { flex: 1 1 260px; }
@media (max-width: 860px) { .chat-ask { margin: 0 16px 12px; } }

.alert-opts { display: grid; gap: 12px; }
.alert-opts .check { align-items: flex-start; }
.alert-opts .check input { margin-top: 2px; flex: none; }
.alert-opts .check span { display: grid; gap: 2px; }
.alert-opts .check small { color: var(--muted); font-size: 12.5px; }
.alert-opts .check.is-off { cursor: default; }
.alert-opts .check.is-off b { color: var(--muted); }

/* Quién está en un grupo o canal: las caras en la cabecera de la conversación */
.chat-people {
  display: inline-flex; align-items: center; gap: 6px; flex: none; height: 34px; padding: 0 10px 0 6px; border-radius: 17px;
  border: 0; background: var(--fill); color: var(--ink-2); font: inherit; font-size: 12.5px; cursor: pointer;
}
.chat-people:hover { background: var(--fill-2); color: var(--ink); }
.chat-people-faces { display: inline-flex; padding-left: 6px; }
.chat-people-faces .avatar { width: 24px; height: 24px; font-size: 9.5px; margin-left: -6px; box-shadow: 0 0 0 2px var(--window); }
.chat-people > .svg { width: 15px; height: 15px; }
.chat-people b { font-weight: 640; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .chat-people-faces { display: none; } }

/* Mensajes que salen: «Enviando…» y «No enviado» con Reintentar */
.cmsg.pending .cmsg-bubble { opacity: 0.72; }
.cmsg-ticks.sending { color: var(--muted); }
.cmsg-ticks.failed { color: var(--red-text); }
.cmsg-ticks.failed .svg { width: 14px; height: 14px; }
.cmsg.failed .cmsg-bubble { box-shadow: inset 0 0 0 1.5px var(--red); }
.cmsg-fail { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px 10px; margin: 4px 2px 0; font-size: 12px; color: var(--red-text); text-align: right; }
.cmsg-fail .link-btn { border: 0; background: none; padding: 0; font: inherit; font-weight: 640; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

/* Botón verde «Lista para revisar»: satisfactorio de pulsar */
.review-btn {
  position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: center; gap: 12px; width: 100%; margin: 0 0 14px;
  padding: 12px 14px; border: 0; border-radius: 14px; cursor: pointer; text-align: left; font: inherit; color: #fff;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 10px 24px -12px rgba(22, 163, 74, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.2s var(--spring), box-shadow 0.2s, filter 0.2s;
}
.review-btn::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.28) 50%, transparent 65%);
  transform: translateX(-120%); transition: transform 0.7s ease;
}
.review-btn:hover:not(:disabled) { transform: translateY(-1px); filter: saturate(1.12); box-shadow: 0 14px 28px -12px rgba(22, 163, 74, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.review-btn:hover:not(:disabled)::after { transform: translateX(120%); }
.review-btn:active:not(:disabled) { transform: scale(0.97); }
.review-btn:focus-visible { outline: 3px solid color-mix(in srgb, #22c55e 55%, transparent); outline-offset: 2px; }
.review-btn:disabled { cursor: default; }
.review-btn > :not(.rb-fill) { position: relative; z-index: 2; }
.review-btn .rb-fill { position: absolute; inset: 0; z-index: 0; background: linear-gradient(135deg, #16a34a, #15803d); transform: scaleX(0); transform-origin: left; transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1); }
.review-btn .rb-ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; background: rgba(255, 255, 255, 0.2); transition: background 0.3s, transform 0.3s var(--spring); }
.review-btn .rb-ic svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.review-btn .rb-check { stroke-dasharray: 24; stroke-dashoffset: 0; }
.review-btn .rb-tx { display: grid; gap: 1px; flex: 1; min-width: 0; }
.review-btn .rb-tx b { font-size: 14.5px; font-weight: 680; letter-spacing: -0.01em; }
.review-btn .rb-tx small { font-size: 12px; opacity: 0.88; }
.review-btn .rb-arrow { display: grid; transition: opacity 0.2s, transform 0.25s var(--spring); }
.review-btn .rb-arrow .svg { width: 18px; height: 18px; }
.review-btn:hover:not(:disabled) .rb-arrow { transform: translateX(3px); }
.review-btn.is-done .rb-fill { transform: scaleX(1); }
.review-btn.is-done .rb-ic { background: #fff; transform: scale(1.12); }
.review-btn.is-done .rb-ic svg { stroke: #16a34a; }
.review-btn.is-done .rb-check { animation: rb-draw 0.5s 0.22s cubic-bezier(0.65, 0, 0.35, 1) both; }
.review-btn.is-done .rb-arrow { opacity: 0; transform: translateX(10px); }
@keyframes rb-draw { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }
.rb-ring { position: fixed; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%; border: 3px solid #4ade80; pointer-events: none; z-index: 80; }
.confetti { position: fixed; pointer-events: none; z-index: 80; border-radius: 2px; will-change: transform, opacity; }
@media (prefers-reduced-motion: reduce) {
  .review-btn .rb-fill, .review-btn::after { transition: none; }
  .review-btn.is-done .rb-check { animation: none; }
}

/* Panel flotante de Unai: tuyas y del equipo */
.my-float {
  position: fixed; z-index: 33; width: 340px; max-height: min(460px, 62vh); display: flex; flex-direction: column; overflow: hidden;
  border-radius: 16px; background: color-mix(in srgb, var(--elevated) 98%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-3), 0 0 0 1px var(--sep); animation: mf-in 0.4s var(--spring) both;
}
.my-float.min { width: auto; max-height: none; border-radius: 999px; }
.my-float.dragging { box-shadow: 0 24px 50px -16px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--sep-strong, var(--sep)); }
@keyframes mf-in { from { transform: translateY(12px) scale(0.97); opacity: 0; } }
.mf-head { display: flex; align-items: center; gap: 6px; padding: 8px 6px; border-bottom: 1px solid var(--sep); cursor: grab; user-select: none; touch-action: none; }
.my-float.dragging .mf-head { cursor: grabbing; }
.mf-grip { display: grid; color: var(--faint); }
.mf-grip .svg { width: 14px; height: 14px; }
.mf-tabs { display: flex; flex: 1; gap: 2px; padding: 3px; border-radius: 10px; background: var(--fill); }
.mf-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 8px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.mf-tabs button[aria-selected="true"] { background: var(--elevated); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.mf-tabs b, .mf-pill b { min-width: 18px; padding: 0 6px; border-radius: 9px; background: var(--fill-2); font-size: 11px; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.mf-list { display: grid; gap: 2px; padding: 6px; overflow-y: auto; }
.mf-row { display: grid; grid-template-columns: 16px auto minmax(0, 1fr) auto; align-items: center; gap: 8px; width: 100%; padding: 8px; border: 0; border-radius: 9px; background: none; text-align: left; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; }
.mf-row:hover { background: var(--hover); }
.mf-row.on { background: var(--selected); }
.mf-row .status-ic { width: 15px; height: 15px; }
.mf-ref { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.mf-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mf-empty { margin: 0; padding: 18px 10px; text-align: center; color: var(--muted); font-size: 13px; }
.mf-pill { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border: 0; background: none; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; }
.mf-pill .svg { width: 15px; height: 15px; color: var(--muted); }
@media (max-width: 860px) { .my-float { display: none; } }

/* El panel no forma parte de la transición entre páginas: se queda quieto mientras la página cambia debajo */
.my-float { view-transition-name: my-float; }
::view-transition-group(my-float), ::view-transition-new(my-float) { animation: none; }
::view-transition-old(my-float) { display: none; }

/* Celebración 3D a pantalla completa (public/celebracion.js) */
.c3d-layer {
  position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: 0; transition: opacity 0.35s ease;
  background: radial-gradient(circle at 50% 45%, rgba(34, 197, 94, 0.24), rgba(6, 12, 9, 0.42) 55%, rgba(6, 12, 9, 0.55));
}
.c3d-layer.in { opacity: 1; }
.c3d-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.c3d-label {
  position: absolute; left: 50%; top: 68%; display: grid; gap: 6px; text-align: center; white-space: nowrap; color: #fff;
  opacity: 0; transform: translate(-50%, 18px) scale(0.9); transition: opacity 0.35s ease, transform 0.55s var(--spring);
}
.c3d-label b { font-size: clamp(30px, 4.4vw, 56px); font-weight: 760; letter-spacing: -0.03em; text-shadow: 0 6px 34px rgba(22, 163, 74, 0.75), 0 2px 8px rgba(0, 0, 0, 0.5); }
.c3d-label span { font-size: 15px; font-weight: 600; opacity: 0.92; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); }
.c3d-label.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.c3d-label.out { opacity: 0; transform: translate(-50%, -12px) scale(0.98); transition-duration: 0.4s; }

/* ------------------------------------------------------------ :okey: (unai.deleon) */
.cmsg-thumb { display: inline-block; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }
.cmsg-body.okey-solo { font-size: 40px; line-height: 1.1; }
.okey-fx { position: fixed; inset: 0; z-index: 2000; pointer-events: none; overflow: hidden; contain: strict; }
.okey-fx > * { position: absolute; }
.okey-bg { inset: 0; opacity: 0; background: radial-gradient(circle at 50% 50%, rgba(40, 52, 4, 0.82), rgba(6, 7, 10, 0.94) 70%); }
.okey-flash { inset: 0; opacity: 0; background: radial-gradient(circle at 50% 50%, #fff, rgba(200, 240, 49, 0.6) 35%, transparent 70%); }
.okey-ring { left: 50%; top: 50%; width: 160vmax; height: 160vmax; border: 6px solid var(--volt); border-radius: 50%; opacity: 0; box-shadow: 0 0 40px var(--volt), inset 0 0 40px var(--volt); }
.okey-thumb { line-height: 1; transform: translate(-50%, -50%) scale(0); font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.5)); will-change: transform; }
.okey-word { left: 50%; top: 50%; display: flex; opacity: 0; font: 900 min(30vw, 42vh)/1 "Geist", system-ui, sans-serif; letter-spacing: -0.05em; white-space: nowrap; color: var(--volt); text-shadow: 0 0 30px rgba(200, 240, 49, 0.75), 0 0 90px rgba(200, 240, 49, 0.45), 0 0.06em 0 #4f6d00; }
.okey-word span { display: inline-block; }
.okey-rocket { width: 4px; height: 70px; margin-top: 35px; border-radius: 4px; opacity: 0; background: linear-gradient(to bottom, #fff, var(--c) 30%, transparent); box-shadow: 0 0 10px var(--c); }
.okey-glow { width: 120px; height: 120px; border-radius: 50%; opacity: 0; background: radial-gradient(circle, #fff, var(--c) 30%, transparent 70%); }
.okey-spark { width: 6px; height: 6px; border-radius: 50%; opacity: 0; background: var(--c); box-shadow: 0 0 6px var(--c), 0 0 14px var(--c); }
.okey-spark.thumb { width: auto; height: auto; background: none; box-shadow: none; font-size: 28px; line-height: 1; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }

/* ------------------------------------------------------------ >;-D (unai.deleon, unai.fernandez, roberto) */
.cmsg-wink, .cmsg-flex { display: inline-block; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }
.cmsg.guino-hold .cmsg-bubble { visibility: hidden; }
.guino-fx { position: fixed; inset: 0; z-index: 2000; pointer-events: none; overflow: hidden; contain: strict; }
.guino-shake { position: absolute; inset: 0; }
.guino-bg { position: absolute; inset: -60px; opacity: 0; background: radial-gradient(ellipse at 50% 62%, rgba(34, 38, 58, 0.78), rgba(6, 7, 12, 0.92) 75%); }
.guino-bg::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 0 2px, transparent 2px 4px); }
.guino-stage { position: absolute; inset: 0; }
.guino-canvas { position: absolute; left: 0; top: 0; image-rendering: pixelated; }
.guino-msg { position: absolute; left: 0; top: 0; display: block; margin: 0; max-width: none; will-change: transform; }
.guino-msg .cmsg-bubble { box-sizing: border-box; margin: 0; }
.guino-msg.long .cmsg-bubble { max-height: 420px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 78%, transparent); mask-image: linear-gradient(#000 78%, transparent); }
.guino-cracks { position: absolute; inset: 0; width: 100%; height: 100%; overflow: hidden; pointer-events: none; }
.guino-cracks path { fill: none; stroke-width: 2.4; stroke-linejoin: miter; stroke-linecap: square; }
.guino-cracks .lo { stroke: #15111a; }
.guino-cracks .hi { stroke: rgba(255, 255, 255, 0.7); stroke-width: 1.2; }

/* Favoritos del chat: el mensaje marcado se destaca en dorado (solo para quien lo marca) */
.cmsg.starred .cmsg-bubble {
  box-shadow: inset 0 0 0 1.5px #e9b10d, 0 0 0 4px rgba(233, 177, 13, 0.14);
  background-image: linear-gradient(rgba(250, 204, 21, 0.11), rgba(250, 204, 21, 0.11));
}
.cmsg.starred .cmsg-bubble::after {
  content: ""; position: absolute; top: -9px; right: -8px; width: 20px; height: 20px; border-radius: 50%;
  background: #f5b301 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M12 3.6l2.55 5.17 5.7.83-4.12 4.02.97 5.68L12 16.62l-5.1 2.68.97-5.68L3.75 9.6l5.7-.83z'/%3E%3C/svg%3E") center / 13px no-repeat;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25), 0 0 0 2px var(--window);
}
.cmsg.mine.starred .cmsg-bubble::after { right: auto; left: -8px; }
.cmsg.just-starred .cmsg-bubble::after { animation: star-pop 0.55s var(--spring) both; }
.cmsg.just-starred .cmsg-bubble { animation: star-glow 0.9s ease-out; }
@keyframes star-pop { 0% { transform: scale(0) rotate(-60deg); } 70% { transform: scale(1.35) rotate(12deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes star-glow { 0% { box-shadow: inset 0 0 0 1.5px #e9b10d, 0 0 0 0 rgba(245, 179, 1, 0.55); } 100% { box-shadow: inset 0 0 0 1.5px #e9b10d, 0 0 0 14px rgba(245, 179, 1, 0); } }
.cmsg-star.on { color: #e9a400; }
.cmsg-star.on .svg, .chat-stars-btn:hover .svg { fill: currentColor; }
.chat-stars-btn:hover { color: #e9a400; }
.cmsg.flash .cmsg-bubble { animation: star-flash 1.6s ease-out; }
@keyframes star-flash { 0%, 30% { background-color: rgba(250, 204, 21, 0.35); } 100% { background-color: transparent; } }

.star-list { display: grid; gap: 4px; max-height: 60vh; overflow-y: auto; }
.star-item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 8px; border-radius: var(--r-ctl); }
.star-item:hover { background: var(--hover); }
.star-item .avatar { width: 28px; height: 28px; font-size: 10.5px; margin-top: 2px; }
.star-go { display: grid; gap: 2px; min-width: 0; padding: 0; border: 0; background: none; text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.star-meta { display: flex; align-items: baseline; gap: 8px; }
.star-meta b { font-size: 13px; font-weight: 640; }
.star-meta small { font-size: 11.5px; color: var(--muted); }
.star-text { font-size: 13px; color: var(--ink-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; }
.star-item.expanded .star-text { display: block; -webkit-line-clamp: unset; }
.star-off { color: #e9a400; }
.star-off .svg { fill: currentColor; }
.star-empty { display: grid; justify-items: center; gap: 6px; padding: 26px 10px; text-align: center; color: var(--muted); }
.star-empty .svg { width: 28px; height: 28px; color: #e9a400; }
.star-empty b { color: var(--ink); }

/* Panel flotante: también se arrastra desde la barrita de abajo */
.mf-foot { display: grid; place-items: center; flex: none; height: 16px; border-top: 1px solid var(--sep); cursor: grab; touch-action: none; user-select: none; }
.mf-foot span { width: 38px; height: 4px; border-radius: 2px; background: var(--sep-strong, var(--sep)); transition: background 0.15s, width 0.2s var(--spring); }
.mf-foot:hover span { width: 54px; background: var(--muted); }
.my-float.dragging .mf-foot { cursor: grabbing; }

/* Proyectos en la barra lateral: «N por aprobar» y «+ Nuevo» juntos a la derecha */
.nav-title-acts { display: inline-flex; align-items: center; gap: 12px; }

/* Despliegues: rueda de progreso con lo que le queda (estimado con lo que tardaron los anteriores) */
.dep-live {
  --p: 0; display: flex; align-items: center; gap: 12px; margin: 8px 0 4px; padding: 10px 12px; min-width: min(380px, 62vw);
  border-radius: 12px; background: color-mix(in srgb, var(--st-revision) 10%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--st-revision) 28%, transparent);
}
.dep-ring { width: 44px; height: 44px; flex: none; transform: rotate(-90deg); }
.dep-ring circle { fill: none; stroke-width: 4.5; }
.dep-ring .trk { stroke: var(--fill-2); }
.dep-ring .val { stroke: var(--st-revision); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--p)); transition: stroke-dashoffset 1s linear; }
.dep-live.over .dep-ring { animation: spin 1.1s linear infinite; }
.dep-live.over .dep-ring .val { stroke: var(--st-en_curso); stroke-dashoffset: 72; transition: none; }
.dep-tx { display: grid; gap: 4px; flex: 1; min-width: 0; }
.dep-pct { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dep-eta { font-size: 12px; color: var(--muted); line-height: 1.35; }
.dep-bar { height: 4px; border-radius: 2px; background: var(--fill-2); overflow: hidden; }
.dep-bar i { position: relative; display: block; height: 100%; width: calc(var(--p) * 1%); border-radius: 2px; overflow: hidden;
  background: linear-gradient(90deg, var(--st-revision), #7dd3fc); transition: width 1s linear; }
.dep-bar i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent); animation: dep-shine 1.6s ease-in-out infinite; }
.dep-live.over .dep-bar i { width: 100%; background: repeating-linear-gradient(-45deg, var(--st-en_curso) 0 8px, color-mix(in srgb, var(--st-en_curso) 55%, transparent) 8px 16px); background-size: 200% 100%; animation: dep-stripes 1s linear infinite; }
@keyframes dep-shine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes dep-stripes { to { background-position: -45px 0; } }
.dep-done { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.dep-done .svg { width: 13px; height: 13px; }
.dep-done.fallido, .dep-done.revertido { color: var(--red-text); }
@media (prefers-reduced-motion: reduce) { .dep-live.over .dep-ring, .dep-bar i::after, .dep-live.over .dep-bar i { animation: none; } }

/* «Tú»: la conversación contigo mismo, arriba del todo al empezar una conversación */
.chat-self-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; margin-bottom: 4px; text-align: left;
  border: 1px dashed var(--sep-strong); border-radius: 10px; background: transparent; color: inherit; font: inherit; cursor: pointer;
}
.chat-self-btn:hover { background: var(--hover); border-style: solid; }
.chat-self-btn .avatar { width: 28px; height: 28px; font-size: 11px; flex: none; }
.chat-self-btn span { display: grid; gap: 1px; flex: 1; min-width: 0; }
.chat-self-btn small { color: var(--muted); font-size: 12px; }
.chat-self-btn svg { width: 16px; height: 16px; opacity: 0.6; flex: none; }
