/* Componentes de VisualDiff. Colores, radios y movimiento salen solo de tokens.css. */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-ui);
  font-size: var(--text-m); line-height: 1.5; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: var(--text-xl); line-height: 1.25; font-weight: 600; text-wrap: balance; }
h2 { font-size: var(--text-m); font-weight: 600; }
code, pre { font-family: var(--font-code); font-size: 0.92em; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--mark-ink); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--mark); outline-offset: 2px; }

/* Barra superior */
.vd-topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 8px 16px;
  border-bottom: 1px solid var(--line); background: var(--bg); }
.vd-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 600;
  text-decoration: none; }
.vd-logo { flex: none; }
.vd-crumb { color: var(--ink-soft); text-decoration: none; font-weight: 500; }
.vd-crumb::before { content: "/"; margin-right: 12px; color: var(--line-strong); }
.vd-tabs { display: flex; gap: 2px; overflow-x: auto; min-width: 0; scrollbar-width: none; }
.vd-tabs a { padding: 6px 10px; border-radius: var(--radius-s); color: var(--ink-soft); font-size: var(--text-s);
  font-weight: 500; text-decoration: none; white-space: nowrap; transition: background-color var(--fast) ease; }
.vd-tabs a[aria-current="page"] { background: var(--mark-tint); color: var(--mark-ink); font-weight: 600; }
.vd-user { display: flex; align-items: center; gap: 10px; margin-left: auto; font-size: var(--text-s); color: var(--ink-soft); }
@media (hover: hover) and (pointer: fine) { .vd-tabs a:not([aria-current]):hover { background: var(--hover); } }
@media (max-width: 760px) { .vd-tabs { order: 3; width: 100%; } }

/* Botones y enlaces */
.vd-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--bg); color: var(--ink);
  font-size: var(--text-s); font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform var(--fast) var(--ease-out), background-color var(--fast) ease, border-color var(--fast) ease; }
.vd-btn:active:not(:disabled) { transform: scale(0.97); }
.vd-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.vd-btn.primary { background: var(--mark); border-color: var(--mark); color: var(--on-accent); }
.vd-btn.danger { color: var(--bad); border-color: var(--bad-line); }
.vd-btn.danger-solid { background: var(--bad-strong); border-color: var(--bad-strong); color: var(--on-accent); }
.vd-btn.small { min-height: 30px; padding: 0 10px; }
.vd-btn.wide { width: 100%; }
@media (hover: hover) and (pointer: fine) {
  .vd-btn:hover:not(:disabled) { background: var(--hover); }
  .vd-btn.primary:hover:not(:disabled) { background: var(--mark-hover); border-color: var(--mark-hover); }
  .vd-btn.danger:hover:not(:disabled) { background: var(--bad-tint); }
  .vd-btn.danger-solid:hover:not(:disabled) { background: var(--bad); }
}
.vd-link { border: 0; background: none; padding: 0; color: var(--mark-ink); font-weight: 600; font-size: inherit;
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

/* Páginas */
.vd-page { max-width: 1120px; margin: 0 auto; padding: 24px 16px 64px; }
.vd-page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px 24px;
  margin-bottom: 20px; }
.vd-lede { margin-top: 4px; max-width: 70ch; color: var(--ink-soft); }
.vd-muted { color: var(--ink-faint); font-size: var(--text-s); }
.vd-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.vd-empty { padding: 32px 16px; text-align: center; color: var(--ink-soft); border: 1px dashed var(--line-strong);
  border-radius: var(--radius-m); }
