/* Estilos específicos de cada vista */

/* ---- Proyectos ---- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.project-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  background: var(--bg);
  transition: box-shadow .15s, transform .15s;
}
.project-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.project-cover { height: 110px; position: relative; }
.project-emoji {
  position: absolute; top: 12px; left: 12px;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: var(--bg);
  border-radius: 9px;
  font-size: 19px;
  box-shadow: var(--shadow);
}
.project-body { padding: 14px 16px 6px; }
.project-foot {
  display: flex; align-items: center;
  padding: 10px 16px 14px;
}
.cover-swatch {
  width: 52px; height: 34px;
  border-radius: 7px;
  border: 2px solid transparent;
  cursor: pointer;
}
.cover-swatch.selected { border-color: var(--accent); outline: 2px solid var(--accent-soft); }

/* ---- Resumen del proyecto ---- */
.overview-banner { height: 150px; position: relative; }
.overview-emoji {
  position: absolute; bottom: -20px; left: 32px;
  width: 56px; height: 56px;
  display: grid; place-items: center;
  background: var(--bg);
  border-radius: 14px;
  font-size: 28px;
  box-shadow: var(--shadow);
}
.overview-banner + .view-body { padding-top: 40px; }
.section-title { font-size: 15px; margin: 28px 0 12px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.stat-tile {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
}
.stat-dot { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.stat-num { font-size: 22px; font-weight: 700; }

/* ---- Lista de elementos ---- */
.items-body { padding: 8px 24px 60px; }
.list-group { margin-top: 18px; }
.list-group-head {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.list-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.list-row:hover { background: var(--bg-hover); }
.list-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Kanban ---- */
.kanban {
  display: flex; gap: 14px;
  align-items: flex-start;
  overflow-x: auto;
  padding: 16px 24px 40px;
  min-height: 60vh;
}
.kanban-col {
  min-width: 300px; width: 300px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column;
  max-height: calc(100vh - 210px);
}
.kanban-col-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
}
.kanban-body {
  flex: 1;
  overflow-y: auto;
  padding: 2px 8px;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 60px;
}
.kanban-body.drag-over { background: var(--accent-soft); border-radius: var(--radius); }
.kanban-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  cursor: grab;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.kanban-card:hover { border-color: var(--border-2); }
.kanban-card.dragging { opacity: .45; }
.kanban-add {
  display: flex; align-items: center; gap: 6px;
  margin: 6px 8px 10px;
  padding: 6px 8px;
  color: var(--text-2);
  border-radius: var(--radius);
}
.kanban-add:hover { background: var(--bg-hover); color: var(--text); }

/* ---- Barra de filtros ---- */
.filter-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  background: var(--bg);
}
.layout-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.layout-toggle .icon-btn { border-radius: 0; }
.layout-toggle .icon-btn.active { background: var(--accent-soft); color: var(--accent); }
.prop-pill.filter-active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---- Panel de detalle ---- */
.panel-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 14, 20, .3);
  z-index: 90;
  display: flex; justify-content: flex-end;
}
.item-panel {
  width: min(680px, 94vw);
  height: 100%;
  background: var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: panel-in .18s ease-out;
}
@keyframes panel-in { from { transform: translateX(30px); opacity: 0; } }
.panel-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.panel-scroll { flex: 1; overflow-y: auto; padding: 18px 22px 40px; }
.panel-title {
  width: 100%;
  border: none; outline: none; resize: none;
  background: none;
  font-size: 19px; font-weight: 650;
  color: var(--text);
  font-family: inherit;
  line-height: 1.35;
}
.panel-desc {
  margin-top: 8px;
  min-height: 60px;
  outline: none;
  color: var(--text-2);
  line-height: 1.55;
  border-radius: var(--radius);
  padding: 6px 8px;
  margin-left: -8px;
}
.panel-desc:hover, .panel-desc:focus { background: var(--bg-2); }
.panel-desc:focus { color: var(--text); }
.panel-section-title {
  font-size: 12px; font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase; letter-spacing: .05em;
  margin: 22px 0 10px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.panel-props { display: flex; flex-direction: column; gap: 8px; }
.panel-prop { display: flex; align-items: center; gap: 10px; }
.panel-prop-label { width: 110px; flex-shrink: 0; color: var(--text-2); font-size: 13px; }
.panel-feed { padding-bottom: 20px; }
.comment { display: flex; gap: 10px; padding: 9px 0; }
.comment-body { margin-top: 3px; line-height: 1.5; }
.activity-row {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.activity-row:last-child { border-bottom: none; }

/* ---- Inicio ---- */
.home-greeting { text-align: center; margin: 26px 0 34px; }
.home-greeting h1 {
  font-size: 30px;
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -.01em;
}
.home-greeting p { margin-top: 8px; text-transform: capitalize; font-weight: 500; }

.home-section-head {
  display: flex; align-items: center; gap: 8px;
  margin: 32px 0 12px;
}
.home-section-head h3 { font-size: 15px; }
.link-accent {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--accent);
  font-weight: 500;
  font-size: 13.5px;
  padding: 4px 8px;
  border-radius: 6px;
}
.link-accent:hover { background: var(--accent-soft); }

/* Flow AI: acento propio (verde azulado, distinto del azul de marca, del
   verde de "hecho" y del ámbar de "advertencia") y serif en las respuestas,
   sobre los fondos del tema de la app para que combine. */
.ai-card, .ai-panel, .ai-fab, .ai-full, .ai-shell {
  --ai-accent: #0d9488;
  --ai-accent-hover: #0f766e;
  --ai-accent-soft: rgba(13, 148, 136, .12);
  --ai-bg: var(--bg);
  --ai-border: var(--border);
  --ai-user-bubble: var(--bg-3);
  --ai-input-bg: var(--bg);
}
[data-theme="dark"] .ai-card, [data-theme="dark"] .ai-panel,
[data-theme="dark"] .ai-fab, [data-theme="dark"] .ai-full, [data-theme="dark"] .ai-shell {
  --ai-accent: #2dd4bf;
  --ai-accent-hover: #5eead4;
  --ai-accent-soft: rgba(45, 212, 191, .16);
}

.ai-card {
  border: 1px solid var(--ai-border);
  border-radius: 18px;
  padding: 18px;
  background: var(--ai-bg);
  box-shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 3px 12px rgba(16, 24, 40, .04);
}
.ai-composer {
  background: var(--ai-input-bg);
  border: 1px solid var(--ai-border);
  border-radius: 14px;
  padding: 10px 10px 8px 14px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ai-composer:focus-within {
  border-color: var(--ai-accent);
  box-shadow: 0 0 0 3px var(--ai-accent-soft);
}
.ai-composer-row { display: flex; align-items: center; gap: 2px; margin-top: 4px; }
.ai-composer-row .prop-pill { border: none; background: none; }
.ai-composer-row .prop-pill:hover { background: var(--bg-hover); }
/* La chispa del selector de modelo va en el acento de Flow AI (su "cerebro") */
.ai-composer-row .ai-model-pill > svg:first-child { color: var(--ai-accent); }
/* Micrófono dictando: coral y latiendo */
.ai-mic.listening,
.ai-mic.listening:hover {
  background: var(--ai-accent);
  color: #fff;
  animation: ai-mic-pulse 1.6s infinite;
}
@keyframes ai-mic-pulse {
  0%   { box-shadow: 0 0 0 0 var(--ai-accent-soft), 0 0 0 0 var(--ai-accent-soft); }
  70%  { box-shadow: 0 0 0 6px transparent, 0 0 0 12px transparent; }
  100% { box-shadow: 0 0 0 0 transparent, 0 0 0 0 transparent; }
}
/* Puliendo la transcripción con IA */
.ai-mic.polishing { color: var(--ai-accent); animation: ai-polish-fade 1s ease-in-out infinite; }
@keyframes ai-polish-fade { 50% { opacity: .35; } }
.ai-input {
  width: 100%;
  border: none; outline: none; background: none;
  resize: none;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  min-height: 30px;
  padding: 2px 2px 6px;
}
.ai-send {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--ai-accent);
  color: #fff;
  display: grid; place-items: center;
  margin-left: 6px;
  transition: background .15s ease;
}
.ai-send:hover { background: var(--ai-accent-hover); }

/* Hilo del chat */
.ai-thread {
  display: flex; flex-direction: column; gap: 18px;
  max-height: 400px; overflow-y: auto;
  margin: 2px 0 16px;
  padding-right: 4px;
  scrollbar-width: thin;
}
.ai-thread:empty { display: none; }
/* Divisor de sistema (cambio de modelo): texto tenue entre líneas onduladas */
.ai-notice {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-3);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 12px;
}
.ai-notice > span { flex: none; }
.ai-notice::before, .ai-notice::after {
  content: ''; flex: 1; height: 8px; opacity: .5;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpath d='M0 4 Q2 1.5 4 4 T8 4' fill='none' stroke='%23000' stroke-width='1.4'/%3E%3C/svg%3E") repeat-x center / 8px 8px;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpath d='M0 4 Q2 1.5 4 4 T8 4' fill='none' stroke='%23000' stroke-width='1.4'/%3E%3C/svg%3E") repeat-x center / 8px 8px;
}
.ai-msg { display: flex; align-items: flex-start; gap: 10px; }
.ai-msg-user { justify-content: flex-end; }
.ai-avatar {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ai-accent-soft);
  color: var(--ai-accent);
  margin-top: 3px;
}
.ai-bubble {
  max-width: 78%;
  font-size: 14px; line-height: 1.55;
  word-break: break-word;
}
/* El usuario habla en una burbuja beige suave (como en claude.ai) */
.ai-msg-user .ai-bubble {
  background: var(--ai-user-bubble); color: var(--text);
  padding: 9px 14px;
  border-radius: 16px;
}
/* El asistente responde en texto abierto, sin caja, con la sans del sitio */
.ai-msg-assistant .ai-bubble {
  max-width: 100%;
  padding: 2px 0 0;
  color: var(--text);
  font-size: 14.5px; line-height: 1.6;
}
/* Markdown dentro de la burbuja */
.ai-bubble p { margin: 0; }
.ai-bubble p + p, .ai-bubble ul + p, .ai-bubble ol + p { margin-top: 8px; }
.ai-bubble p + ul, .ai-bubble p + ol { margin-top: 6px; }
.ai-bubble ul, .ai-bubble ol { margin: 0; padding-left: 20px; }
.ai-bubble li { margin: 3px 0; }
.ai-bubble li::marker { color: var(--ai-accent); }
.ai-bubble strong { font-weight: 650; }
/* Razonamiento (extended thinking): bloque colapsable sobre la respuesta */
.ai-thinking { margin: 0 0 10px; }
.ai-thinking summary {
  display: inline-flex; align-items: center; gap: 5px;
  cursor: pointer; user-select: none; list-style: none;
  font-size: 12px; color: var(--text-2);
  padding: 2px 8px 2px 0;
}
.ai-thinking summary::-webkit-details-marker { display: none; }
.ai-thinking summary:hover { color: var(--text); }
.ai-thinking[open] summary { margin-bottom: 6px; }
.ai-thinking-body {
  font-size: 12.5px; line-height: 1.55; color: var(--text-2);
  white-space: pre-wrap; word-break: break-word;
  border-left: 2px solid var(--border-2); padding: 2px 0 2px 12px;
}
/* Contenido de una tool escribiéndose en vivo (código de un diseño, página) */
.ai-codestream { margin: 0 0 10px; }
.ai-codestream summary {
  display: inline-flex; align-items: center; gap: 5px;
  cursor: pointer; user-select: none; list-style: none;
  font-size: 12px; color: var(--text-2); padding: 2px 8px 2px 0;
}
.ai-codestream summary::-webkit-details-marker { display: none; }
.ai-codestream summary:hover { color: var(--text); }
.ai-codestream[open] summary { margin-bottom: 6px; }
.ai-codestream-pre {
  max-height: 220px; overflow: auto;
  margin: 0; padding: 10px 12px;
  background: var(--bg-2, rgba(127, 127, 127, 0.08));
  border: 1px solid var(--border-2); border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px; line-height: 1.5; color: var(--text-2);
  white-space: pre-wrap; word-break: break-word;
}
.ai-bubble code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  padding: 1.5px 5px;
  border-radius: 5px;
  background: var(--bg-3);
  border: 1px solid var(--border);
}
.ai-msg-user .ai-bubble code { background: rgba(0,0,0,.06); border-color: transparent; color: inherit; }
[data-theme="dark"] .ai-msg-user .ai-bubble code { background: rgba(255,255,255,.09); }
.ai-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.ai-action {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 500;
  padding: 2.5px 9px; border-radius: 20px;
  background: rgba(34,197,94,.14); color: #15803d;
  border: 1px solid rgba(34,197,94,.25);
}
[data-theme="dark"] .ai-action { color: #4ade80; }
.ai-chip-btn {
  display: inline-flex; align-items: center; gap: 3px;
  margin-left: 4px;
  padding: 1px 7px;
  border: 1px solid currentColor; border-radius: 10px;
  background: none; color: inherit;
  font-size: 11px; font-weight: 600;
  cursor: pointer; opacity: .85;
}
.ai-chip-btn:hover { opacity: 1; background: rgba(0,0,0,.05); }
.ai-chip-btn:disabled { opacity: .4; cursor: default; }
.ai-action-off {
  background: var(--bg-3); color: var(--text-3);
  border-color: var(--border);
  text-decoration: line-through;
}
.ai-action-pending {
  background: rgba(245,158,11,.13); color: #b45309;
  border-color: rgba(245,158,11,.35);
}
[data-theme="dark"] .ai-action-pending { color: #fbbf24; }

/* Enlaces dentro de la respuesta */
.ai-bubble a { color: var(--ai-accent); text-decoration: none; }
.ai-bubble p a:hover, .ai-bubble li a:hover { text-decoration: underline; }

/* Fila de tarjetas de enlace (vistas previas que devuelven Canva y similares) */
.ai-links { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.ai-link-card {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--bg-2);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 12.5px; font-weight: 500;
  color: var(--text) !important;
  transition: border-color .12s ease, color .12s ease;
}
.ai-link-card:hover { border-color: var(--ai-accent); color: var(--ai-accent) !important; }
.ai-link-ext { color: var(--text-3); font-size: 11px; line-height: 1; }
.ai-link-card:hover .ai-link-ext { color: inherit; }

/* Herramienta externa conectada (MCP): chip minimalista — logo de la app +
   nombre + check — mismo lenguaje visual que .ai-action */
.ai-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ai-tool-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3.5px 10px 3.5px 7px;
  border-radius: 20px;
  background: var(--bg-3);
  color: var(--text-2);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 12px; font-weight: 500;
}
/* El logo de marca conserva sus propios colores; el check va en verde */
.ai-tool-chip .ai-brand { flex: none; display: block; }
.ai-tool-chip > svg:not(.ai-brand) { flex: none; color: #16a34a; }
[data-theme="dark"] .ai-tool-chip > svg:not(.ai-brand) { color: #4ade80; }
.ai-tool-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--ai-accent); }
/* Resultado con enlace (p. ej. "Diseño listo en Canva"): mismo chip, activo */
a.ai-tool-chip.ai-tool-result {
  background: var(--ai-accent-soft); color: var(--ai-accent); font-weight: 600;
  transition: background .12s ease, color .12s ease;
}
a.ai-tool-chip.ai-tool-result svg { color: inherit; }
a.ai-tool-chip.ai-tool-result:hover { background: var(--ai-accent); color: #fff; }

/* Cabecera de la tarjeta-lienzo de un diseño (create_design) */
.ai-tool-spacer { flex: 1; }
.ai-tool-logo {
  flex: none; width: 22px; height: 22px; border-radius: 7px;
  display: grid; place-items: center;
  color: #fff; font-size: 12px; font-weight: 700;
  background: var(--ai-accent);
}
.ai-tool-name { color: var(--text-2); }
.ai-tool-name strong { color: var(--text); font-weight: 600; }
.ai-tool-open {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg);
  font-size: 12px; font-weight: 600;
  color: var(--text) !important;
  transition: border-color .12s ease, color .12s ease;
}
.ai-tool-open:hover { border-color: var(--ai-accent); color: var(--ai-accent) !important; }

/* Tarjeta-lienzo de un diseño creado por Flow AI (estilo Claude Design) */
.ai-design-card {
  margin-top: 10px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--bg-2);
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.ai-design-head {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.ai-design-frame {
  display: block;
  width: 100%; height: 300px;
  border: none;
  background: #fff;
}
.ai-design-gone {
  padding: 18px; text-align: center;
  color: var(--text-3); font-size: 12.5px;
}
/* Estado en vivo mientras la IA trabaja: puntos + "Generando el diseño…" */
.ai-status {
  display: flex; align-items: center; gap: 9px;
  color: var(--text-3);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 12.5px;
}
.ai-bubble > * + .ai-status { margin-top: 8px; }

/* Modo desarrollador: los elementos .dev-only quedan ocultos salvo que el body
   tenga .dev-mode (toggle en Configuración → Preferencias). */
body:not(.dev-mode) .dev-only { display: none !important; }

/* Meta de la respuesta (tiempo + tokens), tenue bajo la respuesta — como claude.ai */
.ai-elapsed {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 10px;
  color: var(--text-3); font-size: 11.5px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
}
.ai-meta-item { display: inline-flex; align-items: center; gap: 4px; }
.ai-meta-item svg { opacity: .8; }
.ai-meta-sep { opacity: .5; }

/* Contador de tokens en vivo (mientras piensa/trabaja), al final de la línea de estado */
.ai-tokens {
  display: inline-flex; align-items: center; gap: 4px;
  margin-left: auto;
  color: var(--ai-accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ai-tokens svg { opacity: .9; }
.ai-typing { display: inline-flex; gap: 5px; align-items: center; min-height: 21px; }
.ai-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ai-accent);
  animation: ai-blink 1.2s infinite ease-in-out;
}
.ai-typing span:nth-child(2) { animation-delay: .2s; }
.ai-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes ai-blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }

/* Burbuja flotante de Flow AI (visible en toda la app) */
.ai-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 95;
  width: 50px; height: 50px;
  border: none; border-radius: 50%;
  background: linear-gradient(150deg, var(--ai-accent-hover), var(--ai-accent));
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(13,148,136,.42), var(--shadow);
  transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s ease, filter .18s ease;
}
.ai-fab:hover { filter: brightness(1.06); transform: translateY(-2px) scale(1.05); box-shadow: 0 10px 24px rgba(13,148,136,.5), var(--shadow); }
.ai-fab.active { transform: none; box-shadow: 0 4px 14px rgba(13,148,136,.4), var(--shadow); }
.ai-panel {
  position: fixed; right: 22px; bottom: 80px; z-index: 95;
  width: min(400px, calc(100vw - 32px));
  background: var(--ai-bg);
  border: 1px solid var(--ai-border);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  display: none; flex-direction: column;
  overflow: hidden;
}
.ai-panel.open { display: flex; animation: ai-panel-in .16s ease; }
@keyframes ai-panel-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ai-panel-head {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 10px 10px 16px;
  border-bottom: 1px solid var(--ai-border);
  font-size: 13.5px; font-weight: 600;
}
.ai-panel-title {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--ai-accent);
  font-family: var(--font-serif);
  font-size: 15px;
}
.ai-panel .ai-card { border: none; box-shadow: none; border-radius: 0; background: none; }
.ai-panel .ai-thread { max-height: 46vh; }

