/* Mesa de Proyecto · TALI — estilos (mobile primero). Marca TALI: navy y dorado. */
:root {
  --navy: #273a53;
  --navy-osc: #1b2a3d;
  --navy-claro: #e4eaf2;
  --oro: #e8ce75;
  --oro-osc: #84691a;
  --oro-claro: #faf1d4;
  --fondo: #f5f3ee;
  --tarjeta: #ffffff;
  --texto: #1e2733;
  --suave: #5c6875;
  --linea: #e3dfd5;
  --rojo: #b8382b;
  --rojo-claro: #fbe9e6;
  --ambar: #b97c06;
  --ambar-claro: #fdf2d8;
  --verde: #2c7a4c;
  --verde-claro: #e3f2e8;
  --gris: #7d8894;
  --gris-claro: #eef0f2;
  --radio: 14px;
  --sombra: 0 1px 2px rgba(20, 30, 45, 0.06), 0 6px 16px rgba(20, 30, 45, 0.05);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --alto-barra: 56px;
  --alto-tabs: 64px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font: 15px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }

/* ---------- barra superior ---------- */
.barra {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  min-height: var(--alto-barra);
  padding: env(safe-area-inset-top) 16px 0;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  background: var(--navy); color: #fff;
}
.barra-logo { display: flex; align-items: center; height: var(--alto-barra); }
.barra-logo img { height: 26px; width: auto; display: block; }
.barra-titulo { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.barra-titulo span { font-family: var(--serif); font-size: 16px; letter-spacing: 0.02em; color: var(--oro); }
.barra-titulo small { font-size: 11.5px; color: rgba(255, 255, 255, 0.72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra-titulo small.error { color: #ffb4a8; }
.barra-yo {
  width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--oro);
  background: transparent; color: var(--oro); font-weight: 600; cursor: pointer;
}

/* ---------- pestañas ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--tarjeta); border-top: 1px solid var(--linea);
}
.tabs a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: var(--alto-tabs); padding: 6px 2px;
  color: var(--suave); text-decoration: none; font-size: 11.5px; font-weight: 500;
}
.tabs a svg { width: 22px; height: 22px; }
.tabs a[aria-current="page"] { color: var(--navy); }
.tabs a[aria-current="page"] svg { stroke: var(--navy); }
.tabs a .punto { position: relative; }
.tabs a .contador {
  position: absolute; top: -4px; right: -10px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--rojo); color: #fff; font-size: 10.5px; line-height: 17px; text-align: center;
}

@media (min-width: 900px) {
  .tabs {
    position: sticky; top: var(--alto-barra); bottom: auto; border-top: 0; border-bottom: 1px solid var(--linea);
    display: flex; justify-content: center; gap: 4px; padding: 0 16px;
  }
  .tabs a { flex-direction: row; gap: 8px; min-height: 48px; padding: 0 16px; font-size: 14px; border-bottom: 2px solid transparent; }
  .tabs a[aria-current="page"] { border-bottom-color: var(--oro); }
  .tabs a svg { width: 18px; height: 18px; }
}

/* ---------- contenido ---------- */
.vista {
  max-width: 980px; margin: 0 auto;
  padding: 16px max(16px, env(safe-area-inset-right)) calc(var(--alto-tabs) + 32px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  outline: none;
}
@media (min-width: 900px) { .vista { padding-bottom: 48px; } }
.cargando { padding: 48px 0; text-align: center; color: var(--suave); }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--navy); margin: 0; }
h1 { font-size: 24px; line-height: 1.2; }
h2 { font-size: 18px; }
h3 { font-size: 15px; font-family: var(--sans); }
.sub { color: var(--suave); margin: 4px 0 0; }
.seccion { margin-top: 24px; }
.seccion-cab { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.seccion-cab a { font-size: 13.5px; text-decoration: none; font-weight: 500; }
.vacio { color: var(--suave); padding: 14px 16px; background: var(--tarjeta); border-radius: var(--radio); border: 1px dashed var(--linea); }

.tarjeta { background: var(--tarjeta); border-radius: var(--radio); box-shadow: var(--sombra); padding: 16px; }
.tarjeta + .tarjeta { margin-top: 12px; }

/* avisos */
.aviso { border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.aviso p { margin: 0; flex: 1; }
.aviso.info { background: var(--navy-claro); color: var(--navy-osc); }
.aviso.alerta { background: var(--ambar-claro); color: #6b4a05; }
.aviso.error { background: var(--rojo-claro); color: #7a2016; }
.aviso button { background: none; border: 0; color: inherit; cursor: pointer; font-size: 18px; line-height: 1; padding: 0 2px; }

/* indicadores */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px; }
@media (min-width: 640px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi {
  display: block; text-decoration: none; color: var(--texto);
  background: var(--tarjeta); border-radius: var(--radio); box-shadow: var(--sombra); padding: 14px; border-top: 3px solid var(--gris-claro);
}
.kpi b { display: block; font-family: var(--serif); font-size: 30px; line-height: 1; color: var(--navy); }
.kpi span { display: block; margin-top: 6px; font-size: 13px; color: var(--suave); }
.kpi.rojo { border-top-color: var(--rojo); } .kpi.rojo b { color: var(--rojo); }
.kpi.ambar { border-top-color: var(--ambar); } .kpi.ambar b { color: var(--ambar); }
.kpi.navy { border-top-color: var(--navy); }
.kpi.verde { border-top-color: var(--verde); } .kpi.verde b { color: var(--verde); }

.resumen-yo { display: flex; align-items: center; gap: 12px; margin-top: 12px; text-decoration: none; color: var(--texto); }
.resumen-yo .flecha { margin-left: auto; color: var(--suave); }

/* ---------- filas de tareas ---------- */
.lista { display: flex; flex-direction: column; gap: 8px; }
.tarea {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: start;
  background: var(--tarjeta); border-radius: 12px; box-shadow: var(--sombra);
  padding: 12px 14px 12px 12px; border-left: 4px solid var(--gris-claro);
  text-decoration: none; color: var(--texto);
}
.tarea:active { transform: scale(0.995); }
.tarea .id { font-size: 12px; font-weight: 700; color: var(--navy); background: var(--navy-claro); border-radius: 6px; padding: 2px 6px; margin-top: 1px; }
.tarea .titulo { font-weight: 550; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tarea .meta { grid-column: 2; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 12.5px; color: var(--suave); }
.tarea .meta .vence { font-weight: 600; }
.tarea .mini { grid-column: 2; height: 4px; border-radius: 2px; background: var(--gris-claro); overflow: hidden; margin-top: 4px; }
.tarea .mini i { display: block; height: 100%; background: var(--navy); }
.s-vencida { border-left-color: var(--rojo); } .s-vencida .vence { color: var(--rojo); }
.s-por-vencer { border-left-color: var(--ambar); } .s-por-vencer .vence { color: var(--ambar); }
.s-en-termino { border-left-color: var(--verde); }
.s-cerrada { border-left-color: #9cc9ad; opacity: 0.85; }
.s-oculta { border-left-color: var(--gris); opacity: 0.7; }
.s-sin-fecha { border-left-color: var(--gris-claro); }
.s-en-curso { border-left-color: var(--navy); }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--gris-claro); color: #4a5561;
}
.e-en-curso { background: var(--navy-claro); color: var(--navy); }
.e-en-revision { background: var(--oro-claro); color: var(--oro-osc); }
.e-bloqueado { background: var(--rojo-claro); color: var(--rojo); }
.e-hecho { background: var(--verde-claro); color: var(--verde); }
.e-fuera-de-alcance, .e-fusionada { background: #f1f1f1; color: var(--gris); font-style: italic; }
.critica { color: var(--rojo); font-weight: 700; font-size: 11.5px; letter-spacing: 0.02em; text-transform: uppercase; }
.etiqueta { font-size: 11.5px; font-weight: 600; color: var(--oro-osc); background: var(--oro-claro); padding: 1px 7px; border-radius: 6px; }

/* grupos colapsables */
details.grupo { margin-top: 16px; }
details.grupo > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
details.grupo > summary::-webkit-details-marker { display: none; }
details.grupo > summary h2::after { content: " ›"; color: var(--suave); }
details.grupo[open] > summary h2::after { content: " ⌄"; }
.cuenta { font-size: 12px; font-weight: 700; color: var(--suave); background: var(--gris-claro); border-radius: 999px; padding: 1px 8px; }

/* segmentos y filtros */
.segmentos { display: flex; background: var(--gris-claro); border-radius: 12px; padding: 3px; gap: 3px; margin-top: 14px; }
.segmentos button, .segmentos a { flex: 1; text-align: center; text-decoration: none; border: 0; background: transparent; border-radius: 9px; padding: 8px 6px; font-weight: 600; font-size: 13.5px; color: var(--suave); cursor: pointer; }
.segmentos button[aria-pressed="true"], .segmentos a[aria-pressed="true"] { background: var(--tarjeta); color: var(--navy); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }

.filtros { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.filtros .buscar { grid-column: 1 / -1; }
@media (min-width: 760px) { .filtros { grid-template-columns: 2fr repeat(4, 1fr); } .filtros .buscar { grid-column: auto; } }
.campo, .filtros input, .filtros select, .form input, .form select, .form textarea {
  width: 100%; border: 1px solid var(--linea); border-radius: 10px; background: var(--tarjeta);
  padding: 10px 12px; min-height: 44px; font-size: 15px;
}
.form textarea { min-height: 96px; resize: vertical; }
.filtros input:focus, .filtros select:focus, .form input:focus, .form select:focus, .form textarea:focus {
  outline: 2px solid var(--oro); outline-offset: 1px; border-color: var(--oro);
}
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--suave); margin-top: 10px; }
.check input { width: 18px; height: 18px; accent-color: var(--navy); }
.total { margin: 14px 0 8px; font-size: 13px; color: var(--suave); }

/* ---------- tablero ---------- */
.tablero { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 12px; margin: 14px -16px 0; padding-left: 16px; padding-right: 16px; }
.columna { flex: 0 0 82%; max-width: 320px; scroll-snap-align: start; background: #ebe8e0; border-radius: var(--radio); padding: 10px; }
@media (min-width: 900px) { .columna { flex-basis: 280px; } }
.columna-cab { display: flex; align-items: center; justify-content: space-between; margin: 2px 4px 10px; }
.columna .lista { gap: 8px; }
.columna .tarea { box-shadow: none; }

/* ---------- detalle ---------- */
.volver { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; font-weight: 500; font-size: 14px; margin-bottom: 12px; background: none; border: 0; color: var(--navy); padding: 4px 0; cursor: pointer; }
.detalle-cab { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.detalle-cab .id { font-weight: 700; color: var(--navy); background: var(--navy-claro); border-radius: 6px; padding: 2px 8px; }
.detalle-cab .fase { font-size: 13px; color: var(--suave); }
.vence-grande { font-weight: 600; margin-top: 8px; }
.vence-grande.vencida { color: var(--rojo); } .vence-grande.por-vencer { color: var(--ambar); } .vence-grande.en-termino { color: var(--verde); }
.datos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 0; }
.datos div { min-width: 0; }
.datos dt { font-size: 12px; color: var(--suave); text-transform: uppercase; letter-spacing: 0.04em; }
.datos dd { margin: 2px 0 0; font-weight: 500; overflow-wrap: anywhere; }
.datos .ancho { grid-column: 1 / -1; }
.enlaces { display: flex; flex-wrap: wrap; gap: 6px; }
.enlace-tarea { display: inline-flex; gap: 6px; align-items: center; text-decoration: none; background: var(--gris-claro); border-radius: 999px; padding: 4px 10px 4px 6px; font-size: 13px; color: var(--texto); }
.enlace-tarea b { color: var(--navy); }

.editar h2 { margin-bottom: 12px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form label > span, .form .etq { display: block; font-size: 13px; font-weight: 600; color: var(--suave); margin-bottom: 6px; }
.opciones { display: flex; flex-wrap: wrap; gap: 8px; }
.opciones button {
  border: 1.5px solid var(--linea); background: var(--tarjeta); border-radius: 999px; padding: 8px 14px; min-height: 40px;
  font-weight: 600; font-size: 13.5px; color: var(--suave); cursor: pointer;
}
.opciones button[aria-pressed="true"] { border-color: var(--navy); background: var(--navy); color: #fff; }
.rango { display: flex; align-items: center; gap: 12px; }
.rango input[type="range"] { flex: 1; accent-color: var(--navy); min-height: 32px; padding: 0; border: 0; background: none; }
.rango output { min-width: 48px; text-align: right; font-weight: 700; color: var(--navy); }
.botones { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  border: 0; border-radius: 12px; padding: 12px 18px; min-height: 46px; font-weight: 650; cursor: pointer;
  background: var(--navy); color: #fff;
}
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.secundario { background: var(--gris-claro); color: var(--navy); }
.btn.oro { background: var(--oro); color: var(--navy-osc); }
.btn.ancho { width: 100%; }
.nota-permiso { font-size: 13.5px; color: var(--suave); margin: 0; }
.cambio-pendiente { font-size: 13px; color: var(--ambar); font-weight: 600; }

.historial { list-style: none; margin: 0; padding: 0; }
.historial li { position: relative; padding: 0 0 14px 18px; border-left: 2px solid var(--linea); margin-left: 5px; }
.historial li::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--oro); border: 2px solid var(--tarjeta); }
.historial li:last-child { border-left-color: transparent; }
.historial .quien { font-size: 12.5px; color: var(--suave); }
.historial .quien b { color: var(--texto); }
.historial p { margin: 2px 0 0; overflow-wrap: anywhere; }
.historial li.pendiente { opacity: 0.6; }
.historial .tarea-ref { font-weight: 700; color: var(--navy); text-decoration: none; }

details.notas summary { cursor: pointer; font-weight: 600; color: var(--navy); }
.texto-largo { white-space: pre-wrap; overflow-wrap: anywhere; margin: 10px 0 0; font-size: 14px; }

/* barras de avance por fase */
.fases { display: flex; flex-direction: column; gap: 12px; }
.fase-fila { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 13.5px; }
.fase-fila .barra-fase { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--gris-claro); overflow: hidden; }
.fase-fila .barra-fase i { display: block; height: 100%; background: linear-gradient(90deg, var(--navy), #3d5a80); border-radius: 4px; }
.fase-fila small { color: var(--suave); }

/* hitos */
.hitos { display: flex; flex-direction: column; gap: 8px; }
.hito { display: flex; gap: 12px; align-items: center; background: var(--tarjeta); border-radius: 12px; padding: 12px 14px; box-shadow: var(--sombra); }
.hito .dias { min-width: 64px; text-align: center; font-family: var(--serif); color: var(--navy); }
.hito .dias b { display: block; font-size: 22px; line-height: 1; }
.hito .dias small { font-size: 11px; color: var(--suave); font-family: var(--sans); }
.hito .texto { flex: 1; min-width: 0; }
.hito .texto small { color: var(--suave); }
.hito.legal .dias b { color: var(--rojo); }

/* minutas */
.minuta { display: block; text-decoration: none; color: var(--texto); }
.minuta .fecha { font-size: 12.5px; font-weight: 700; color: var(--oro-osc); text-transform: uppercase; letter-spacing: 0.04em; }
.minuta h3 { font-family: var(--serif); font-size: 17px; margin: 2px 0 6px; color: var(--navy); }
.minuta p { margin: 0; color: var(--suave); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; }
.puntos { margin: 6px 0 0; padding-left: 0; list-style: none; }
.puntos li { padding: 6px 0 6px 18px; position: relative; border-bottom: 1px solid var(--gris-claro); font-size: 14.5px; }
.puntos li:last-child { border-bottom: 0; }
.puntos li::before { content: ""; position: absolute; left: 2px; top: 14px; width: 6px; height: 6px; border-radius: 50%; background: var(--oro); }

/* login */
.entrada { max-width: 420px; margin: 24px auto 0; }
.entrada .logo-grande { background: var(--navy); border-radius: var(--radio); padding: 28px 20px; text-align: center; }
.entrada .logo-grande img { height: 44px; width: auto; }
.entrada .logo-grande p { color: var(--oro); font-family: var(--serif); margin: 12px 0 0; font-size: 18px; }
.pin { letter-spacing: 0.6em; text-align: center; font-size: 22px !important; font-weight: 700; }

/* toast y modal */
.toast {
  position: fixed; left: 16px; right: 16px; margin: 0 auto; width: fit-content; z-index: 40;
  bottom: calc(var(--alto-tabs) + 16px + env(safe-area-inset-bottom));
  max-width: 480px; padding: 12px 16px; border-radius: 12px;
  background: var(--navy-osc); color: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); font-size: 14px;
}
.toast.error { background: #7a2016; }
.toast.ok { background: #1f5c39; }
@media (min-width: 900px) { .toast { bottom: 24px; } }
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(15, 22, 33, 0.5); display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 640px) { .modal { align-items: center; } }
.modal-caja {
  background: var(--tarjeta); width: 100%; max-width: 520px; max-height: 88vh; overflow: auto;
  border-radius: 18px 18px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
}
@media (min-width: 640px) { .modal-caja { border-radius: 18px; } }
.modal-caja h2 { margin-bottom: 8px; }
.comparar { width: 100%; border-collapse: collapse; margin: 12px 0 16px; font-size: 14px; }
.comparar th, .comparar td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--linea); vertical-align: top; }
.comparar th { font-size: 12px; color: var(--suave); text-transform: uppercase; letter-spacing: 0.04em; }
.pasos { padding-left: 20px; margin: 8px 0 0; }
.pasos li { margin-bottom: 6px; }

/* ---------- por persona ---------- */
.lista-personas { display: flex; flex-direction: column; gap: 10px; }
details.persona > summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 10px; }
details.persona > summary::-webkit-details-marker { display: none; }
.persona-cab { display: flex; align-items: center; gap: 12px; }
.persona-cab .flecha { color: var(--suave); transition: transform 0.15s; }
details.persona[open] .persona-cab .flecha { transform: rotate(180deg); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--navy); color: var(--oro); display: grid; place-items: center; font-weight: 700; flex: none; }
.crece { flex: 1; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.persona-cuerpo { border-top: 1px solid var(--linea); margin-top: 14px; padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.persona-cuerpo h3 { margin: 4px 0 0; color: var(--suave); font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }
.persona-cuerpo .tarea { box-shadow: none; border: 1px solid var(--linea); border-left-width: 4px; }
.rigi-resumen .barra-fase { display: block; height: 8px; border-radius: 4px; background: var(--gris-claro); overflow: hidden; margin-top: 8px; }
.rigi-resumen .barra-fase i { display: block; height: 100%; background: linear-gradient(90deg, var(--oro-osc), var(--oro)); }
@media (min-width: 760px) { .filtros-rigi { grid-template-columns: 2fr 1fr 1fr; } }

/* ---------- dónde estamos ---------- */
.donde .seccion-cab { margin-bottom: 4px; }
.donde-prog { padding: 14px 0 4px; }
.donde-prog + .donde-prog { border-top: 1px solid var(--linea); margin-top: 10px; }
.donde-tit { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.donde-tit b { font-family: var(--serif); font-size: 17px; color: var(--navy); }
.donde-linea { position: relative; height: 8px; border-radius: 4px; background: var(--gris-claro); margin: 18px 8px 8px; }
.donde-linea .relleno { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: linear-gradient(90deg, var(--navy), #4a6a94); }
.d-hito {
  position: absolute; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; border: 2px solid var(--tarjeta);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}
.d-hoy { position: absolute; top: -9px; bottom: -9px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--oro-osc); }
.d-hoy::before { content: ""; position: absolute; top: -5px; left: -4px; border: 5.5px solid transparent; border-top-color: var(--oro-osc); }
.donde-ejes { display: flex; justify-content: space-between; gap: 8px; color: var(--suave); font-size: 11.5px; margin: 0 2px 8px; }
.donde-ejes small:nth-child(2) { color: var(--oro-osc); font-weight: 700; }
.donde-txt { margin: 6px 0 0; font-size: 14px; line-height: 1.45; }
.donde-txt > span:first-child { color: var(--suave); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; margin-right: 4px; }
.donde-txt .cuando { color: var(--oro-osc); }
.quien-chico { color: var(--suave); font-size: 12.5px; }
.h-P { background: var(--navy); } .h-B { background: var(--verde); } .h-V { background: var(--rojo); }

/* ---------- Gantt ---------- */
.gantt { background: var(--tarjeta); border-radius: var(--radio); box-shadow: var(--sombra); overflow: hidden; --g-etq: 148px; }
@media (min-width: 760px) { .gantt { --g-etq: 240px; } }
.g-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.g-lienzo { position: relative; min-width: 100%; }
.g-fondo { position: absolute; inset: 0; pointer-events: none; }
.g-banda { position: absolute; top: 0; bottom: 0; background: #f7f5ef; }
.g-fila { position: relative; display: flex; min-height: 40px; border-bottom: 1px solid #efece4; }
.g-etq {
  position: sticky; left: 0; z-index: 3; flex: 0 0 var(--g-etq); width: var(--g-etq);
  background: var(--tarjeta); border-right: 1px solid var(--linea); padding: 6px 10px; display: flex; flex-direction: column; justify-content: center;
  font-size: 12.5px; line-height: 1.25;
}
.g-etq .g-nom { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.g-etq small { color: var(--suave); font-size: 11.5px; margin-top: 2px; }
.g-pista { position: relative; flex: none; }
.g-cab { min-height: 42px; background: var(--tarjeta); border-bottom: 1px solid var(--linea); }
.g-cab .g-etq { font-size: 11px; color: var(--suave); text-transform: uppercase; letter-spacing: 0.05em; }
.g-mes { position: absolute; top: 0; bottom: 0; display: flex; flex-direction: column; justify-content: center; padding-left: 6px; border-left: 1px solid var(--linea); font-size: 12px; color: var(--navy); }
.g-mes small { font-size: 10px; color: var(--suave); }
.g-mes.par { background: #f7f5ef; }
.g-prog { min-height: 34px; background: var(--navy); border-bottom: 0; }
.g-prog .g-etq { background: var(--navy); color: var(--oro); font-family: var(--serif); font-size: 15px; border-right-color: rgba(255,255,255,0.15); }
.g-prog .g-pista { background: var(--navy); }
.g-etapa { min-height: 28px; }
.g-etapa .g-etq { background: #fbfaf6; }
.g-etapa-txt { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.g-etapa-txt.prep { color: var(--navy); } .g-etapa-txt.formal { color: var(--oro-osc); }
.g-hitos { min-height: 44px; }
.g-hitos .g-etq { color: var(--suave); font-weight: 600; }
.g-hito {
  position: absolute; top: 50%; width: 18px; height: 18px; margin-top: -9px; transform: rotate(45deg); border-radius: 3px;
  display: grid; place-items: center; color: #fff; font-size: 10px; font-weight: 800; font-style: normal; z-index: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.g-hito b { transform: rotate(-45deg); line-height: 1; }
.g-hito.hecho { opacity: 0.45; }
.g-hito-txt { position: absolute; top: 50%; transform: translateY(-50%); font-size: 11.5px; font-weight: 600; white-space: nowrap; color: var(--texto); }
.g-barra {
  position: absolute; top: 9px; height: 22px; border-radius: 6px; z-index: 1;
  display: flex; align-items: center; padding: 0 8px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.g-barra span { overflow: hidden; text-overflow: ellipsis; }
.g-barra.prep { background: linear-gradient(90deg, var(--navy), #42618b); color: #fff; }
.g-barra.formal { background: linear-gradient(90deg, #b9952f, var(--oro)); color: var(--navy-osc); }
.g-barra.hecha { opacity: 0.45; }
.g-barra.en-curso { outline: 2px solid var(--oro-osc); outline-offset: 2px; }
.g-barra.continua { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.g-barra.continua::after { content: "›"; position: absolute; right: -12px; color: var(--suave); font-size: 16px; }
.g-barra.angosta span { position: absolute; left: calc(100% + 6px); color: var(--texto); }
.g-hoy { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--oro-osc); z-index: 2; pointer-events: none; }
.g-hoy span {
  position: absolute; top: 4px; left: 4px; white-space: nowrap; font-size: 10.5px; font-weight: 800; color: #fff;
  background: var(--oro-osc); padding: 1px 6px; border-radius: 4px; z-index: 5;
}
.g-leyenda { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 12px 14px; font-size: 12px; color: var(--suave); border-top: 1px solid var(--linea); }
.g-leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 18px; height: 9px; border-radius: 3px; }
.lg.prep { background: var(--navy); } .lg.formal { background: var(--oro); }
.lg.en-curso { background: transparent; outline: 2px solid var(--oro-osc); outline-offset: 1px; }
.lg.hecha { background: var(--navy); opacity: 0.45; }
.lg.hoy { width: 3px; height: 14px; background: var(--oro-osc); }
.g-hito.mini { position: static; width: 13px; height: 13px; margin: 0 2px; font-size: 8px; }

/* ---------- objetivo de la carpeta ---------- */
.objetivo .obj-cab { display: flex; align-items: center; gap: 14px; }
.obj-dias { min-width: 64px; text-align: center; font-family: var(--serif); color: var(--oro-osc); background: var(--oro-claro); border-radius: 12px; padding: 8px 6px; }
.obj-dias b { display: block; font-size: 26px; line-height: 1; }
.obj-dias small { font-size: 11px; font-family: var(--sans); color: var(--oro-osc); }
a.fase-fila { text-decoration: none; color: var(--texto); }

/* lo propio dentro de la vista de todos */
.tuyo { font-size: 11px; font-weight: 800; color: var(--navy-osc); background: var(--oro); padding: 1px 7px; border-radius: 6px; letter-spacing: 0.02em; }
details.persona.mia { box-shadow: 0 0 0 2px var(--oro), var(--sombra); }

/* ---------- asistentes de IA ---------- */
.tabs.seis a { font-size: 10.5px; }
.lista-asistentes { display: flex; flex-direction: column; gap: 12px; }
.lista-asistentes .tarjeta + .tarjeta { margin-top: 0; }
.tarjeta-asistente { display: flex; gap: 14px; align-items: flex-start; text-decoration: none; color: inherit; }
.tarjeta-asistente h3 { font-family: var(--serif); font-size: 17px; color: var(--navy); }
.tarjeta-asistente p { margin: 4px 0 0; color: var(--suave); font-size: 14px; }
.asistente-icono { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--navy); color: var(--oro); display: grid; place-items: center; }
.asistente-icono svg { width: 24px; height: 24px; }
.base-lista { margin: 10px 0; padding-left: 18px; font-size: 14px; }
.base-lista li { margin: 6px 0; }
.chat { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.chat .aviso { margin-bottom: 0; }
.msg { max-width: 92%; border-radius: 16px; padding: 10px 14px; font-size: 14.5px; overflow-wrap: anywhere; }
.msg p { margin: 0 0 8px; }
.msg p:last-child, .msg ul:last-child { margin-bottom: 0; }
.msg ul { margin: 0 0 8px; padding-left: 18px; }
.msg li { margin: 3px 0; }
.msg.persona { align-self: flex-end; background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.msg.ia { align-self: flex-start; background: var(--tarjeta); box-shadow: var(--sombra); border-bottom-left-radius: 4px; }
.msg-doc { display: inline-block; font-size: 11.5px; font-weight: 700; background: var(--oro); color: var(--navy-osc); border-radius: 6px; padding: 0 6px; margin-bottom: 4px; }
.cita { font-size: 12px; font-weight: 600; color: var(--oro-osc); background: var(--oro-claro); border-radius: 6px; padding: 0 5px; }
.fuentes { margin-top: 10px; border-top: 1px solid var(--gris-claro); padding-top: 6px; font-size: 12.5px; color: var(--suave); }
.fuentes summary { cursor: pointer; font-weight: 600; }
.fuentes ul { margin: 6px 0 0; padding-left: 16px; }
.pensando { display: flex; gap: 5px; padding: 14px 16px; }
.pensando span { width: 7px; height: 7px; border-radius: 50%; background: var(--gris); animation: latido 1.2s infinite ease-in-out; }
.pensando span:nth-child(2) { animation-delay: 0.15s; }
.pensando span:nth-child(3) { animation-delay: 0.3s; }
@keyframes latido { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .pensando span { animation: none; } }
.sugerencias { display: flex; flex-direction: column; gap: 8px; }
.sugerencias button { text-align: left; border: 1.5px solid var(--linea); background: var(--tarjeta); border-radius: 12px; padding: 10px 14px; font-size: 14px; color: var(--navy); cursor: pointer; }
.sugerencias button:disabled { opacity: 0.5; cursor: default; }
.chat-form { margin-top: 14px; }
.chat-pie { font-size: 12.5px; margin-top: 10px; }
.enlace { background: none; border: 0; color: var(--navy); font-weight: 600; font-size: 13.5px; cursor: pointer; padding: 4px 0; white-space: nowrap; }
.boton-ia { display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; margin-top: 14px; }
.boton-ia svg { width: 18px; height: 18px; }
.ia-minuta summary { cursor: pointer; color: var(--navy); }
.ia-minuta .form { margin-top: 12px; }
.aviso a { color: inherit; text-decoration: none; font-size: 16px; padding: 0 2px; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

/* ---------- globo flotante del asistente ---------- */
.globo-ia {
  position: fixed; z-index: 30;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(var(--alto-tabs) + 16px + env(safe-area-inset-bottom));
  width: 60px; height: 60px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; cursor: pointer;
  box-shadow: 0 8px 22px rgba(20, 30, 45, 0.3), 0 0 0 3px #fff;
  animation: flotar 4s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
}
.globo-ia img { width: 60px; height: 60px; border-radius: 50%; display: block; }
.globo-ia::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--oro);
  animation: halo 3s ease-out infinite; pointer-events: none;
}
.globo-ia:active { transform: scale(0.94); }
.globo-saludo {
  position: absolute; right: 72px; top: 50%; transform: translateY(-50%);
  white-space: nowrap; background: var(--tarjeta); color: var(--navy); font-weight: 700; font-size: 13.5px;
  padding: 8px 12px; border-radius: 12px; box-shadow: var(--sombra);
}
.globo-saludo::after {
  content: ""; position: absolute; right: -6px; top: 50%; margin-top: -6px;
  border-width: 6px 0 6px 7px; border-style: solid; border-color: transparent transparent transparent var(--tarjeta);
}
@keyframes flotar { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes halo { 0% { opacity: 0.7; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(1.4); } }
body.con-globo .vista { padding-bottom: calc(var(--alto-tabs) + 104px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) {
  .globo-ia { bottom: 28px; right: 28px; }
  body.con-globo .vista { padding-bottom: 112px; }
}

/* ---------- panel de chat del globo ---------- */
body.panel-abierto { overflow: hidden; }
.panel-ia { position: fixed; inset: 0; z-index: 45; display: flex; align-items: flex-end; justify-content: flex-end; }
.panel-fondo { position: absolute; inset: 0; border: 0; padding: 0; background: rgba(15, 22, 33, 0.38); cursor: pointer; }
.panel-caja {
  position: relative; width: 100%; height: min(88vh, 720px); display: flex; flex-direction: column;
  background: var(--fondo); border-radius: 20px 20px 0 0; overflow: hidden;
  box-shadow: 0 -10px 34px rgba(20, 30, 45, 0.28); animation: subir 0.22s ease-out;
}
@media (min-width: 700px) {
  .panel-ia { padding: 24px; }
  .panel-caja { width: 420px; height: min(680px, calc(100vh - 48px)); border-radius: 20px; box-shadow: 0 16px 44px rgba(20, 30, 45, 0.32); }
}
@keyframes subir { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.panel-cab { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--navy); color: #fff; }
.panel-cab img { width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 0 0 2px #fff; flex: none; }
.panel-titulo { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.panel-titulo b { font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--oro); }
.panel-titulo small { font-size: 12px; color: rgba(255, 255, 255, 0.75); }
.panel-cerrar, .panel-nueva { background: none; border: 0; color: #fff; cursor: pointer; font-weight: 600; }
.panel-cerrar { font-size: 18px; padding: 6px 8px; }
.panel-nueva { font-size: 13px; padding: 6px 4px; color: var(--oro); }
.panel-agentes { margin: 10px 14px 0; }
.panel-doc { margin: 10px 14px 0; }
.panel-doc button { background: none; border: 0; color: inherit; cursor: pointer; font-size: 15px; }
.panel-mensajes { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.panel-mensajes .aviso { margin-bottom: 0; }
.panel-pie { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: var(--tarjeta); border-top: 1px solid var(--linea); }
.panel-pie .chat-form { margin: 0; flex-direction: row; align-items: flex-end; gap: 8px; }
.panel-pie .chat-form textarea { flex: 1; min-height: 46px; max-height: 120px; }
.panel-pie .chat-form .btn { flex: none; padding: 12px 14px; }
.panel-pie .chat-pie { margin: 6px 0 0; font-size: 11.5px; color: var(--suave); }
@media (prefers-reduced-motion: reduce) {
  .globo-ia, .globo-ia::after, .panel-caja { animation: none; }
}
