/* Estética V.A.U.L.T. v1.7 — HUD "JARVIS": display Rajdhani, UI Inter, datos en mono. */
@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #05070a;
  --panel: #0c1119;
  --panel-2: #0f1723;
  --edge: #22303f;          /* borde más visible (AA en dark) */
  --fg: #d9e6f2;            /* texto principal ~11:1 sobre panel */
  --muted: #9db0c6;         /* secundario >4.5:1 sobre panel */
  --muted-2: #7f92aa;       /* terciario (subido desde #6b7d94: era ilegible en textos chicos) */
  --accent: #35e0c8;
  --accent-ink: #04120f;    /* texto sobre accent (contraste alto) */
  --accent-dim: #1b6f65;
  --alert: #ff7480;
  --ok: #4ee0a0;
  --r: 6px;                 /* radio base */
  --font-display: 'Rajdhani', 'Avenir Next Condensed', 'Arial Narrow', system-ui, sans-serif;
  --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  --glow: 0 0 12px rgba(53, 224, 200, 0.35);
  --glow-soft: 0 0 18px rgba(53, 224, 200, 0.16);
}
* { box-sizing: border-box; }
/* el atributo hidden debe ganar a las clases con display:flex/grid (login/shell/view) */
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1100px 700px at 50% -12%, #0a1424 0%, var(--bg) 58%) fixed, var(--bg);
  color: var(--fg);
  font-family: var(--font-ui);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
.login { display: flex; align-items: center; justify-content: center; height: 100vh; }
.login-box {
  background: var(--panel); border: 1px solid var(--edge);
  padding: 44px 40px; width: 340px; text-align: center; border-radius: 8px;
  box-shadow: var(--glow-soft);
}
.brand {
  font-family: var(--font-display); font-weight: 700;
  font-size: 52px; letter-spacing: 12px; margin: 0 0 0 12px; color: var(--accent);
  text-shadow: var(--glow);
}
.brand-sm {
  font-family: var(--font-display); font-weight: 700; font-size: 20px;
  color: var(--accent); letter-spacing: 4px; text-shadow: var(--glow);
}
.tagline { color: var(--muted); margin: 6px 0 30px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 1px; }
form { display: flex; flex-direction: column; gap: 12px; }
input {
  background: #070b10; border: 1px solid var(--edge); color: var(--fg);
  padding: 12px; font-family: inherit; font-size: 15px; border-radius: 4px;
}
/* a11y: sin outline:none — el anillo :focus-visible global es el indicador; el borde solo complementa */
input:focus { border-color: var(--accent-dim); }
button {
  background: var(--accent-dim); color: var(--bg); border: none; padding: 11px;
  letter-spacing: 3px; cursor: pointer; font-family: var(--font-display); font-size: 15px;
  font-weight: 700; border-radius: 4px;
}
button:hover { background: var(--accent); }
.error { color: var(--alert); font-size: 13px; }
.shell { height: 100vh; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 20px; padding: 10px 18px;
  border-bottom: 1px solid var(--edge); background: var(--panel);
  box-shadow: 0 1px 0 rgba(53, 224, 200, 0.06);
}
.clock {
  font-family: var(--font-display); font-weight: 600; font-size: 18px;
  font-variant-numeric: tabular-nums; color: var(--accent); letter-spacing: 2px;
  text-shadow: var(--glow);
}
.mic { display: inline-flex; align-items: center; gap: 7px; background: transparent; border: 1px solid var(--edge); color: var(--fg); padding: 6px 13px; border-radius: var(--r); cursor: pointer; margin-left: auto; font-family: var(--font-ui); font-size: 13px; transition: border-color .18s ease; }
.mic:hover { border-color: var(--accent-dim); }
.mic-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); transition: background .18s ease; }
.mic.rec { border-color: var(--alert); color: var(--alert); }
.mic.rec .mic-dot { background: var(--alert); animation: pulse-dot 1s infinite; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.ws-status { color: var(--muted); font-size: 13px; }
.logout { background: transparent; border: 1px solid var(--edge); color: var(--muted); padding: 6px 13px; border-radius: var(--r); cursor: pointer; font-family: var(--font-ui); font-size: 13px; letter-spacing: normal; }
.logout:hover { color: var(--fg); border-color: var(--accent-dim); }
.grid { flex: 1; display: grid; grid-template-columns: 1.05fr 1.7fr 1.05fr; gap: 1px; background: var(--edge); min-height: 0; }
.panel { background: var(--panel); padding: 16px; overflow: auto; }
.panel-title {
  font-family: var(--font-display); font-size: 13px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--muted); margin: 0 0 12px; font-weight: 700;
  padding-left: 9px; border-left: 2px solid var(--accent-dim);
}
.muted { color: var(--muted); }