/* Interfaz completa de Flow AI (ruta #/ai). Ocupa toda la vista: saludo +
   compositor centrados cuando no hay conversación; hilo desplazable con el
   compositor anclado abajo cuando ya empezó. */

/* Shell de #/ai: barra lateral propia (estilo Claude) + columna de chat. En
   esta ruta se ocultan el sidebar de Flow, el breadcrumb y el FAB, y la vista
   no desborda (solo hacen scroll las columnas internas). */
.ai-shell { display: flex; height: 100%; min-height: 0; }
body.route-ai .sidebar,
body.route-ai .crumbbar,
body.route-ai .ai-fab,
body.route-ai .ai-panel { display: none; }
body.route-ai .view { overflow: hidden; }

.ai-full { display: flex; flex-direction: column; height: 100%; flex: 1; min-width: 0; min-height: 0; }
.ai-full-scroll {
  flex: 1; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column;
  padding: 28px 20px;
}
.ai-full.empty .ai-full-scroll { justify-content: center; padding-bottom: 12vh; }
.ai-full-inner { width: 100%; max-width: 760px; margin: 0 auto; }

/* Hero: saludo + compositor centrados (estado vacío), como claude.ai */
.ai-full:not(.empty) .ai-full-hero { display: none; }
.ai-full-hero { text-align: center; }
.ai-full-greeting {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--font-serif);
  font-size: clamp(28px, 3.6vw, 44px); font-weight: 500; line-height: 1.15;
  color: var(--text); margin: 0 0 28px;
}
.ai-full-spark { display: inline-grid; place-items: center; color: var(--ai-accent); }
.ai-full-hero-composer { max-width: 720px; margin: 0 auto; text-align: left; }
/* En el estado vacío el compositor es más grande y elevado (referencia) */
.ai-full-hero-composer .ai-composer {
  border-radius: 22px;
  padding: 16px 16px 10px 18px;
  box-shadow: 0 2px 6px rgba(16,24,40,.05), 0 12px 34px rgba(16,24,40,.09);
}
.ai-full-hero-composer .ai-input { font-size: 16px; min-height: 46px; }