.vd-empty-start { text-align: left; display: grid; gap: 8px; }
.vd-code { margin: 0; padding: 10px 12px; background: var(--panel); border-radius: var(--radius-s); overflow-x: auto; }
.vd-panel { padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); }
.vd-panel > h2 { margin-bottom: 6px; }
.vd-section-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; font-size: var(--text-l); }
.vd-section-title.small { font-size: var(--text-m); }
.vd-count { font-family: var(--font-code); font-size: var(--text-m); color: var(--mark-ink); }
.vd-identity { font-size: var(--text-s); color: var(--ink-soft); overflow-wrap: anywhere; }
.vd-back { margin-bottom: 8px; font-size: var(--text-s); }
.vd-back a::before { content: "← "; }
.vd-body { max-width: 70ch; white-space: normal; }

/* Mensajes */
.vd-messages { max-width: 1120px; margin: 12px auto 0; padding: 0 16px; display: grid; gap: 6px; }
.vd-message { padding: 8px 12px; border-radius: var(--radius-s); font-size: var(--text-s); background: var(--panel); }
.vd-message.success { background: var(--ok-tint); color: var(--ok); }
.vd-message.error { background: var(--bad-tint); color: var(--bad); }

/* Formularios */
.vd-form { display: grid; gap: 10px; }
.vd-form-row { display: flex; flex-wrap: wrap; gap: 10px; }
.vd-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; max-width: 100%; }
.vd-field.grow { flex: 1 1 220px; }
.vd-field > span { font-size: var(--text-xs); font-weight: 600; color: var(--ink-soft); }
.vd-field input, .vd-field select, .vd-field textarea { min-height: 36px; width: 100%; padding: 6px 10px; background: var(--bg);
  border: 1px solid var(--line-strong); border-radius: var(--radius-s); }
.vd-field textarea { resize: vertical; }
.vd-field input::placeholder, .vd-field textarea::placeholder, .vd-note::placeholder { color: var(--ink-faint); }
.vd-help { font-size: var(--text-s); color: var(--ink-soft); }
.vd-error { padding: 6px 10px; border-radius: var(--radius-s); background: var(--bad-tint); color: var(--bad); font-size: var(--text-s); }
.vd-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 16px; }

/* Entrada de un panel que se despliega */
.vd-reveal { margin-bottom: 20px; transition: opacity var(--medium) var(--ease-out), transform var(--medium) var(--ease-out); }
@starting-style { .vd-reveal { opacity: 0; transform: translateY(-4px); } }

/* Pastillas de estado: comparación (s-) y peticiones (r-) */
.vd-pill { display: inline-flex; align-items: center; padding: 1px 8px; border: 1px solid transparent;
  border-radius: var(--radius-pill); font-size: var(--text-xs); font-weight: 600; line-height: 1.5; white-space: nowrap; text-decoration: none; }
.s-pending, .r-new { background: var(--mark-tint); color: var(--mark-ink); border-color: var(--mark-line); }
.s-accepted, .r-done { background: var(--ok-tint); color: var(--ok); border-color: var(--ok-line); }
.s-rejected { background: var(--bad-tint); color: var(--bad); border-color: var(--bad-line); }
.s-outdated, .r-in_review { background: var(--info-tint); color: var(--info); border-color: var(--info-line); }
.s-unchanged, .s-untouched, .s-note, .s-current, .s-superseded, .s-new, .r-in_progress, .r-declined, .r-cancelled {
  background: var(--panel); color: var(--ink-soft); border-color: var(--line-strong); }
.o-conjunto, .o-codex, .o-refutado, .o-claude, .o-producto, .x-result { background: var(--bg); color: var(--ink-soft); border-color: var(--line); }
.vd-news { font-size: var(--text-xs); font-weight: 700; color: var(--mark-ink); }
.vd-key { font-family: var(--font-code); font-weight: 600; font-size: var(--text-s); color: var(--mark-ink); white-space: nowrap; }
.vd-key-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; }
.vd-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.vd-tag { padding: 1px 7px; border: 1px solid var(--line); border-radius: var(--radius-s); font-family: var(--font-code);
  font-size: var(--text-xs); color: var(--ink-soft); }