/* --- v1.6 UX (#12): barra de acciones, jerarquía, estados vacíos, foco --- */
.view-col { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.view-col > .grid, .view-col > .kanban, .view-col > .wiki-grid, .view-col > .bounty-table-wrap { flex: 1; min-height: 0; }
.actionbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 18px; border-bottom: 1px solid var(--edge); background: var(--panel);
}
.view-title { font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: 1px; color: var(--fg); margin: 0; }
.ab-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ab-actions { margin-left: auto; display: flex; gap: 8px; }
.field { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.field select { background: #070b10; border: 1px solid var(--edge); color: var(--fg); padding: 7px 9px; font-family: var(--font-ui); font-size: 13px; border-radius: var(--r); }

.btn-primary {
  background: var(--accent); color: var(--accent-ink); border: none; font-weight: 700;
  padding: 9px 18px; border-radius: var(--r); cursor: pointer; font-family: var(--font-display);
  font-size: 15px; letter-spacing: 1px; transition: filter .18s ease, transform .06s ease, box-shadow .18s ease;
  box-shadow: var(--glow-soft);
}
.btn-primary:hover { filter: brightness(1.12); box-shadow: var(--glow); }
.btn-primary:active { transform: translateY(1px); }
.btn-link { background: none; border: none; color: var(--accent); cursor: pointer; font-family: var(--font-ui); font-size: 14px; padding: 4px 0; letter-spacing: normal; }
.btn-link:hover { text-decoration: underline; }

.empty-state { color: var(--muted); font-size: 14px; line-height: 1.6; padding: 18px 6px; }
.empty-state p { margin: 0 0 8px; color: var(--fg); }
/* P0-5/P1-9: estados de carga y de error de los paneles (mismo lenguaje que .empty-state) */
.loading-state { color: var(--muted-2); }
.load-error p { color: var(--alert); }
.login-box button[type="submit"]:disabled { opacity: .6; cursor: default; }
.kanban #kanban-empty, #wiki-empty { padding: 24px; }

/* foco visible en todo lo interactivo (a11y) */
:where(button, a, input, textarea, select, [tabindex]):focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px;
}
button:focus:not(:focus-visible) { outline: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* --- #14 deep-interviewer: modal de chat --- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(2, 5, 9, 0.72); }
.modal-card {
  position: relative; width: min(680px, 92vw); height: min(78vh, 720px);
  display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--edge);
  border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), var(--glow-soft);
}
.modal-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--edge); flex-wrap: wrap; }
.modal-head h2 { font-family: var(--font-display); font-size: 18px; letter-spacing: 1px; margin: 0; color: var(--fg); }
.modal-x { margin-left: auto; background: none; border: none; color: var(--muted); font-size: 17px; cursor: pointer; padding: 6px 10px; letter-spacing: normal; }
.modal-x:hover { color: var(--fg); }
.phase-track { display: flex; gap: 5px; flex-wrap: wrap; }
.phase-pill { font-family: var(--font-ui); font-size: 11px; letter-spacing: 0.3px; color: var(--muted-2); border: 1px solid var(--edge); border-radius: 20px; padding: 3px 10px; }
.phase-pill.active { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); font-weight: 600; box-shadow: var(--glow-soft); }
.phase-pill.past { color: var(--accent); border-color: var(--accent-dim); }
.modal-body { flex: 1; overflow: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.iv-msg { max-width: 82%; padding: 10px 14px; border-radius: 12px; font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; }
.iv-bot { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--edge); color: var(--fg); border-bottom-left-radius: 3px; }
.iv-me { align-self: flex-end; background: var(--accent-dim); color: #eafffb; border-bottom-right-radius: 3px; }
.iv-done { align-self: center; text-align: center; color: var(--ok); border: 1px solid var(--accent-dim); border-radius: 8px; padding: 10px 14px; margin-top: 6px; font-size: 14px; }
.iv-repo-link { display: inline-block; margin-top: 8px; color: var(--accent); font-weight: 600; text-decoration: none; }
.iv-repo-link:hover { text-decoration: underline; }
/* Footer en columna: el input ocupa TODO el ancho (como la barra); el botón "Enviar" va debajo. */
.modal-foot { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--edge); }
/* Input multilínea: ancho completo, envuelve y auto-crece (JS ajusta la altura). Nunca una línea
   infinita: pre-wrap + break-word garantizan ver el párrafo completo; scroll interno tras 160px. */