/* Hilo a pantalla completa: el scroll lo lleva .ai-full-scroll, no el hilo */
.ai-full .ai-thread { max-height: none; overflow: visible; margin: 0; padding: 0; gap: 22px; }

/* Dock del compositor (conversación activa) */
.ai-full.empty .ai-full-dock { display: none; }
.ai-full-dock {
  border-top: 1px solid var(--border);
  background: var(--ai-bg);
  padding: 12px 20px 18px;
}
.ai-full-dock-inner { max-width: 760px; margin: 0 auto; }

/* Barra lateral estilo Claude para Flow AI (solo UI por ahora) */
.ai-side {
  flex: none;
  width: 264px;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--bg);
}
.ai-side-head {
  display: flex; align-items: center; gap: 2px;
  padding: 12px 10px 10px 16px;
}
.ai-side-brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-serif);
  font-size: 17px; font-weight: 600;
  color: var(--ai-accent);
}
.ai-side-new {
  display: flex; align-items: center; gap: 9px;
  margin: 4px 12px 8px;
  padding: 9px 12px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--bg);
  box-shadow: 0 1px 2px rgba(16,24,40,.05);
  font-weight: 500;
}
.ai-side-new:hover { background: var(--bg-hover); }
.ai-side-new > svg:first-child { color: var(--ai-accent); }
/* Toggle segmentado Chats / Artefactos */
.ai-side-tabs {
  display: flex; gap: 2px;
  margin: 0 12px 8px;
  padding: 3px;
  background: var(--bg-3);
  border-radius: 10px;
}
.ai-tab {
  flex: 1; padding: 6px 0;
  border-radius: 8px;
  font-size: 13px; font-weight: 500;
  color: var(--text-2);
}
.ai-tab:hover { color: var(--text); }
.ai-tab.active { background: var(--bg); color: var(--text); box-shadow: 0 1px 2px rgba(16,24,40,.08); }
[data-theme="dark"] .ai-tab.active { background: var(--bg-hover); box-shadow: none; }