/* Filas de listas */
.vd-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.vd-rows > li { border-bottom: 1px solid var(--line); }
.vd-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 16px; padding: 10px 8px;
  color: var(--ink); text-decoration: none; transition: background-color var(--fast) ease; }
.vd-row-title { min-width: 0; overflow-wrap: anywhere; }
.vd-row-sub { display: block; }
.vd-row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
@media (hover: hover) and (pointer: fine) { .vd-row:hover { background: var(--panel); } }

/* Inicio general */
.vd-projects { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.vd-project { display: grid; gap: 10px 24px; padding: 14px 8px; border-bottom: 1px solid var(--line); align-items: center; }
@media (min-width: 860px) { .vd-project { grid-template-columns: minmax(0, 1fr) auto auto; } }
.vd-project-main h2 { font-size: var(--text-l); }
.vd-project-main h2 a { color: var(--ink); text-decoration: none; }
.vd-project-main h2 a:hover { color: var(--mark-ink); text-decoration: underline; text-underline-offset: 2px; }
.vd-project-main p { margin-top: 2px; color: var(--ink-soft); font-size: var(--text-s); }
.vd-project-figures { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; }
.vd-project-figures dt { font-size: var(--text-xs); color: var(--ink-faint); }
.vd-project-figures dd { margin: 0; font-family: var(--font-code); font-size: var(--text-l); font-weight: 500; }
.vd-project-side { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* Inicio de proyecto y detalle de petición */
.vd-dash { display: grid; gap: 28px; }
.vd-dash > * { min-width: 0; }
@media (min-width: 900px) { .vd-dash { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } }
.vd-dash-main, .vd-dash-side { display: grid; gap: 24px; align-content: start; min-width: 0; }
.vd-dash-side { gap: 14px; }
.vd-dash-side .vd-btn.wide { margin-top: 10px; }
.vd-activity { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: var(--text-s); }
.vd-activity a { font-weight: 500; }
.vd-activity span { display: block; overflow-wrap: anywhere; }
.vd-thumb { display: block; margin: 8px 0; max-height: 220px; overflow: hidden; background: var(--viewer); border-radius: var(--radius-s); }
.vd-thumb img { display: block; width: 100%; height: auto; }

/* Seguimiento de una petición */
.vd-timeline { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.vd-timeline-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: var(--text-s); }
.vd-timeline-note { margin-top: 2px; max-width: 70ch; }
.vd-comment { margin-top: 8px; }

/* Historial general y de cada vista */
.vd-history-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.vd-history-list > li { padding: 12px 8px; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.vd-history-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: var(--text-s); }
.vd-history-note { font-size: var(--text-m); max-width: 70ch; }
.vd-identifiers { list-style: none; margin: 2px 0 0; padding: 0; font-size: var(--text-xs); color: var(--ink-faint); overflow-wrap: anywhere; }
.vd-history { margin-top: 12px; }
.vd-history summary { cursor: pointer; font-size: var(--text-s); font-weight: 600; color: var(--ink-soft); }
.vd-history-items { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.vd-history-items > li { display: grid; gap: 2px; }
.vd-history-items > li.is-old { color: var(--ink-faint); }

/* Herramienta: contexto, índice y barra */
.vd-context { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px 24px;
  padding: 14px 16px; border-bottom: 1px solid var(--line); }
.vd-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: var(--text-l); }
.vd-flow code { font-size: 1em; font-weight: 600; overflow-wrap: anywhere; }
.vd-flow code.is-source { color: var(--mark-ink); }
.vd-arrow { color: var(--ink-faint); }
.vd-context-controls { display: flex; flex-wrap: wrap; gap: 10px; min-width: 0; max-width: 100%; }
.vd-context-controls select { max-width: min(100%, 360px); }

.vd-layout { display: grid; gap: 16px; padding: 16px 16px 64px; }
.vd-layout > * { min-width: 0; }
@media (min-width: 1200px) {
  .vd-layout { grid-template-columns: 250px minmax(0, 1fr); align-items: start; }
  .vd-toc { position: sticky; top: 10px; max-height: calc(100dvh - 20px); overflow: auto; }
}
.vd-toc { border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--bg); }
.vd-toc > summary { padding: 10px 12px; font-size: var(--text-s); font-weight: 600; cursor: pointer; }
.vd-toc-body { padding: 0 6px 10px; }
.vd-toc-group { margin-top: 6px; }
.vd-toc-group > a { display: block; padding: 4px 6px; color: var(--ink); font-size: var(--text-s); font-weight: 600; text-decoration: none; }
.vd-toc ol { list-style: none; margin: 0; padding: 0; }
.vd-toc li a { display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; gap: 4px; align-items: center; padding: 3px 6px;
  border-radius: var(--radius-s); color: var(--ink-soft); font-size: var(--text-xs); text-decoration: none; }
.vd-toc li a .k { font-family: var(--font-code); color: var(--ink-faint); }
.vd-toc li a .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vd-toc li.is-filtered-out { display: none; }
@media (hover: hover) and (pointer: fine) { .vd-toc li a:hover, .vd-toc-group > a:hover { background: var(--hover); } }
.vd-dot { min-width: 16px; font-size: var(--text-xs); font-weight: 700; text-align: center; color: var(--ink-faint); }
.vd-dot.pending { color: var(--mark-ink); }
.vd-dot.accepted { color: var(--ok); }
.vd-dot.rejected { color: var(--bad); }
.vd-dot.outdated { color: var(--info); }

.vd-toolbar { display: grid; gap: 10px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-m); }
@media (min-width: 900px) { .vd-toolbar { position: sticky; top: 8px; z-index: var(--z-sticky); } }
.vd-toolbar-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.vd-states { display: flex; flex-wrap: wrap; gap: 4px; }
.vd-state { display: inline-flex; align-items: baseline; gap: 6px; min-height: 30px; padding: 3px 10px; border: 1px solid transparent; border-radius: var(--radius-s);
  background: none; color: var(--ink-soft); font-size: var(--text-s); font-weight: 500; cursor: pointer; transition: background-color var(--fast) ease; }
