/* ── Tema claro (por defecto) ─────────────────────────────── */
:root {
  --bg: #faf9f5;
  --panel: #ffffff;
  --ink: #3d3929;
  --ink-soft: #6f6a58;
  --accent: #c96442;
  --bubble: #f0eee6;
  --border: #e6e3d9;
  --chip-bg: #f5f3ec;
  --titlebar: #f6f4ee;
  --desk: #e9e6dd;          /* mesa: fondo alrededor de la ventana */
  --skill-bg: #f7f1ee;
  --skill-border: #e8d5cc;
  --note-bg: #f7f1ee;
  --shadow: rgba(0,0,0,.25);
  --shadow-soft: rgba(0,0,0,.05);
  --placeholder: #b4afa0;
  --ok: #2e7d32;
  --mono: "SF Mono", Menlo, monospace;
}

/* ── Tema oscuro ──────────────────────────────────────────── */
body.dark {
  --bg: #262624;
  --panel: #30302e;
  --ink: #f5f4ee;
  --ink-soft: #a3a096;
  --accent: #d97757;
  --bubble: #3a3a37;
  --border: #3d3d3a;
  --chip-bg: #333331;
  --titlebar: #2d2d2b;
  --desk: #1a1a19;
  --skill-bg: #3a2e29;
  --skill-border: #5c4437;
  --note-bg: #332924;
  --shadow: rgba(0,0,0,.55);
  --shadow-soft: rgba(0,0,0,.25);
  --placeholder: #6d6a62;
  --ok: #6cc16f;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--desk);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  transition: background .25s ease;
}

/* Ventana 16:9 — escala con el viewport, apta para grabación a cualquier resolución */
.window {
  position: relative;          /* ancla del diálogo de plugins, que va dentro de la ventana */
  width: min(96vw, calc(96vh * 16 / 9));
  aspect-ratio: 16 / 9;
  background: var(--bg);
  border-radius: 14px;
  box-shadow: 0 24px 80px var(--shadow);
  transition: background .25s ease;
  display: flex; flex-direction: column;
  overflow: hidden;
  font-size: clamp(10px, 1.35vw, 19px);
}
body.bare .window { border-radius: 0; box-shadow: none; width: 100vw; height: 100vh; aspect-ratio: auto; }
body.bare { background: var(--bg); }

.titlebar {
  height: 2.6em; flex: 0 0 auto;
  display: flex; align-items: center;
  padding: 0 1em;
  border-bottom: 1px solid var(--border);
  background: var(--titlebar);
  gap: .5em;
}
.dots { display: flex; gap: .45em; }
.dot { width: .75em; height: .75em; border-radius: 50%; }
.dot.r { background: #ff5f57; } .dot.y { background: #febc2e; } .dot.g { background: #28c840; }
.titlebar .title {
  flex: 1; text-align: center;
  font-size: .82em; font-weight: 600; color: var(--ink-soft);
  letter-spacing: .02em;
}
.titlebar .spacer { width: 3.2em; }

/* scroll-behavior queda en 'auto' a propósito: con 'smooth', cada reasignación
   de scrollTop durante el streaming reinicia la animación y el hilo se queda
   colgado a media altura en vez de seguir al texto. */
.chat { flex: 1; overflow-y: auto; padding: 1.6em 0 1em; }
.chat::-webkit-scrollbar { display: none; }
.inner { max-width: 42em; margin: 0 auto; padding: 0 1.5em; }

.msg { margin-bottom: 1.4em; animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(.5em); } to { opacity: 1; transform: none; } }

.msg.user { display: flex; justify-content: flex-end; }
.msg.user .bubble {
  background: var(--bubble);
  border-radius: 1.1em;
  padding: .7em 1.05em;
  max-width: 78%;
  line-height: 1.5;
  white-space: pre-wrap;
}
.msg.user .bubble.cmd {
  font-family: var(--mono);
  font-size: .88em;
  color: var(--accent);
  font-weight: 600;
}