/* Cuerpo desplazable: la lista de chats o la galería de artefactos */
.ai-side-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 10px 12px; scrollbar-width: thin; }

/* Buscador (visual por ahora) */
.ai-side-search {
  display: flex; align-items: center; gap: 7px;
  margin: 2px 2px 8px;
  padding: 7px 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-2); color: var(--text-3);
}
.ai-side-search-input { flex: 1; border: none; outline: none; background: none; font: inherit; font-size: 13px; color: var(--text); }

/* Lista de conversaciones (agrupada por fecha) */
.ai-side-recents-group { padding: 10px 8px 4px; color: var(--text-3); font-size: 11.5px; font-weight: 600; }
.ai-side-recent {
  display: flex; align-items: center; gap: 2px;
  border-radius: var(--radius);
  color: var(--text-2);
}
.ai-side-recent:hover { background: var(--bg-hover); color: var(--text); }
.ai-side-recent.active { background: var(--bg-3); color: var(--text); }
.ai-side-recent.editing { padding: 2px 4px; }
.ai-side-recent-title {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 6px;
  padding: 7px 8px; text-align: left;
  font-size: 13.5px; color: inherit;
}
.ai-side-recent-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-side-pin { flex: none; color: var(--ai-accent); display: inline-grid; place-items: center; }
.ai-side-recent-menu {
  flex: none; width: 26px; height: 26px; margin-right: 3px;
  display: grid; place-items: center;
  border-radius: 6px; color: var(--text-3);
  opacity: 0; transition: opacity .12s ease;
}
.ai-side-recent:hover .ai-side-recent-menu { opacity: 1; }
.ai-side-recent-menu:hover { background: var(--bg-3); color: var(--text); }
.ai-side-rename {
  flex: 1; width: 100%;
  padding: 6px 8px; border: 1px solid var(--ai-accent);
  border-radius: 7px; background: var(--bg);
  font: inherit; font-size: 13.5px; color: var(--text); outline: none;
}
.ai-side-empty { padding: 14px 10px; color: var(--text-3); font-size: 13px; line-height: 1.5; }