.vd-state b { font-family: var(--font-code); font-weight: 600; color: var(--ink); }
.vd-state[aria-pressed="true"] { background: var(--mark-tint); border-color: var(--mark-line); color: var(--mark-ink); font-weight: 600; }
.vd-state[aria-pressed="true"] b { color: var(--mark-ink); }
@media (hover: hover) and (pointer: fine) { .vd-state:not([aria-pressed="true"]):hover { background: var(--hover); } }
.vd-seg { display: inline-flex; min-height: 36px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); overflow: hidden; }
.vd-seg button, .vd-seg a { display: inline-flex; align-items: center; padding: 0 12px; border: 0; background: var(--bg); color: var(--ink-soft);
  font-size: var(--text-s); text-decoration: none; cursor: pointer; }
.vd-seg > * + * { border-left: 1px solid var(--line-strong); }
.vd-seg button[aria-pressed="true"], .vd-seg a[aria-current] { background: var(--ink); color: var(--on-accent); font-weight: 600; }
.vd-seg-links { margin-bottom: 14px; }
.vd-check { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-size: var(--text-s); cursor: pointer; }
.vd-check input { width: 16px; height: 16px; accent-color: var(--mark); }
.vd-count-line { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: var(--text-xs); color: var(--ink-faint); }

/* Herramienta: grupos, vistas y comparación */
.vd-group { scroll-margin-top: calc(var(--vd-sticky, 0px) + 14px); }
.vd-group-head { margin: 22px 0 10px; }
.vd-group-head h2 { font-size: var(--text-l); }
.vd-view { scroll-margin-top: calc(var(--vd-sticky, 0px) + 14px); padding: 14px 0 22px; border-top: 1px solid var(--line); }
.vd-view-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; align-items: flex-start; }
.vd-view-head h3 { margin: 0; font-size: var(--text-m); font-weight: 600; line-height: 1.35; }
.vd-view-head h3 .k { margin-right: 8px; font-family: var(--font-code); font-size: var(--text-s); color: var(--mark-ink); }
.vd-view-path { font-size: var(--text-xs); color: var(--ink-faint); overflow-wrap: anywhere; }
.vd-view-side { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.vd-strip { margin-top: 10px; padding: 7px 10px; border-radius: var(--radius-s); background: var(--panel); font-size: var(--text-s); color: var(--ink-soft); }
.vd-strip.is-warning { background: var(--info-tint); color: var(--info); }
.vd-compare { display: grid; gap: 12px; margin-top: 12px; }
.vd-compare > * { min-width: 0; }
@media (min-width: 760px) {
  .vd-compare { grid-template-columns: 1fr 1fr; }
  .vd-compare.is-narrow { justify-content: center; grid-template-columns: repeat(2, minmax(0, 420px)); }
  .vd-compare.is-single { grid-template-columns: minmax(0, 1fr); }
  .vd-compare.is-single.is-narrow { grid-template-columns: minmax(0, 420px); }
}
.vd-fig { margin: 0; min-width: 0; }
.vd-fig figcaption { display: grid; gap: 1px; margin-bottom: 6px; font-size: var(--text-xs); color: var(--ink-faint); }
.vd-fig-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.vd-fig-title code { font-size: var(--text-s); font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.vd-fig.source .vd-fig-title code { color: var(--mark-ink); }
.vd-fig-title a { flex: none; font-size: var(--text-xs); }
.vd-pane { max-height: 72vh; overflow: auto; background: var(--viewer); border-radius: var(--radius-s); overscroll-behavior: contain; }
.vd-pane img { display: block; height: auto; margin: 0 auto; width: 100%; max-width: var(--vd-w, none); }
.vd-real .vd-pane img { width: var(--vd-w); max-width: none; }
.vd-missing { display: grid; place-items: center; min-height: 160px; padding: 20px; text-align: center; color: var(--ink-soft); font-size: var(--text-s); }

/* Qué cambió y por qué */
.vd-changes { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.vd-change { display: grid; gap: 4px 16px; font-size: var(--text-s); }
@media (min-width: 1100px) { .vd-change { grid-template-columns: 200px minmax(0, 1fr); align-items: start; } }
.vd-change-meta { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; align-content: start; }
button.vd-key { border: 0; background: none; padding: 0; cursor: copy; }
.vd-change-body p + p { margin-top: 2px; }
.vd-k { display: inline-block; min-width: 62px; font-size: var(--text-xs); font-weight: 600; color: var(--ink-faint); }

/* Veredicto y petición dentro de una vista */
.vd-view-requests { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 12px; font-size: var(--text-s); }
.vd-view-requests a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink); }
.vd-verdict, .vd-request-form { display: grid; gap: 8px; margin-top: 14px; }
.vd-note { width: 100%; min-height: 36px; padding: 7px 10px; background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius-s);
  font-size: var(--text-s); resize: vertical; }