.modal-foot textarea { width: 100%; box-sizing: border-box; background: #070b10; border: 1px solid var(--edge); color: var(--fg); padding: 10px 12px; border-radius: var(--r); font-family: var(--font-ui); font-size: 14.5px; line-height: 1.5; resize: none; overflow-y: auto; min-height: 44px; max-height: 160px; white-space: pre-wrap; overflow-wrap: break-word; word-break: break-word; }
.modal-foot textarea:focus { border-color: var(--accent-dim); }
.modal-foot .iv-foot-actions { display: flex; align-items: center; gap: 8px; }
.modal-foot .btn-primary { flex: 0 0 auto; }
/* Dictado por voz dentro de la entrevista (responder hablando en vez de teclear). */
.iv-mic { margin-right: auto; background: transparent; border: 1px solid var(--edge); color: var(--muted-2); border-radius: var(--r); padding: 8px 13px; font-size: 13px; cursor: pointer; font-family: var(--font-ui); letter-spacing: normal; transition: border-color .15s ease, color .15s ease, background .15s ease; }
.iv-mic:hover:not(:disabled) { border-color: var(--accent-dim); color: var(--fg); }
.iv-mic:disabled { opacity: .5; cursor: default; }
.iv-mic.rec { border-color: #e66; color: #e66; background: rgba(230, 70, 70, .12); }
/* Barra de tiempo-guía de la entrevista (no corta la sesión; orienta a cerrar un MVP). */
.iv-timebar { position: relative; height: 4px; margin: 4px 16px 0; background: var(--panel-2); border-radius: 3px; }
.iv-timebar-fill { height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width 0.9s linear; box-shadow: var(--glow-soft); }
.iv-timebar-label { position: absolute; right: 1px; bottom: 6px; font-size: 11px; letter-spacing: 0.3px; color: var(--muted-2); pointer-events: none; }
.iv-timebar.over .iv-timebar-fill { background: #e6a23c; }
.iv-timebar.over .iv-timebar-label { color: #e6a23c; }
/* Entrevistas en pausa: lista en "Actividad reciente" para elegir cuál continuar (no modal invasivo). */
.paused-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.paused-title { font-family: var(--font-display); font-size: 12px; text-transform: uppercase; letter-spacing: 2px; color: var(--muted-2); margin: 0 0 2px; }
.paused-item { display: flex; align-items: stretch; background: var(--panel-2); border: 1px solid var(--accent-dim); border-radius: 8px; overflow: hidden; transition: border-color .15s ease; }
.paused-item:hover { border-color: var(--accent); }
.paused-item-main { flex: 1; min-width: 0; text-align: left; background: transparent; border: none; padding: 10px 12px; cursor: pointer; font-family: var(--font-ui); letter-spacing: normal; transition: background .15s ease; }
.paused-item-main:hover { background: #0b1219; }
.paused-item-title { color: var(--fg); font-size: 14px; font-weight: 500; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paused-item-meta { color: var(--accent); font-size: 11.5px; letter-spacing: 0.3px; margin-top: 3px; }
.paused-item-badge { display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 999px; background: rgba(90, 160, 220, .16); color: var(--accent); border: 1px solid var(--edge); font-size: 10.5px; font-weight: 600; letter-spacing: 0.3px; vertical-align: middle; }
.paused-item-discard { flex: 0 0 auto; width: 38px; background: transparent; border: none; border-left: 1px solid var(--edge); color: var(--muted-2); cursor: pointer; font-size: 13px; font-family: var(--font-ui); letter-spacing: normal; transition: background .15s ease, color .15s ease; }
.paused-item-discard:hover { background: rgba(230, 70, 70, .14); color: #e66; }
.proj { border: 1px solid var(--edge); padding: 10px; margin-bottom: 8px; border-radius: 6px; }
.proj-head { display: flex; justify-content: space-between; align-items: baseline; }
.proj-head strong { font-size: 14.5px; font-weight: 600; }
.proj .pct { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--accent); text-shadow: var(--glow-soft); }
.proj .alert { color: var(--alert); font-size: 12.5px; display: block; margin-top: 2px; }
.bar { height: 4px; background: #070b10; margin: 7px 0; border-radius: 2px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); box-shadow: var(--glow-soft); }
.scores { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

/* Secciones del panel: En progreso · Pendientes de onboarding · Terminados */
.proj-section { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--edge); }
.proj-section:first-child { margin-top: 0; }
.proj-section-title { font-family: var(--font-display); font-size: 12px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); }
.proj-section-count { font-family: var(--font-mono); font-size: 11px; color: var(--muted-2); }
.proj-done { opacity: .62; }
.proj-done .pct { color: var(--muted); text-shadow: none; }

/* F2: repos sin onboarding (cada repo = un proyecto) */
.proj-unonboarded { border-style: dashed; opacity: .92; }
.proj-tag { font-size: 10px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: var(--muted-2); border: 1px solid var(--edge); border-radius: 999px; padding: 1px 8px; }
.proj-desc { font-size: 12.5px; color: var(--muted); margin: 6px 0 8px; line-height: 1.35; }
.proj-onboard { background: transparent; border: 1px solid var(--accent); color: var(--accent); font-family: var(--font-ui); font-size: 12.5px; font-weight: 600; padding: 5px 12px; border-radius: 6px; cursor: pointer; transition: background .15s ease, color .15s ease; }
.proj-onboard:hover { background: var(--accent); color: #04080d; }

/* Bounty board (panel del dev) — TABLA scrolleable */
.bounty-table-wrap { overflow: auto; background: var(--panel); }
.bounty-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.bounty-table thead th { position: sticky; top: 0; z-index: 1; background: var(--panel-2, #0b1219); text-align: left; padding: 10px 14px; font-family: var(--font-display); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--edge); }
.bounty-table td { padding: 10px 14px; border-bottom: 1px solid var(--edge); vertical-align: top; }
.bounty-table tbody tr:hover { background: rgba(255,255,255,.02); }
.bounty-row.mine { background: rgba(90,160,220,.06); }
.bounty-row.done { opacity: .55; }
.bt-proj { font-weight: 600; white-space: nowrap; }
.bt-tarea { min-width: 180px; }
.bt-tarea .bounty-tag { display: inline-block; margin-right: 6px; }
.bt-tarea-title { font-weight: 600; }
.bt-desc { color: var(--muted); max-width: 520px; line-height: 1.4; }
.bt-deadline { font-family: var(--font-mono); font-size: 12px; color: var(--alert); white-space: nowrap; }

/* Bounty card (usada en el kanban del dev) */
.bounty-list { max-width: 860px; margin: 0 auto; width: 100%; }
.bounty-proj { display: flex; align-items: baseline; gap: 8px; margin: 18px 0 8px; padding-bottom: 5px; border-bottom: 1px solid var(--edge); }
.bounty-proj:first-child { margin-top: 0; }
.bounty-proj strong { font-family: var(--font-display); font-size: 15px; letter-spacing: .5px; }
.bounty-proj-count { font-family: var(--font-mono); font-size: 11px; color: var(--muted-2); }
.bounty { border: 1px solid var(--edge); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; background: rgba(255,255,255,.012); }
.bounty-mine { border-color: var(--accent); box-shadow: var(--glow-soft); }
.bounty-done { opacity: .6; }
.bounty-head { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.bounty-head .bounty-tag { align-self: flex-start; }
/* Tarjeta mínima de "Próximas a vencer" (solo ID + título + deadline) */
.bounty-mini { padding: 8px 10px; }
.bounty-mini-title { font-size: 13px; font-weight: 600; margin-top: 3px; line-height: 1.3; }
/* Celda de acción en la tabla de bounties */
.bt-accion { white-space: nowrap; }
.bt-estado { font-size: 12px; font-weight: 600; }
.bt-estado.mine { color: var(--accent); }
.bt-estado.done { color: var(--muted); }
.bounty-tag { font-family: var(--font-mono); font-size: 11px; color: var(--accent); border: 1px solid var(--edge); border-radius: 4px; padding: 1px 7px; white-space: nowrap; }
.bounty-title { font-size: 14.5px; font-weight: 600; }
.bounty-deadline { font-family: var(--font-mono); font-size: 12px; color: var(--alert); margin-top: 5px; }
.bounty-desc { font-size: 13px; color: var(--muted); line-height: 1.4; margin-top: 6px; }
.bounty-crit { margin-top: 7px; font-size: 12.5px; }
.bounty-crit summary { cursor: pointer; color: var(--muted-2); }
.bounty-crit ul { margin: 6px 0 0 16px; color: var(--muted); }
.bounty-crit li { margin: 2px 0; }
.bounty-foot { margin-top: 10px; }
.bounty-status { font-size: 12.5px; font-weight: 600; }
.bounty-status.mine { color: var(--accent); }
.bounty-status.done { color: var(--muted); }
.bounty-claim { background: var(--accent); border: none; color: #04080d; font-family: var(--font-ui); font-size: 13px; font-weight: 700; padding: 6px 16px; border-radius: 6px; cursor: pointer; transition: filter .15s ease; }
.bounty-claim:hover { filter: brightness(1.12); }
.bounty-claim:disabled { opacity: .7; cursor: default; }

/* tabs */
.tabs { display: flex; gap: 4px; }
.tab { background: transparent; border: 1px solid var(--edge); color: var(--muted); padding: 6px 18px; font-family: var(--font-display); font-size: 15px; font-weight: 600; letter-spacing: 1.5px; border-radius: var(--r); cursor: pointer; transition: color .15s ease, border-color .15s ease; }
.tab:hover { color: var(--fg); }
.tab.active { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); box-shadow: var(--glow); }
/* El atributo hidden debe ganar SIEMPRE (evita que .kanban{display:grid}/.btn{display:flex} lo tapen). */
[hidden] { display: none !important; }
.view { flex: 1; overflow: hidden; }

/* núcleo — orbe neuronal animado (canvas) */
.panel-center { display: flex; flex-direction: column; }
#core { flex: 1; min-height: 0; position: relative; }
#core-canvas { display: block; width: 100%; height: 100%; }
.core-hint { font-size: 12px; margin: 8px 0 0; text-align: center; }
.feed { line-height: 1.6; font-size: 14px; }
.feed .feed-line { padding: 7px 0; border-bottom: 1px solid var(--edge); }
.feed .feed-reply { color: var(--fg); }
.feed .feed-said { color: var(--muted); font-style: italic; }

/* kanban */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--edge); min-height: 0; }
.kanban .col { background: var(--panel); padding: 12px; overflow: auto; display: flex; flex-direction: column; }
.col-title { font-family: var(--font-display); font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; font-weight: 700; position: sticky; top: 0; }
.kanban .count { font-family: var(--font-display); font-size: 14px; color: var(--accent); margin-left: 4px; text-shadow: var(--glow-soft); }
.col-body { flex: 1; }
.card { border: 1px solid var(--edge); border-left: 3px solid var(--accent-dim); padding: 10px; margin-bottom: 8px; border-radius: 5px; background: var(--panel-2); }
.card.done { border-left-color: var(--accent); opacity: 0.75; }
/* H-101: abordada = hay commit pero criterios sin confirmar (ámbar, no verde de done). */
.card.abordada { border-left-color: #d9a441; }
.abordada-tag { font-family: var(--font-mono); font-size: 11px; color: #d9a441; margin-top: 6px; letter-spacing: 0.3px; }
/* T-140 Fase 3: handoff (self-report del dev). Neutral a propósito — NO es un badge de estado (el
   estado verificado lo dan .done/.abordada). Es información que el dev reporta, no un veredicto. */
.handoff { margin-top: 8px; border-top: 1px dashed var(--edge); padding-top: 7px; }
.handoff-summary { cursor: pointer; color: var(--muted-2); font-size: 12.5px; }
.handoff-summary:hover { color: var(--muted); }
.handoff-slot { margin-top: 7px; font-size: 12.5px; color: var(--muted); }
.handoff-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.handoff-label { font-family: var(--font-mono); font-size: 11px; color: var(--muted-2); letter-spacing: 0.3px; }
.handoff-when { font-family: var(--font-mono); font-size: 11px; color: var(--muted-2); }
.handoff-note { margin: 5px 0; font-size: 11.5px; font-style: italic; }
.handoff-content { margin: 6px 0 0; padding: 8px; background: var(--panel); border: 1px solid var(--edge); border-radius: 5px; font-family: var(--font-mono); font-size: 12px; color: var(--fg); white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow: auto; }
.card .tag { font-family: var(--font-mono); font-size: 11px; color: var(--accent); letter-spacing: 0.5px; }
.card .title { font-size: 14px; font-weight: 500; margin: 4px 0; line-height: 1.4; }
.card .meta { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.claim-btn { margin-top: 7px; background: transparent; border: 1px solid var(--accent-dim); color: var(--accent); padding: 4px 12px; font-family: var(--font-display); font-size: 12.5px; font-weight: 600; letter-spacing: 1.5px; cursor: pointer; border-radius: 4px; }
.claim-btn:hover { background: var(--accent-dim); color: var(--bg); }
.claim-btn:disabled { opacity: 0.6; cursor: default; }
/* T4/T5: panel de acceso tras el claim (estado del grant + clone + descargar brief). */
.grant-panel { margin-top: 8px; padding: 8px; border: 1px solid var(--accent-dim); border-radius: 5px; display: flex; flex-direction: column; gap: 6px; }
.grant-status { font-size: 12.5px; font-weight: 600; color: var(--accent); }
.grant-clone { display: block; font-size: 11.5px; background: var(--bg); border: 1px solid var(--accent-dim); border-radius: 4px; padding: 4px 6px; overflow-x: auto; white-space: nowrap; }
.brief-btn { align-self: flex-start; background: var(--accent); border: 1px solid var(--accent); color: var(--bg); padding: 4px 12px; font-family: var(--font-display); font-size: 12px; font-weight: 600; letter-spacing: 1px; cursor: pointer; border-radius: 4px; }
.brief-btn:hover { opacity: 0.85; }
.brief-btn:disabled { opacity: 0.6; cursor: default; }
.bounty-foot .brief-btn { margin-left: 8px; }

/* wiki: lista · lector · grafo */
.wiki-grid { min-height: 0; display: grid; grid-template-columns: 230px 1.35fr 1fr; gap: 1px; background: var(--edge); }
.wiki-list-pane, .wiki-reader, .wiki-graph-pane { background: var(--panel); padding: 12px 14px; overflow: auto; }
.wiki-list-pane h3, .wiki-graph-pane h3 { font-family: var(--font-display); font-size: 12px; letter-spacing: 2.5px; color: var(--muted); margin: 0 0 8px; }
.wiki-list-pane .count { color: var(--accent); }
.wiki-filter { width: 100%; background: #070b10; border: 1px solid var(--edge); color: var(--fg); padding: 7px 9px; font-family: var(--font-ui); font-size: 13.5px; margin-bottom: 8px; border-radius: 4px; }
.wiki-filter:focus { border-color: var(--accent-dim); }
/* .wiki-item ahora es un <button> (a11y P0-3): resets para conservar el look de fila de lista */
.wiki-item { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 6px 9px; cursor: pointer; border-radius: 4px; font-size: 14px; background: transparent; border: none; color: var(--fg); font-family: var(--font-ui); font-weight: 400; text-align: left; letter-spacing: normal; }
.wiki-item:hover { background: #0f1723; }
.wiki-item.active { background: var(--accent-dim); color: #eafffb; }
.wiki-item .wi-area { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.wiki-item.active .wi-area { color: #eafffb; }

/* lector estilo Obsidian: prosa Inter, jerarquía clara, tablas reales */
.wiki-reader { line-height: 1.7; font-size: 15px; }
.wiki-title {
  font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--accent); margin: 0 0 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--edge); text-shadow: var(--glow-soft);
}
.wiki-reader h1, .wiki-reader h2, .wiki-reader h3, .wiki-reader h4 { font-family: var(--font-display); color: var(--fg); margin: 20px 0 8px; letter-spacing: 0.5px; }
.wiki-reader h2 { font-size: 20px; border-bottom: 1px solid var(--edge); padding-bottom: 5px; }
.wiki-reader h3 { font-size: 17px; }
.wiki-reader h4 { font-size: 15.5px; color: var(--muted); }
.wiki-reader p { margin: 8px 0; color: #c3d2e4; }
.wiki-reader ul, .wiki-reader ol { margin: 8px 0 8px 22px; padding: 0; color: #c3d2e4; }
.wiki-reader li { margin: 3px 0; }
.wiki-reader code { background: #070b10; border: 1px solid var(--edge); padding: 1px 6px; border-radius: 4px; color: var(--accent); font-family: var(--font-mono); font-size: 13px; }
.wiki-reader pre { background: #070b10; border: 1px solid var(--edge); padding: 12px; overflow-x: auto; border-radius: 6px; }
.wiki-reader pre code { background: none; border: none; color: var(--fg); }
.wiki-reader table { border-collapse: collapse; margin: 14px 0; font-size: 14px; display: block; max-width: 100%; overflow-x: auto; }
.wiki-reader th { font-family: var(--font-display); font-size: 12.5px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--fg); background: var(--panel-2); border: 1px solid var(--edge); padding: 8px 13px; }
.wiki-reader td { border: 1px solid var(--edge); padding: 8px 13px; color: #c3d2e4; vertical-align: top; }
.wiki-reader tbody tr:hover td { background: rgba(53, 224, 200, 0.045); }
.wiki-reader blockquote { margin: 12px 0; padding: 9px 15px; border-left: 3px solid var(--accent-dim); background: var(--panel-2); border-radius: 0 6px 6px 0; color: #b7c6d8; }
.wiki-reader hr { border: none; border-top: 1px solid var(--edge); margin: 20px 0; }
.wiki-reader del { color: var(--muted-2); }
.wiki-reader a.ext { color: var(--accent); text-decoration: underline dotted; text-underline-offset: 3px; }
.wiki-reader a.ext:hover { text-decoration: underline solid; }
.wiki-reader li.task { list-style: none; margin-left: -20px; }
.task-check { display: inline-block; width: 15px; height: 15px; margin-right: 7px; vertical-align: -2px; border: 1px solid var(--edge); border-radius: 4px; background: #070b10; }
.task-check.done { background: var(--accent-dim); border-color: var(--accent-dim); position: relative; }
.task-check.done::after { content: '✓'; position: absolute; inset: 0; color: #eafffb; font-size: 11px; line-height: 15px; text-align: center; }
.wl { color: var(--accent); cursor: pointer; border-bottom: 1px dashed var(--accent-dim); }
.wl:hover { color: #fff; }

/* grafo del wiki: nodos orgánicos + etiquetas con halo legible */
.wiki-graph-pane svg { width: 100%; height: calc(100% - 34px); }
/* cabecera del grafo con botón colapsar (da más ancho al lector de documentos) */
.wg-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wg-head .panel-title { margin: 0; }
.wg-toggle { flex: 0 0 auto; background: transparent; border: 1px solid var(--edge); color: var(--muted); width: 26px; height: 24px; border-radius: var(--r); cursor: pointer; font-family: var(--font-ui); font-size: 13px; line-height: 1; padding: 0; letter-spacing: normal; transition: color .15s ease, border-color .15s ease; }
.wg-toggle:hover { color: var(--accent); border-color: var(--accent-dim); }
.wiki-grid.graph-collapsed { grid-template-columns: 230px 1fr 30px; }
.wiki-grid.graph-collapsed .wiki-graph-pane { padding: 12px 2px; overflow: hidden; }
.wiki-grid.graph-collapsed .wiki-graph-pane svg { display: none; }
.wiki-grid.graph-collapsed .wiki-graph-pane .panel-title { display: none; }
.wg-edge { stroke: var(--edge); stroke-width: 1; }
.wg-edge.hot { stroke: var(--accent); stroke-width: 1.4; }
.wg-node circle { fill: var(--accent-dim); stroke: var(--accent); stroke-width: 1; cursor: pointer; transition: r .15s ease; }
.wg-node text {
  fill: #b7c6d8; font-size: 10.5px; font-family: var(--font-ui); pointer-events: none;
  paint-order: stroke; stroke: var(--panel); stroke-width: 3px; stroke-linejoin: round;
}
.wg-node.hot circle, .wg-node.sel circle { fill: var(--accent); filter: drop-shadow(0 0 6px rgba(53, 224, 200, 0.6)); }
.wg-node.hot text, .wg-node.sel text { fill: var(--fg); font-weight: 600; }
.wg-node.dim { opacity: 0.18; }
/* D9: focus-mode — lo no conectado se oculta (no solo se atenúa) con transición suave. */
.wg-node, .wg-edge { transition: opacity .28s ease; }
.wg-node.hidden, .wg-edge.hidden { opacity: 0; pointer-events: none; }
/* D10: nodo en arrastre. */
.wg-node.drag circle { cursor: grabbing; stroke-width: 2; }
/* D9: botón "ver todo" mientras hay focus. */
.wg-reset {
  position: absolute; left: 8px; bottom: 8px; z-index: 3;
  font: 11px var(--font-ui); color: var(--accent); background: var(--panel);
  border: 1px solid var(--edge); border-radius: 6px; padding: 3px 8px; cursor: pointer;
}
.wg-reset:hover { border-color: var(--accent); }
.wiki-graph-pane { position: relative; }
@media (prefers-reduced-motion: reduce) { .wg-node, .wg-edge { transition: none; } }

/* B4 (F21): badge del validador independiente deep_horse (estado V0-V4 + veredicto de merge). */
.horse-badge { margin-top: 6px; font-size: 11px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.horse-badge .hv-label { opacity: .6; letter-spacing: .04em; text-transform: uppercase; }
.hv-chip { padding: 1px 5px; border-radius: 4px; font-variant-numeric: tabular-nums; border: 1px solid transparent; }
.hv-pass { background: rgba(52,199,89,.15); color: #2ea043; }
.hv-fail { background: rgba(255,69,58,.15); color: #f85149; }
.hv-pending, .hv-skip { background: rgba(120,120,128,.15); color: #8b949e; }
.hv-error { background: rgba(255,159,10,.18); color: #d29922; }
.hv-merge { margin-left: 2px; padding: 1px 6px; border-radius: 999px; font-weight: 600; }
.hv-merge.hv-ok { background: rgba(52,199,89,.18); color: #2ea043; }
.hv-merge.hv-block { background: rgba(255,69,58,.16); color: #f85149; }

/* D11: panel de instalación del CLI (vista dev) */
.cli-install { margin: 8px 0; padding: 10px; border: 1px solid var(--accent-dim); border-radius: 6px; display: flex; flex-direction: column; gap: 8px; }
.cli-oneliner { display: block; font-size: 11.5px; background: var(--bg); border: 1px solid var(--accent-dim); border-radius: 4px; padding: 6px 8px; overflow-x: auto; white-space: nowrap; }

/* T07/T10: vista Usuarios (panel del líder) — alta a la izquierda, lista de cuentas a la derecha. */
.users-grid { grid-template-columns: 1fr 1.6fr; }
.user-form { display: flex; flex-direction: column; gap: 10px; }
.user-form .field { flex-direction: column; align-items: stretch; gap: 4px; }
.user-form input, .user-form select { background: #070b10; border: 1px solid var(--edge); color: var(--fg); padding: 8px 9px; font-family: var(--font-ui); font-size: 13px; border-radius: var(--r); }
.users-list { display: flex; flex-direction: column; gap: 10px; }
.user-row { border: 1px solid var(--edge); border-radius: var(--r); padding: 10px 12px; background: #070b10; }
.user-head { display: flex; align-items: center; gap: 8px; }
.user-name { font-family: var(--font-display); font-size: 16px; letter-spacing: .3px; }
.user-role { font-family: var(--font-mono); font-size: 11px; color: var(--accent); border: 1px solid var(--accent-dim); border-radius: 999px; padding: 1px 8px; text-transform: uppercase; }
.user-meta { font-size: 12px; margin-top: 3px; }
.user-github { font-size: 12px; margin-top: 4px; color: var(--fg); }
.user-github.muted { color: var(--muted); }
.user-edit { margin-top: 8px; }
.user-edit > summary { cursor: pointer; color: var(--accent); font-size: 12px; }
.user-edit-form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.user-edit-form .field { flex-direction: column; align-items: stretch; gap: 4px; }
.user-edit-form input, .user-edit-form select { background: var(--bg); border: 1px solid var(--edge); color: var(--fg); padding: 7px 9px; font-family: var(--font-ui); font-size: 13px; border-radius: var(--r); }
.users-count.count, #users-count { color: var(--accent); margin-left: 4px; }