/* ---- Galería de artefactos (panel principal, estilo claude.ai) ---------- */
.ai-gallery { flex: 1; min-width: 0; height: 100%; overflow-y: auto; }
.ai-gallery-inner { max-width: 1100px; margin: 0 auto; padding: 32px 32px 48px; }
.ai-gallery-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.ai-gallery-head h1 { font-family: var(--font-serif); font-size: 30px; font-weight: 500; color: var(--text); }
.ai-gallery-filter {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 12px; border-radius: var(--radius);
  color: var(--text-2); font-size: 13.5px;
}
.ai-gallery-filter:hover { background: var(--bg-hover); }
.ai-gallery-filter b { color: var(--text); font-weight: 600; }
.ai-gallery-tabs { display: flex; gap: 4px; margin-bottom: 20px; }
.ai-gallery-tab {
  padding: 6px 12px; border-radius: 8px;
  color: var(--text-2); font-size: 14px; font-weight: 500;
}
.ai-gallery-tab:hover { background: var(--bg-hover); color: var(--text); }
.ai-gallery-tab.active { background: var(--bg-3); color: var(--text); }
.ai-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }

/* Tarjeta de artefacto */
.ai-art-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  text-align: left;
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--bg);
  padding: 0 0 12px;
  transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease;
}
.ai-art-card:hover { border-color: var(--border-2); box-shadow: 0 6px 20px rgba(16,24,40,.10); transform: translateY(-1px); }
/* Esquina doblada (dog-ear) arriba a la derecha */
.ai-art-fold {
  position: absolute; top: 0; right: 0; width: 20px; height: 20px; z-index: 1;
  background: linear-gradient(225deg, var(--bg-3) 50%, transparent 50%);
  border-left: 1px solid var(--border); border-bottom: 1px solid var(--border);
  border-bottom-left-radius: 6px;
}
.ai-art-top { position: relative; padding: 14px 16px 0; }
.ai-art-tag {
  display: inline-block; margin-bottom: 8px;
  padding: 2px 8px; border-radius: 6px;
  background: var(--bg-3); color: var(--text-2);
  font-size: 11px; font-weight: 600;
}
.ai-art-preview { height: 118px; overflow: hidden; border-radius: 8px; position: relative; }
/* Preview de texto: encabezado + snippet, con desvanecido inferior */
.ai-art-preview.ai-art-text { color: var(--text-2); font-size: 12.5px; line-height: 1.5; }
.ai-art-snip-h { font-weight: 700; color: var(--text); margin-bottom: 4px; }
.ai-art-preview.ai-art-text p { margin: 0; }
.ai-art-preview.ai-art-text::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 42px;
  background: linear-gradient(transparent, var(--bg));
}
/* Preview de código: panel tenue con el glifo </> */
.ai-art-preview.ai-art-code { display: grid; place-items: center; background: var(--bg-2); color: var(--text-3); border: 1px solid var(--border); }
/* Preview de diseño: lienzo con degradado + emoji */
.ai-art-preview.ai-art-design { display: grid; place-items: center; }
.ai-art-emoji { font-size: 34px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.25)); }
.ai-art-title {
  padding: 12px 16px 0; margin: 0;
  font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ai-art-desc {
  padding: 4px 16px 0; color: var(--text-3); font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ai-art-meta {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 16px 0; margin-top: auto;
  color: var(--text-3); font-size: 12px;
}
.ai-art-sep { opacity: .6; }
.ai-art-views { display: inline-flex; align-items: center; gap: 3px; }

/* Preview real del diseño: iframe sandbox escalado como miniatura (perezoso) */
.ai-art-card { text-decoration: none; color: inherit; }
.ai-art-preview.ai-art-live { background: var(--bg-2); }
.ai-art-frame {
  position: absolute; top: 0; left: 0;
  width: 250%; height: 250%;
  transform: scale(0.4); transform-origin: top left;
  border: 0; background: #fff; pointer-events: none;
}
.ai-art-gone { display: grid; place-items: center; height: 100%; color: var(--text-3); }

/* Estado vacío / de carga de la galería */
.ai-gallery-empty {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 48px 20px; text-align: center; color: var(--text-2);
}
.ai-gallery-empty svg { color: var(--ai-accent); margin-bottom: 4px; }
.ai-gallery-empty p { margin: 0; }
.ai-gallery-empty .faint, .ai-gallery-empty.faint { color: var(--text-3); font-size: 13px; max-width: 320px; }

.recents-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-2);
  padding: 8px;
  min-height: 130px;
}
.recents-box .recent-row:hover { background: var(--bg-hover); }
.recents-empty {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 52px 0;
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.link-card { cursor: pointer; padding: 12px 14px; }
.link-card:hover { box-shadow: var(--shadow); }
.link-ico {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--bg-3);
  color: var(--text-2);
}
.recent-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
}
.recent-row:hover { background: var(--bg-hover); }