.vd-actions [data-action="accepted"] { background: var(--ok); border-color: var(--ok); color: var(--on-accent); }
.vd-actions [data-action="rejected"] { color: var(--bad); border-color: var(--bad-line); }
@media (hover: hover) and (pointer: fine) {
  .vd-actions [data-action="accepted"]:hover:not(:disabled) { background: var(--ok); opacity: 0.92; }
  .vd-actions [data-action="rejected"]:hover:not(:disabled) { background: var(--bad-tint); }
}
.vd-request-form { padding: 12px; background: var(--panel); border-radius: var(--radius-m);
  transition: opacity var(--medium) var(--ease-out), transform var(--medium) var(--ease-out); }
@starting-style { .vd-request-form { opacity: 0; transform: translateY(-4px); } }

/* Usuarios y miembros */
.vd-global-link { color: var(--ink-soft); font-weight: 500; text-decoration: none; padding: 4px 8px; border-radius: var(--radius-s); }
.vd-global-link[aria-current="page"] { background: var(--mark-tint); color: var(--mark-ink); font-weight: 600; }
.vd-people { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.vd-person { display: grid; gap: 10px 24px; padding: 12px 8px; border-bottom: 1px solid var(--line); }
@media (min-width: 860px) { .vd-person { grid-template-columns: minmax(0, 1fr) minmax(0, auto); align-items: start; } }
.vd-person-main { min-width: 0; }
.vd-person-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.vd-person-name code { font-size: var(--text-s); color: var(--ink-soft); overflow-wrap: anywhere; }
.vd-person .vd-tags { margin-top: 6px; }
.vd-person .vd-tag { text-decoration: none; }
.vd-person-side { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; justify-content: flex-start; min-width: 0; }
@media (min-width: 860px) { .vd-person-side { justify-content: flex-end; max-width: 520px; } }
.vd-role-form { display: contents; }
/* El botón queda en fila con los demás; el enlace generado, debajo a todo el ancho. */
.vd-magic-slot { display: contents; }
[data-magic-result] { flex: 1 1 100%; order: 10; min-width: 0; }
[data-magic-result]:empty { display: none; }
.vd-magic { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px; background: var(--mark-tint); border: 1px solid var(--mark-line);
  border-radius: var(--radius-s); transition: opacity var(--medium) var(--ease-out), transform var(--medium) var(--ease-out); }
@starting-style { .vd-magic { opacity: 0; transform: translateY(-4px); } }
.vd-magic input { flex: 1 1 200px; min-width: 0; min-height: 30px; padding: 2px 8px; background: var(--bg); border: 1px solid var(--line-strong);
  border-radius: var(--radius-s); font-family: var(--font-code); font-size: var(--text-xs); }
.vd-magic-note { width: 100%; font-size: var(--text-xs); color: var(--ink-soft); }
.vd-magic-note.is-error { color: var(--bad); }
.vd-login-card p { font-size: var(--text-s); }

/* Diálogo de confirmación */
.vd-dialog { width: min(440px, calc(100vw - 32px)); padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-m);
  box-shadow: var(--shadow-dialog); transition: opacity var(--medium) var(--ease-out), transform var(--medium) var(--ease-out); }