.msg.assistant { display: flex; gap: .8em; }
.avatar {
  flex: 0 0 auto;
  width: 1.8em; height: 1.8em;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  margin-top: .15em;
}
.avatar svg { width: 62%; height: 62%; fill: #fff; }
.msg.assistant .body {
  flex: 1;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.65;
  font-size: 1.04em;
  white-space: pre-wrap;
}
.msg.assistant .body strong { font-weight: 700; }
.msg.assistant .body em { font-style: italic; color: var(--ink-soft); }
.msg.assistant .body code {
  font-family: var(--mono); font-size: .82em;
  background: var(--chip-bg); border: 1px solid var(--border);
  border-radius: .35em; padding: .08em .35em;
}
.msg.assistant .body .note {
  display: block;
  border-left: 3px solid var(--accent);
  background: var(--note-bg);
  padding: .6em .9em;
  border-radius: .35em;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: .84em; line-height: 1.5;
  color: var(--ink-soft);
  margin: .2em 0 .6em;
}

.cursor {
  display: inline-block;
  width: .5em; height: 1.05em;
  background: var(--ink);
  vertical-align: text-bottom;
  margin-left: .08em;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Indicador de pensamiento — la estrella de Claude */
.thinking {
  display: inline-flex; align-items: center; gap: .55em;
  color: var(--ink-soft); font-style: italic; font-size: .95em;
}
.thinking .star {
  width: 1.05em; height: 1.05em; flex: 0 0 auto;
  fill: var(--accent);
  transform-origin: 50% 50%;
  animation: starspin 1.6s cubic-bezier(.45,0,.25,1) infinite;
}
@keyframes starspin {
  0%   { transform: rotate(0deg)   scale(.72); opacity: .45; }
  50%  { transform: rotate(180deg) scale(1);   opacity: 1;   }
  100% { transform: rotate(360deg) scale(.72); opacity: .45; }
}
/* El texto respira con la estrella */
.thinking .word { animation: shimmer 1.6s ease-in-out infinite; }
@keyframes shimmer { 0%,100% { opacity: .55; } 50% { opacity: 1; } }

.tool {
  display: inline-flex; align-items: center; gap: .6em;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  border-radius: .6em;
  padding: .5em .9em;
  font-family: var(--mono); font-size: .78em; color: var(--ink-soft);
  margin-bottom: 1.4em; margin-left: 2.6em;
  animation: rise .35s ease both;
}
.tool .spin {
  width: .95em; height: .95em;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: rot .8s linear infinite;
}
@keyframes rot { to { transform: rotate(360deg); } }
.tool .check { color: var(--ok); font-weight: 700; display: none; }
.tool.done .spin { display: none; }
.tool.done .check { display: inline; }

/* Franja de iteraciones — v1…v10 encendiéndose una a una, con su motivo */
.iterstrip {
  margin: .3em 0 1.4em 2.6em;
  animation: rise .35s ease both;
}
.iterstrip .row { display: flex; align-items: center; gap: .5em; flex-wrap: wrap; }
.iterstrip .chip {
  font-family: var(--mono); font-size: .74em; font-weight: 700;
  color: var(--ink-soft); background: var(--chip-bg);
  border: 1px solid var(--border); border-radius: .5em;
  padding: .22em .55em;
  transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease;
}
.iterstrip .chip.active {
  color: #fff; background: var(--accent); border-color: var(--accent);
  transform: scale(1.08);
}
.iterstrip .chip.done { color: var(--ink-soft); background: transparent; opacity: .55; }
.iterstrip .chip.final { color: #fff; background: var(--ok); border-color: var(--ok); opacity: 1; transform: none; }
.iterstrip .note {
  margin-top: .5em; min-height: 1.4em;
  font-size: .82em; color: var(--ink-soft); font-style: italic;
}

/* Chip de skill invocada */
.skillchip {
  display: inline-flex; align-items: center; gap: .55em;
  background: var(--skill-bg); border: 1px solid var(--skill-border);
  border-radius: .6em; padding: .5em .9em;
  font-size: .8em; color: var(--accent); font-weight: 600;
  margin-bottom: 1.4em;
  animation: rise .35s ease both;
}
.skillchip .plugin {
  font-family: var(--mono); font-weight: 400; font-size: .9em;
  color: var(--ink-soft);
}

.composer { flex: 0 0 auto; padding: 0 1.5em 1.4em; position: relative; }
.composer .wrap { max-width: 42em; margin: 0 auto; position: relative; }
.composer .box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 1.1em;
  box-shadow: 0 2px 10px var(--shadow-soft);
  padding: .95em 1.1em;
  display: flex; align-items: flex-end; gap: .8em;
}
.composer .field {
  flex: 1; min-height: 1.5em; line-height: 1.5; color: var(--ink);
  max-height: 6em; overflow-y: auto;   /* 4 líneas exactas — sin líneas cortadas */
  white-space: pre-wrap;
}
.composer .field::-webkit-scrollbar { display: none; }
.composer .field .placeholder { color: var(--placeholder); }
.composer .field .slashtext { font-family: var(--mono); color: var(--accent); font-weight: 600; }
.composer .send {
  flex: 0 0 auto;
  width: 2em; height: 2em; border-radius: .65em;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s ease, opacity .2s;
  opacity: .35;
}
.composer .send.active { opacity: 1; }
.composer .send.pressed { transform: scale(.85); }
.composer .send svg { width: 55%; height: 55%; fill: #fff; }

/* Paleta de comandos slash */
.palette {
  position: absolute; bottom: calc(100% + .55em); left: 0; right: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: .9em;
  box-shadow: 0 10px 34px var(--shadow);
  padding: .4em;
  max-height: 13em; overflow: hidden;
  display: none;
  animation: rise .18s ease both;
}
.palette.show { display: block; }
.palette .row {
  display: flex; align-items: baseline; gap: .7em;
  padding: .45em .7em; border-radius: .55em;
  font-size: .82em;
}
.palette .row.sel { background: var(--chip-bg); }
.palette .row .cmd { font-family: var(--mono); font-weight: 600; color: var(--accent); flex: 0 0 auto; }
.palette .row .desc {
  color: var(--ink-soft); font-size: .92em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ═══ Panel de documento ═══════════════════════════════════
   El .docx que genera el colaborador, visible mientras se escribe. */
.stage { flex: 1; display: flex; min-height: 0; position: relative; }  /* ancla del marco de Word */
.chatcol { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.docpanel {
  flex: 0 0 0; width: 0;
  border-left: 1px solid var(--border);
  background: var(--titlebar);
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: flex-basis .55s cubic-bezier(.4,0,.2,1), width .55s cubic-bezier(.4,0,.2,1);
}
.docpanel.open { flex-basis: 46%; width: 46%; }

.docbar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: .6em;
  padding: .75em 1em;
  border-bottom: 1px solid var(--border);
  font-size: .78em; color: var(--ink-soft);
  white-space: nowrap;
}
.docbar .ficon {
  width: 1.35em; height: 1.35em; border-radius: .25em;
  background: #2b579a; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .72em; font-weight: 700; flex: 0 0 auto;
}
.docbar .fname { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.docbar .fmeta { margin-left: auto; font-family: var(--mono); font-size: .88em; opacity: .8; }

/* Hoja de Word */
.docscroll { flex: 1; overflow-y: auto; padding: 1.2em; }
.docscroll::-webkit-scrollbar { display: none; }
.page {
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: 0 4px 18px var(--shadow-soft);
  border-radius: .2em;
  padding: 2.2em 2.4em;
  font-family: Georgia, "Times New Roman", serif;
  font-size: .74em; line-height: 1.6;
  color: var(--ink);
  min-height: 100%;
}
.page h1 {
  font-size: 1.5em; line-height: 1.25; margin-bottom: .15em;
  font-weight: 700; letter-spacing: -.01em;
}
.page .subtitle { color: var(--ink-soft); font-size: .95em; font-style: italic; margin-bottom: 1.1em; }
.page hr { border: 0; border-top: 1px solid var(--border); margin: 1.1em 0; }
.page h2 {
  font-size: 1.1em; margin: 1.3em 0 .45em; font-weight: 700;
  color: var(--accent);
}
.page p { margin-bottom: .75em; }
.page .lbl { font-weight: 700; }
.page .flag { color: var(--accent); font-weight: 700; }
.page .caret {
  display: inline-block; width: .45em; height: 1em;
  background: var(--accent); vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}

/* ═══ Gráficos dentro de la hoja ═══════════════════════════ */
.figure { margin: 1.1em 0 .9em; text-align: center; }
.figure svg { width: 100%; max-width: 21em; height: auto; }
.figure .cap {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: .82em; color: var(--ink-soft); font-style: italic;
  margin-top: .5em; line-height: 1.45;
}
.radar .grid { fill: none; stroke: var(--border); stroke-width: 1; }
.radar .spoke { stroke: var(--border); stroke-width: 1; }
.radar .axlabel {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 9.5px; fill: var(--ink-soft);
}
.radar .ring { font-family: var(--mono); font-size: 8px; fill: var(--ink-soft); opacity: .6; }
.radar .shape {
  stroke-width: 2; fill-opacity: .14;
  stroke-dasharray: 1000; stroke-dashoffset: 1000;
  animation: draw 1.5s ease-out forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
.radar .dot { animation: fadein .5s ease-out both; animation-delay: 1.2s; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
/* Velocímetro */
.gauge svg { max-width: 15em; }
.gauge .grid { stroke: var(--border); }
.gauge .needle {
  stroke-dasharray: 220; stroke-dashoffset: 220;
  animation: draw 1.3s cubic-bezier(.2,.8,.2,1) forwards;
}
.gauge .gauge-label {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 800; font-size: 1.05em; letter-spacing: .03em;
  margin-top: -.3em;
}
.pills { display: flex; flex-wrap: wrap; justify-content: center; gap: .5em; margin-top: .6em; }
.gpill {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif; font-size: .78em;
  background: var(--chip-bg); border: 1px solid var(--border);
  border-radius: 1em; padding: .3em .8em; color: var(--ink-soft);
}

.legend {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: .5em 1.1em; margin-top: .7em;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif; font-size: .84em;
}
.legend span { display: inline-flex; align-items: center; gap: .38em; color: var(--ink-soft); }
.legend i { width: .85em; height: .3em; border-radius: .15em; display: inline-block; }

/* ═══ Control de cambios de Word ═══════════════════════════ */
.page .tracked { position: relative; margin-bottom: .8em; }
.page .tracked.marked { border-left: 2px solid #d9534f; padding-left: .7em; margin-left: -.9em; }
.page del {
  color: #d9534f; text-decoration: line-through;
  text-decoration-thickness: 1px;
  opacity: 0; transition: opacity .45s ease;
}
.page del.on { opacity: 1; }
.page ins {
  color: #3f8f4f; text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 2px;
}
body.dark .page del { color: #e8776f; }
body.dark .page ins { color: #6cc16f; }

/* Globo de comentario al margen */
.page .balloon {
  display: block;
  border: 1px solid var(--border);
  border-left: 3px solid #d9534f;
  background: var(--chip-bg);
  border-radius: .35em;
  padding: .5em .75em;
  margin: .35em 0 .9em 1.2em;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: .78em; line-height: 1.45; color: var(--ink-soft);
  animation: rise .35s ease both;
}
.page .balloon b { color: var(--ink); font-weight: 700; }

/* Barra de revisión, como la de Word */
.revbar {
  display: flex; align-items: center; gap: .8em;
  padding: .5em .8em; margin-bottom: .9em;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  border-radius: .4em;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: .76em; color: var(--ink-soft);
}
.revbar .pill {
  display: inline-flex; align-items: center; gap: .35em;
  font-weight: 600;
}
.revbar .sw { width: .7em; height: .7em; border-radius: .15em; display: inline-block; }

/* ═══ Tablas dentro de la hoja ═════════════════════════════ */
.page table {
  width: 100%; border-collapse: collapse;
  margin: .8em 0 1em;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: .82em; line-height: 1.45;
}
.page th {
  text-align: left; font-weight: 700;
  background: var(--chip-bg);
  border-bottom: 2px solid var(--border);
  padding: .45em .6em;
  color: var(--accent);
}
.page td {
  border-bottom: 1px solid var(--border);
  padding: .45em .6em;
  vertical-align: top;
}
.page tr.hi td { background: var(--note-bg); font-weight: 600; }
.page td .box { font-family: var(--mono); color: var(--accent); font-weight: 700; }

/* ═══ Ficha de lector beta dentro de la hoja ═══════════════ */
.betacard {
  display: flex; gap: .9em; align-items: flex-start;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: .45em;
  background: var(--chip-bg);
  padding: .85em 1em;
  margin: .8em 0;
  animation: rise .4s ease both;
}
.betacard .face {
  flex: 0 0 auto;
  width: 2.6em; height: 2.6em; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700; font-size: .82em; color: #fff;
  letter-spacing: .02em;
}
.betacard .who { flex: 1; min-width: 0; }
.betacard .nm { font-weight: 700; font-size: 1.02em; }
.betacard .dm {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: .82em; color: var(--ink-soft); line-height: 1.45; margin-top: .1em;
}
.betacard .stars {
  margin-top: .35em; font-size: .95em; letter-spacing: .1em; color: var(--accent);
}
.betacard .stars .off { opacity: .28; }
.betacard .qt { margin-top: .4em; font-style: italic; line-height: 1.5; }

/* ═══ Certificado firmado (AWAP) ════════════════════════════ */
.certcard {
  border: 1px solid var(--border);
  border-radius: .7em;
  padding: 1.3em 1.5em;
  background: var(--panel);
  box-shadow: 0 4px 18px var(--shadow-soft);
  margin: .6em 0 1.2em;
  animation: rise .4s ease both;
}
.certcard .ribbon {
  display: inline-flex; align-items: center; gap: .4em;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700; font-size: .68em; letter-spacing: .06em; text-transform: uppercase;
  padding: .32em .8em; border-radius: 1em; margin-bottom: 1em;
}
.certcard .ribbon.draft { background: rgba(217,153,34,.15); color: #d29922; border: 1px solid rgba(217,153,34,.4); }
.certcard .ribbon.official { background: rgba(63,143,79,.15); color: var(--ok); border: 1px solid rgba(63,143,79,.4); }
.certcard .head { font-family: -apple-system, BlinkMacSystemFont, sans-serif; margin-bottom: 1.1em; }
.certcard .head .brand { font-weight: 800; font-size: 1.05em; letter-spacing: -.01em; }
.certcard .head .brand b { color: var(--accent); }
.certcard .head .ttl { font-family: Georgia, serif; font-size: 1.3em; font-weight: 700; margin-top: .5em; }
.certcard .head .by { color: var(--ink-soft); font-size: .84em; margin-top: .15em; }
.certcard .body { display: flex; gap: 1.4em; align-items: flex-start; flex-wrap: wrap; }
.certcard .rows { flex: 1; min-width: 14em; }
.certcard .row {
  display: flex; justify-content: space-between; gap: 1em;
  padding: .5em 0; border-bottom: 1px solid var(--border);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif; font-size: .8em;
}
.certcard .row:last-child { border-bottom: none; }
.certcard .row .k { color: var(--ink-soft); flex: 0 0 auto; }
.certcard .row .v { font-family: var(--mono); text-align: right; word-break: break-all; color: var(--ink); }
.certcard .qrwrap { flex: 0 0 auto; text-align: center; }
.certcard .qrwrap svg { width: 6.5em; height: 6.5em; }
.certcard .qrwrap .qrcap {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: .68em; color: var(--ink-soft); margin-top: .5em; max-width: 8em; line-height: 1.4;
}
.certcard .verify {
  margin-top: .9em; padding-top: .9em; border-top: 1px solid var(--border);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif; font-size: .78em; color: var(--accent);
}

/* Tarjeta de archivo dentro del chat */
.filecard {
  display: flex; align-items: center; gap: .7em;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: .7em;
  padding: .7em .9em;
  margin-bottom: 1.4em; margin-left: 2.6em;
  max-width: 24em;
  animation: rise .35s ease both;
}
.filecard .ficon {
  width: 1.9em; height: 1.9em; border-radius: .3em;
  background: #2b579a; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .68em; font-weight: 700; flex: 0 0 auto;
}
.filecard .fname { font-size: .84em; font-weight: 600; }
.filecard .fmeta { font-size: .74em; color: var(--ink-soft); font-family: var(--mono); }

/* ═══ Panel de controles en pantalla ════════════════════════
   Los parámetros de URL (?theme=, ?speed=) son cómodos para automatizar,
   pero muchos navegadores autocompletan la barra de direcciones y se
   comen la query string sin que el usuario lo note. Este panel hace lo
   mismo con clics, sin depender de la URL. */
.hud {
  position: fixed; top: .9em; right: .9em; z-index: 20;
  display: flex; align-items: center; gap: .5em;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.hud button {
  all: unset; cursor: pointer;
  width: 2.1em; height: 2.1em; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel); border: 1px solid var(--border);
  color: var(--ink-soft); font-size: .95em;
  box-shadow: 0 2px 8px var(--shadow-soft);
  transition: transform .12s ease, color .15s ease;
}
.hud button:hover { color: var(--ink); transform: scale(1.08); }
.hud .speedbox {
  display: none;
  align-items: center; gap: .5em;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 1.2em; padding: .35em .8em;
  box-shadow: 0 2px 8px var(--shadow-soft);
  font-size: .78em; color: var(--ink-soft);
}
.hud.open .speedbox { display: flex; }
.hud .speedbox input[type="range"] { width: 6em; accent-color: var(--accent); }
.hud .speedbox .val { font-family: var(--mono); color: var(--ink); min-width: 2.4em; text-align: right; }

.hint {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; gap: .6em;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,.42); color: #fff;
  font-size: 1.3em; letter-spacing: .02em; text-align: center;
  cursor: pointer; z-index: 10; transition: opacity .3s;
}
.hint small { font-size: .62em; opacity: .75; letter-spacing: .04em; }
.hint.gone { opacity: 0; pointer-events: none; }

/* ── El diálogo de plugins ─────────────────────────────────
   Superpuesto a la ventana, no encima de la pantalla: lo que se enseña es que esto ocurre
   DENTRO de Claude. Todo con los tokens del tema, para que funcione en claro y en oscuro. */
.dialog {
  position: absolute; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.34);
  opacity: 0; pointer-events: none; transition: opacity .28s ease;
}
.dialog.show { opacity: 1; }
.dialog .dbox {
  width: 62%; max-width: 640px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 24px 60px var(--shadow);
  transform: translateY(10px) scale(.985); transition: transform .28s ease;
  overflow: hidden;
}
.dialog.show .dbox { transform: none; }
.dhead {
  display: flex; align-items: center; padding: .85em 1.1em;
  background: var(--titlebar); border-bottom: 1px solid var(--border);
}
.dhead .dtitle { font-weight: 700; font-size: 1.02em; }
.dhead .dclose { margin-left: auto; color: var(--ink-soft); font-size: .9em; }

.dtabs { display: flex; gap: .3em; padding: .7em 1.1em 0; border-bottom: 1px solid var(--border); }
.dtab {
  padding: .5em .95em; border-radius: 8px 8px 0 0; font-size: .92em; font-weight: 600;
  color: var(--ink-soft); border: 1px solid transparent; border-bottom: none;
  transition: background .15s ease, color .15s ease, transform .12s ease;
}
.dtab.on { color: var(--ink); background: var(--panel); border-color: var(--border); }
.dtab.press { transform: scale(.94); background: var(--chip-bg); }

.dbody { padding: 1.15em; min-height: 9.5em; display: flex; flex-direction: column; gap: .7em; }
.dempty { color: var(--placeholder); font-size: .93em; }

.dfield { display: flex; align-items: center; gap: .55em; border: 1px solid var(--border);
  border-radius: 9px; padding: .7em .85em; background: var(--bg); }
.dfield .dlabel { color: var(--ink-soft); font-size: .86em; white-space: nowrap; }
.dfield .dinput { font-family: var(--mono); font-size: .92em; }

.dchip { display: flex; align-items: center; gap: .6em; font-family: var(--mono); font-size: .9em;
  color: var(--ink-soft); }
.dchip .ok { color: var(--ok); font-family: inherit; font-size: .92em; }

.dcards { display: flex; flex-direction: column; gap: .55em; }
.dcard {
  display: flex; align-items: center; gap: .8em;
  border: 1px solid var(--border); border-radius: 10px; padding: .8em .95em;
  background: var(--bg); animation: dcardIn .3s ease both;
  transition: opacity .5s ease, transform .5s ease;
}
.dcard.gone { opacity: 0; transform: translateX(-14px); }
@keyframes dcardIn { from { opacity: 0; transform: translateY(6px); } }
.dcard .dinfo { display: flex; flex-direction: column; gap: .15em; min-width: 0; }
.dcard .dname { font-weight: 600; }
.dcard .dver { font-family: var(--mono); font-size: .82em; color: var(--ink-soft); }
.dcard .dbtn {
  margin-left: auto; min-width: 2.2em; text-align: center;
  padding: .42em .8em; border-radius: 999px; font-weight: 700; font-size: .9em;
  background: var(--accent); color: #fff; transition: transform .12s ease;
}
.dcard .dbtn.press { transform: scale(.9); }
.dcard .dbtn.done { background: transparent; color: var(--ok); font-weight: 600; }
.dcard .dbtn.warn { background: transparent; color: var(--ink-soft); border: 1px solid var(--border); font-weight: 600; }
.dcard.old { opacity: .78; }

.dcard .dbtn .spin {
  display: inline-block; width: .9em; height: .9em; vertical-align: -.1em;
  border: 2px solid rgba(255,255,255,.45); border-top-color: #fff;
  border-radius: 50%; animation: rot .8s linear infinite;
}

/* ── Marco de Word ─────────────────────────────────────────
   OJO: la clase es .wframe, no .word — `.word` ya la usa el indicador «Pensando…».
   Capa sobre la misma ventana: cinta arriba, hoja al centro y el panel de HumanInk a la
   derecha, que es donde vive el add-in de verdad. Sin colores propios: los tokens del tema. */
.wframe {
  position: absolute; inset: 0; z-index: 15;
  display: flex; flex-direction: column; background: var(--desk);
  opacity: 0; pointer-events: none; transition: opacity .3s ease;
}
.wframe.show { opacity: 1; }
.wribbon {
  display: flex; gap: .2em; align-items: center;
  padding: .7em 1.1em; background: var(--titlebar); border-bottom: 1px solid var(--border);
  font-size: .9em;
}
.wtab { padding: .42em .85em; border-radius: 7px; color: var(--ink-soft); font-weight: 600; }
.wtab.hi { color: var(--accent); border: 1px solid var(--skill-border); background: var(--skill-bg); }
.wtab.press { transform: scale(.94); }

.wstage { flex: 1; display: flex; min-height: 0; padding: 1.1em; gap: 1.1em; }
.wsheet {
  flex: 1; background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  padding: 2em 2.4em; overflow: hidden; font-family: Georgia, serif; line-height: 1.75;
  font-size: .93em; color: var(--ink);
}
.wsheet p { margin-bottom: .85em; }

.wpane {
  flex: 0 0 0; width: 0; overflow: hidden;
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  transition: flex-basis .45s ease, width .45s ease;
  display: flex; flex-direction: column;
}
.wpane.open { flex-basis: 33%; width: 33%; }
.wph {
  padding: .85em 1em; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: .92em; white-space: nowrap;
}
.wlock {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .7em; padding: 1.2em; text-align: center; color: var(--ink-soft); font-size: .88em;
}
.wlock small { color: var(--placeholder); }
.wfield { display: flex; flex-direction: column; gap: .25em; padding: .8em 1em .2em; }
.wfield .wlabel { font-size: .78em; color: var(--ink-soft); }
.wfield .wval {
  font-family: var(--mono); font-size: .86em; border: 1px solid var(--border);
  border-radius: 7px; padding: .5em .65em; background: var(--bg); min-height: 2.1em;
}
.wbtn {
  margin: .9em 1em; padding: .6em; text-align: center; border-radius: 8px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: .9em;
  transition: transform .12s ease;
}
.wbtn.press { transform: scale(.96); }
.wbtn .spin {
  display: inline-block; width: .9em; height: .9em; vertical-align: -.1em;
  border: 2px solid rgba(255,255,255,.45); border-top-color: #fff;
  border-radius: 50%; animation: rot .8s linear infinite;
}
.wok { padding: .7em 1em; color: var(--ok); font-weight: 600; font-size: .88em; }
.wlist { padding: 0 1em 1em; display: flex; flex-direction: column; gap: .3em; overflow: hidden; }
.wrow {
  padding: .5em .7em; border: 1px solid var(--border); border-radius: 7px;
  background: var(--bg); font-size: .84em;
}
.wmore { padding: .35em .2em; color: var(--placeholder); font-size: .8em; }

/* El aviso de versión: lo que de verdad pinta el panel cuando hay una nueva */
.wnotice {
  margin: .8em 1em 0; padding: .75em .9em; border-radius: 8px;
  background: var(--skill-bg); border: 1px solid var(--skill-border);
  display: flex; flex-direction: column; gap: .3em; font-size: .84em;
  animation: dcardIn .35s ease both;
}
.wnotice b { color: var(--ink); }
.wnotice span { color: var(--ink-soft); }
.wnotice .wlink { color: var(--accent); font-weight: 700; }