/* ---- Tu trabajo ---- */
.yw-layout { display: flex; align-items: flex-start; }
.yw-profile {
  width: 300px; flex-shrink: 0;
  border-left: 1px solid var(--border);
  min-height: calc(100vh - 150px);
}
.yw-banner {
  height: 110px;
  background: linear-gradient(120deg, #1c2128, #3a4150 70%, #5b6577);
}
.yw-profile-body { padding: 0 22px 22px; margin-top: -26px; }
.yw-profile-body .avatar.lg { border: 3px solid var(--bg); }
.yw-meta { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 8px; }
.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.summary-ico {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
}
.charts-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
  margin-top: 28px;
}
.chart-title { font-size: 13.5px; margin-bottom: 14px; }

/* Barras horizontales tipo tabla */
.barlist { display: flex; flex-direction: column; gap: 9px; }
.barlist-row { display: flex; align-items: center; gap: 10px; border-radius: 6px; padding: 2px 4px; }
.barlist-row:hover { background: var(--bg-hover); }
.barlist-label {
  width: 110px; flex-shrink: 0;
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--text-2);
  white-space: nowrap; overflow: hidden;
}
.barlist-track {
  flex: 1;
  height: 9px;
  background: var(--bg-3);
  border-radius: 4px;
  overflow: hidden;
}
.barlist-fill { display: block; height: 100%; border-radius: 4px; min-width: 2px; }
.barlist-value { width: 30px; text-align: right; font-weight: 600; font-size: 13px; }

