* { box-sizing: border-box; }
html { min-height: 100%; font-size: var(--font-size); background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 0%, color-mix(in srgb, var(--brand-soft) 80%, transparent), transparent 35%),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, textarea { font: inherit; }
button { color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.app-loading { display: grid; min-height: 100vh; place-items: center; color: var(--text-muted); }
.icon-button, .button {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.icon-button:hover, .button:hover { transform: translateY(-1px); border-color: var(--border-strong); }
.icon-button { width: 42px; display: grid; place-items: center; }
.button { padding: .62rem 1rem; }
.button-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 700; }
.button-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* v7.0.0-rc.2 · navegación y contraste */
.skip-link {
  position: fixed;
  left: 1rem;
  top: .75rem;
  z-index: 1000;
  transform: translateY(-180%);
  padding: .65rem .9rem;
  border: 2px solid currentColor;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }
[hidden] { display: none !important; }
html[data-contrast="high"] {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #ffffff;
  --surface-raised: #ffffff;
  --text: #000000;
  --text-muted: #242424;
  --border: #000000;
  --border-strong: #000000;
  --brand: #005a43;
  --brand-strong: #003c2d;
  --brand-soft: #d8fff2;
  --on-brand: #ffffff;
  --accent: #003f87;
  --danger: #8b0000;
  --warning: #6b4700;
  --success: #005a2b;
  --shadow: none;
}
html[data-theme="dark"][data-contrast="high"] {
  --bg: #000000;
  --surface: #000000;
  --surface-soft: #090909;
  --surface-raised: #101010;
  --text: #ffffff;
  --text-muted: #f0f0f0;
  --border: #ffffff;
  --border-strong: #ffffff;
  --brand: #7fffd4;
  --brand-strong: #b9ffe8;
  --brand-soft: #003b2d;
  --on-brand: #000000;
  --accent: #8cc8ff;
  --danger: #ff9f97;
  --warning: #ffd166;
  --success: #91ffc3;
  --shadow: none;
}
html[data-contrast="high"] .panel,
html[data-contrast="high"] .source-card,
html[data-contrast="high"] .status-card,
html[data-contrast="high"] .composer-box,
html[data-theme-preset="alto-contraste"] .panel,
html[data-theme-preset="alto-contraste"] .source-card,
html[data-theme-preset="alto-contraste"] .status-card,
html[data-theme-preset="alto-contraste"] .composer-box { border-width: 2px; }
html[data-contrast="high"] .message-row[data-role="user"] .message,
html:not([data-theme="dark"])[data-theme-preset="alto-contraste"] .message-row[data-role="user"] .message { color: #ffffff; background: #004c39; border-color: #000000; }
html[data-theme="dark"][data-contrast="high"] .message-row[data-role="user"] .message,
html[data-theme="dark"][data-theme-preset="alto-contraste"] .message-row[data-role="user"] .message { color: #000000; background: #7fffd4; border-color: #ffffff; }
html[data-theme="dark"][data-contrast="high"] .message-row[data-role="user"] .message-action,
html[data-theme="dark"][data-contrast="high"] .message-row[data-role="user"] .message-feedback { color: #000000; border-color: #000000; text-shadow: none; }

@media (prefers-contrast: more) {
  :root { --border: var(--border-strong); }
  .button, .icon-button, .message-action, .suggestion-button { border-width: 2px; }
}

@media (forced-colors: active) {
  * { forced-color-adjust: auto; }
  .status-dot, .message-progress-bar { forced-color-adjust: none; background: Highlight; }
  .message-row[data-role="user"] .message { border: 2px solid CanvasText; }
}


/* v7.1.0-hotfix.34 · ciclo directo de temas y pantalla completa */
.theme-cycle-icon { width:16px; height:16px; display:block; fill:none; stroke:currentColor; stroke-width:1.65; stroke-linecap:round; stroke-linejoin:round; }
.app-shell:fullscreen { width:100%; height:100%; min-height:100%; overflow:auto; background:var(--bg); }