.vd-dialog::backdrop { background: oklch(0.2 0 0 / 0.4); }
@starting-style { .vd-dialog[open] { opacity: 0; transform: scale(0.98); } }
.vd-dialog form { display: grid; gap: 12px; }
.vd-dialog h2 { font-size: var(--text-l); overflow-wrap: anywhere; }

/* Inicio de sesión */
.vd-login { min-height: 100dvh; display: grid; place-items: center; padding: 16px; background: var(--panel); }
.vd-login-card { width: min(360px, 100%); padding: 24px; display: grid; gap: 14px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-m); }

/* Aviso breve */
.vd-toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: var(--z-toast); max-width: calc(100vw - 32px);
  padding: 8px 14px; border-radius: var(--radius-s); background: var(--ink); color: var(--on-accent); font-size: var(--text-s);
  transition: opacity var(--medium) var(--ease-out), transform var(--medium) var(--ease-out); }
@starting-style { .vd-toast { opacity: 0; transform: translate(-50%, 6px); } }
.vd-toast.is-error { background: var(--bad-strong); }
.vd-flash { animation: vd-flash 1.2s var(--ease-out); }
@keyframes vd-flash { 0% { background: var(--mark-tint); } 100% { background: transparent; } }

@media (prefers-reduced-motion: reduce) {
  .vd-btn, .vd-reveal, .vd-request-form, .vd-dialog, .vd-toast, .vd-magic { transition: none; }
  .vd-btn:active:not(:disabled) { transform: none; }
  .vd-flash { animation: none; }
}