/* ---- Stickies ---- */
.stickies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
/* Reordenamiento por arrastre en Inicio */
.stickies-grid .sticky-card.dragging {
  opacity: .45;
  box-shadow: 0 12px 28px rgba(16,24,40,.28);
}
/* Lienzo con arrastre libre (solo la vista Stickies) */
.stickies-canvas {
  position: relative;
  min-height: 70vh;
}
.stickies-canvas .sticky-card {
  position: absolute;
  width: 240px;
  transition: box-shadow .15s ease;
}
.stickies-canvas .sticky-card.dragging {
  box-shadow: 0 12px 28px rgba(16,24,40,.28);
  cursor: grabbing;
}
.sticky-handle {
  display: flex; align-items: center; justify-content: center;
  height: 20px; margin: -6px -8px 4px;
  color: inherit; opacity: .4;
  cursor: grab;
  touch-action: none;
}
.sticky-handle:hover { opacity: .8; }
.sticky-handle:active { cursor: grabbing; }
.sticky-card {
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  min-height: 140px;
  display: flex; flex-direction: column;
  box-shadow: 0 1px 3px rgba(16,24,40,.1);
}
.sticky-content { flex: 1; outline: none; white-space: pre-wrap; line-height: 1.5; }
.sticky-yellow { background: #fef3c7; color: #713f12; }
.sticky-blue   { background: #dbeafe; color: #1e3a8a; }
.sticky-green  { background: #dcfce7; color: #14532d; }
.sticky-pink   { background: #fce7f3; color: #831843; }
.sticky-purple { background: #ede9fe; color: #4c1d95; }
.sticky-orange { background: #ffedd5; color: #7c2d12; }
.sticky-card .icon-btn { color: inherit; opacity: .6; }
.sticky-card .icon-btn:hover { opacity: 1; background: rgba(0,0,0,.07); }
.sticky-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
}
.sticky-dot.selected { border-color: rgba(0,0,0,.4); }
.sticky-dot-yellow { background: #fbbf24; }
.sticky-dot-blue   { background: #60a5fa; }
.sticky-dot-green  { background: #4ade80; }
.sticky-dot-pink   { background: #f472b6; }
.sticky-dot-purple { background: #a78bfa; }
.sticky-dot-orange { background: #fb923c; }

/* ---- Páginas / editor ---- */
.page-editor { max-width: 780px; }
.page-title {
  width: 100%;
  border: none; outline: none; background: none;
  font-size: 28px; font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  font-family: inherit;
}
.page-toolbar {
  display: flex; align-items: center; gap: 3px;
  flex: 1;
  flex-wrap: wrap;
}
.toolbar-btn {
  padding: 4px 9px;
  border-radius: 6px;
  color: var(--text-2);
  font-size: 13px;
}
.toolbar-btn:hover { background: var(--bg-hover); color: var(--text); }
.toolbar-sep { width: 1px; height: 18px; background: var(--border); margin: 0 5px; }
.page-content {
  outline: none;
  min-height: 55vh;
  line-height: 1.65;
  padding-bottom: 30vh;
}
.page-content h1 { font-size: 24px; margin: 18px 0 8px; }
.page-content h2 { font-size: 19px; margin: 16px 0 6px; }
.page-content h3 { font-size: 16px; margin: 14px 0 5px; }
.page-content p { margin: 6px 0; }
.page-content ul, .page-content ol { margin: 6px 0 6px 8px; }
.page-content blockquote {
  border-left: 3px solid var(--border-2);
  padding-left: 12px;
  color: var(--text-2);
  margin: 8px 0;
}

/* ---- Búsqueda ---- */
.search-input {
  flex: 1;
  border: none; outline: none; background: none;
  font-size: 15px;
  color: var(--text);
  padding: 4px;
}
.search-results { max-height: 50vh; overflow-y: auto; padding: 8px; }

/* ---- Placeholders de contenteditable ---- */
[contenteditable][data-placeholder]:empty::before {
  content: attr(data-placeholder);
  color: var(--text-3);
  pointer-events: none;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .yw-profile { display: none; }
  .rail-item span { display: none; }
}

/* ---- Documentación (#/docs) ---- */
.docs-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 760px);
  gap: 32px;
  align-items: start;
}
.docs-toc {
  position: sticky; top: 10px;
  display: flex; flex-direction: column; gap: 1px;
  max-height: calc(100vh - 120px); overflow-y: auto;
  padding-right: 6px;
}
.docs-toc-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-3);
  margin: 12px 0 4px; padding: 0 10px;
}
.docs-toc button {
  text-align: left;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-2);
}
.docs-toc button:hover { background: var(--bg-hover); color: var(--text); }
.docs-content { min-width: 0; padding-bottom: 60px; }
.docs-section { margin-bottom: 36px; scroll-margin-top: 12px; }
.docs-section h3 {
  font-size: 19px;
  padding-bottom: 8px; margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.docs-section h4 { font-size: 14.5px; margin: 18px 0 6px; }
.docs-section p, .docs-section li { font-size: 14px; line-height: 1.65; }
.docs-section p { margin: 8px 0; }
.docs-section ul, .docs-section ol { padding-left: 22px; margin: 8px 0; }
.docs-section li { margin: 4px 0; }
.docs-section code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
}
.docs-pre {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 10px 0;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre;
}
.docs-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 10px 0;
}
.docs-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.docs-table th {
  background: var(--bg-2);
  text-align: left; font-weight: 600;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.docs-table td { padding: 7px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.docs-table tr:last-child td { border-bottom: none; }
.docs-note {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
  margin: 12px 0;
  font-size: 13.5px;
  line-height: 1.6;
}
.docs-kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
}
@media (max-width: 900px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-toc { position: static; max-height: none; }
}

/* ---- Especializaciones de Flow AI (#/especializaciones) ---- */
.specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}
.spec-card {
  display: flex; flex-direction: column; gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  padding: 18px;
}
.spec-soon { opacity: .65; }
.spec-emoji { font-size: 26px; line-height: 1; }
.spec-chip {
  font-size: 11px; font-weight: 600;
  padding: 2.5px 9px;
  border-radius: 20px;
  white-space: nowrap;
  align-self: flex-start;
}
.spec-chip-core      { background: var(--accent-soft); color: var(--accent); }
.spec-chip-installed { background: rgba(34,197,94,.14); color: #15803d; }
[data-theme="dark"] .spec-chip-installed { color: #4ade80; }
.spec-chip-available { background: var(--bg-3); color: var(--text-2); }
.spec-chip-soon      { background: var(--bg-3); color: var(--text-3); }
.spec-skills { display: flex; flex-direction: column; gap: 5px; }
.spec-skill {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--text-2);
}
.spec-skill svg { color: var(--accent); flex-shrink: 0; }
.spec-tool {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-3);
  background: var(--bg-2);
}
.spec-tool.on { color: var(--text-2); border-color: var(--border-2); }
.spec-tool.on svg { color: var(--success); }
.spec-tool-soon { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; opacity: .8; }
/* Chips de herramienta conectables (Canva, Figma…) */
.spec-tool.clickable { cursor: pointer; }
.spec-tool.clickable:hover { border-color: var(--accent); color: var(--accent); }
.spec-tool.clickable.on:hover { color: var(--text); }

/* ---- Análisis (analítica del espacio de trabajo, estilo Plane) ---- */
.an-tabbar { display: flex; align-items: center; gap: 12px; padding: 8px 24px; border-bottom: 1px solid var(--border); }
.an-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.an-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 8px;
  color: var(--text-2); font-size: 14px; font-weight: 500;
}
.an-tab:hover { background: var(--bg-hover); color: var(--text); }
.an-tab.active { background: var(--bg-3); color: var(--text); }
.an-tab svg { color: var(--text-3); }
.an-projsel {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border: 1px solid var(--border-2); border-radius: var(--radius);
  color: var(--text-2); font-size: 13.5px; background: var(--bg);
}
.an-projsel:hover { background: var(--bg-hover); }

.an-title { font-size: 22px; font-weight: 700; margin: 0 0 22px; }

.an-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 28px; margin-bottom: 36px; }
.an-card-label { color: var(--text-2); font-size: 13.5px; margin-bottom: 7px; }
.an-card-num { font-size: 30px; font-weight: 700; color: var(--text); line-height: 1; }

.an-lower { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 30px; align-items: start; }
.an-panel h3 { font-size: 16px; font-weight: 600; margin: 0 0 12px; }
.an-panel-head { display: flex; align-items: flex-start; justify-content: space-between; }
.an-progress { color: #ef4444; font-size: 13px; font-weight: 600; }
.an-sub { color: var(--text-3); font-size: 13px; margin-bottom: 2px; }
.an-radar { width: 100%; height: auto; overflow: visible; }

.an-table { width: 100%; border-collapse: collapse; }
.an-table th { text-align: left; color: var(--text-3); font-size: 12.5px; font-weight: 500; padding: 8px 0; border-bottom: 1px solid var(--border); }
.an-table th:last-child, .an-table td:last-child { text-align: right; }
.an-table td { padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--text); }
.an-table td:last-child { color: var(--text-2); }

.an-active { display: flex; flex-direction: column; gap: 2px; }
.an-proj { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: var(--radius); }
.an-proj:hover { background: var(--bg-hover); }
.an-proj-emoji { font-size: 18px; }
.an-proj-name { font-size: 14px; color: var(--text); }
.an-proj-pct { color: #ef4444; font-size: 12.5px; font-weight: 600; }

@media (max-width: 1040px) {
  .an-cards { grid-template-columns: repeat(2, 1fr); }
  .an-lower { grid-template-columns: 1fr; }
}

/* Radar de Análisis: tooltip al pasar el cursor por un vértice */
.an-radar-wrap { position: relative; }
.an-tip {
  position: absolute; left: 0; top: 0; z-index: 6; pointer-events: none;
  min-width: 148px; padding: 11px 14px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow-lg);
  opacity: 0; transition: opacity .1s ease;
  font-size: 13px; color: var(--text);
}
.an-tip.on { opacity: 1; }
.an-tip-title { font-weight: 600; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.an-tip-row { display: flex; align-items: center; gap: 7px; color: var(--text-2); }
.an-tip-row b { color: var(--text); }
.an-tip-sq { width: 11px; height: 11px; border-radius: 2px; background: var(--accent); flex: none; }

/* ---- Portadas (Unsplash + presets) ---- */
.cover-img { background-size: cover; background-position: center; background-repeat: no-repeat; }

/* Preview de portada en el modal de proyecto */
.proj-cover-preview {
  position: relative; height: 120px; border-radius: var(--radius-lg);
  display: flex; align-items: flex-end; padding: 12px; overflow: hidden;
}
.proj-cover-emoji { font-size: 26px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }
.cover-change-btn {
  position: absolute; right: 10px; bottom: 10px; z-index: 2;
  background: rgba(255,255,255,.92); color: #1a1a1a; border: none;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.cover-change-btn:hover { background: #fff; }

/* Portada del perfil */
.profile-cover { position: relative; height: 130px; border-radius: var(--radius-lg); overflow: hidden; }

/* Selector de portada (modal) */
.cover-tabs { display: flex; gap: 4px; background: var(--bg-3); padding: 3px; border-radius: 10px; margin-bottom: 14px; }
.cover-tab { flex: 1; padding: 7px 0; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--text-2); }
.cover-tab:hover { color: var(--text); }
.cover-tab.active { background: var(--bg); color: var(--text); box-shadow: 0 1px 2px rgba(16,24,40,.08); }
[data-theme="dark"] .cover-tab.active { background: var(--bg-hover); box-shadow: none; }
.cover-search { display: flex; gap: 8px; margin-bottom: 12px; }
.cover-search .input { flex: 1; }
.cover-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-height: 400px; overflow-y: auto; }
.cover-thumb {
  height: 82px; border-radius: 8px; border: 1px solid var(--border);
  background-size: cover; background-position: center; cursor: pointer;
}
.cover-thumb:hover { outline: 2px solid var(--accent); }
.cover-msg { grid-column: 1 / -1; padding: 34px 20px; text-align: center; color: var(--text-3); font-size: 13px; line-height: 1.5; }
.cover-colors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cover-swatch-lg { width: 100%; height: 74px; border-radius: 10px; }

/* Foto de perfil: imagen en el avatar + botón para cambiarla */
.avatar-img { background-size: cover; background-position: center; background-repeat: no-repeat; }
.avatar-edit { position: relative; display: inline-block; line-height: 0; }
.avatar-edit-btn {
  position: absolute; right: -4px; bottom: -4px;
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg); color: var(--text-2);
  border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(16,24,40,.18);
}
.avatar-edit-btn:hover { color: var(--text); background: var(--bg-hover); }

/* Menú del avatar (lápiz): color + subir/quitar foto */
.menu-label { padding: 8px 12px 4px; font-size: 11.5px; font-weight: 600; color: var(--text-3); }
.avatar-menu-swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 4px 12px 10px; }
.avatar-menu-swatches .swatch { width: 30px; height: 30px; border-radius: 50%; }
.avatar-edit-btn svg { width: 12px; height: 12px; }

/* Changelog (docs → Novedades) */
.chlog-entry { margin-bottom: 24px; }
.chlog-date {
  font-weight: 700; font-size: 14px; color: var(--text);
  margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.chlog-items { display: flex; flex-direction: column; gap: 9px; }
.chlog-item { display: flex; gap: 10px; align-items: baseline; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.chlog-tag {
  flex: none; font-size: 11px; font-weight: 600;
  padding: 2px 9px; border-radius: 999px; line-height: 1.5;
}
.chlog-new     { background: rgba(34,197,94,.15);  color: #16a34a; }
.chlog-improve { background: rgba(59,130,246,.15); color: #3b82f6; }
.chlog-fix     { background: rgba(245,158,11,.15); color: #d97706; }
[data-theme="dark"] .chlog-new     { color: #4ade80; }
[data-theme="dark"] .chlog-improve { color: #60a5fa; }
[data-theme="dark"] .chlog-fix     { color: #fbbf24; }
