/* @hallmark v2.0.0 | theme: custom | genre: atmospheric | shape: app | signature: monolithic cryo console with sliding channel pill and 450ms ice confirmation pulse */
/* critique: surgical 1px cryo-hacker console on #05070A abyss with #7CE8FF electric ice accent, 4px grid discipline, physical spring pill and zero decorative clutter */
/* waive: 64 (monospace tactical voice explicitly requested by owner for cryo-hacker controls and channel slugs) */

:root {
  --bg-abyss: #05070A;
  --bg-panel: #090E14;
  --bg-elevated: #0D151F;
  --bg-user: #0B1622;
  --bg-overlay: rgba(5, 7, 10, 0.84);

  --line: #152230;
  --line-subtle: #101B27;
  --line-ice: rgba(124, 232, 255, 0.36);

  --ice: #7CE8FF;
  --ice-soft: rgba(124, 232, 255, 0.10);
  --ice-glow: rgba(124, 232, 255, 0.24);
  --ink-on-ice: #031018;

  --alert: #FF4766;
  --alert-soft: rgba(255, 71, 102, 0.10);
  --alert-line: rgba(255, 71, 102, 0.44);

  --text-primary: #EAF3FA;
  --text-secondary: #93ACC0;
  --text-muted: #5A7388;

  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --radius: 2px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow-x: clip;
  background-color: var(--bg-abyss);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

:focus-visible {
  outline: 1px solid var(--ice);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

/* ── App Shell (100dvh centrado y acotado en pantallas anchas) ── */

.fria-root {
  min-height: 100dvh;
  height: 100dvh;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-abyss);
  color: var(--text-primary);
  border-left: 1px solid var(--line-subtle);
  border-right: 1px solid var(--line-subtle);
  position: relative;
}

/* ── Vistas de Acceso / Búnker ── */

.auth-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px calc(28px + env(safe-area-inset-bottom));
}

.auth-panel {
  width: 100%;
  max-width: 392px;
  background-color: var(--bg-panel);
  color: var(--text-primary);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}

.auth-panel::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 44px;
  height: 2px;
  background-color: var(--ice);
}

.auth-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

.brand-mark {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.04em;
}

.auth-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.auth-desc {
  margin: 0 0 20px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.field-label {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.fria-input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  background-color: var(--bg-abyss);
  color: var(--text-primary);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 16px;
}

.fria-input:focus {
  outline: 1px solid var(--ice);
  outline-offset: -1px;
}

.fria-input::placeholder {
  color: var(--text-muted);
}

.btn-primary,
.btn-ghost,
.btn-danger {
  width: 100%;
  min-height: 44px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 180ms var(--ease-spring), opacity 150ms var(--ease-out), background-color 150ms var(--ease-out), border-color 150ms var(--ease-out);
}

.btn-primary {
  background-color: var(--ice);
  color: var(--ink-on-ice);
  border: 1px solid var(--ice);
}

.btn-ghost {
  background-color: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--line);
}

.btn-danger {
  background-color: var(--alert-soft);
  color: var(--alert);
  border: 1px solid var(--alert-line);
}

.auth-divider {
  margin: 16px 0;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.auth-msg {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--alert);
  line-height: 1.4;
}

/* ── Física táctil compartida (pointerdown -> scale 0.96, rebote seco) ── */

.tactile {
  transition: transform 180ms var(--ease-spring), opacity 150ms var(--ease-out), background-color 150ms var(--ease-out), border-color 150ms var(--ease-out), color 150ms var(--ease-out);
}

.tactile[data-pressed="1"],
.tactile:active {
  transform: scale(0.96);
  transition-duration: 85ms;
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover {
    opacity: 0.92;
  }
  .btn-ghost:hover,
  .micro-btn:hover,
  .opt-btn:hover {
    border-color: var(--line-ice);
    color: var(--ice);
  }
  .canal-chip:hover {
    color: var(--text-primary);
  }
}

/* ── Cabecera monolítica de 1 sola línea ── */

.top-bar {
  flex-shrink: 0;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  background-color: var(--bg-panel);
  color: var(--text-primary);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 20;
}

.top-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.top-wordmark {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.link-status {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 180ms var(--ease-out), opacity 180ms var(--ease-out);
}

.link-status[data-online="1"] {
  color: var(--ice);
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.micro-btn {
  height: 28px;
  padding: 0 8px;
  background-color: var(--bg-abyss);
  color: var(--text-secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.69rem;
  white-space: nowrap;
}

.micro-btn[data-active="1"] {
  border-color: var(--line-ice);
  color: var(--ice);
  background-color: var(--ice-soft);
}

.micro-btn[data-alert="1"] {
  border-color: var(--alert-line);
  color: var(--alert);
  background-color: var(--alert-soft);
}

/* ── Barra horizontal de canales cortos con píldora deslizante física ── */

.canales-bar {
  flex-shrink: 0;
  background-color: var(--bg-abyss);
  color: var(--text-primary);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 8px;
  height: 40px;
  gap: 8px;
  position: relative;
  z-index: 15;
}

.canales-track {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  height: 100%;
  flex: 1;
  min-width: 0;
}

.canales-track::-webkit-scrollbar {
  display: none;
}

.canal-pill {
  position: absolute;
  left: 0;
  top: 6px;
  width: 100px;
  height: 28px;
  background-color: var(--ice-soft);
  border-radius: var(--radius);
  transform-origin: 0 50%;
  transform: translate3d(0, 0, 0) scaleX(0);
  pointer-events: none;
  will-change: transform;
}

.canal-pill-edge {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100px;
  height: 2px;
  background-color: var(--ice);
  transform-origin: 0 50%;
  transform: translate3d(0, 0, 0) scaleX(0);
  pointer-events: none;
  will-change: transform;
}

.js .canal-pill,
.js .canal-pill-edge {
  opacity: 0;
}

.js .canal-pill[data-ready="1"],
.js .canal-pill-edge[data-ready="1"] {
  opacity: 1;
  transition: transform 220ms var(--ease-spring), opacity 150ms var(--ease-out);
}

.canal-chip {
  position: relative;
  z-index: 1;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}

.canal-chip[data-selected="1"] {
  color: var(--ice);
}

.canal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--ice);
  transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out);
}

.js .canal-dot {
  opacity: 0;
  transform: scale(0.7);
}

.js .canal-chip[data-unread="1"] .canal-dot {
  opacity: 1;
  transform: scale(1);
}

.js .canal-chip[data-busy="1"] .canal-dot {
  opacity: 1;
  transform: scale(1);
  animation: cryoPulse 1.15s var(--ease-out) infinite alternate;
}

.canal-chip.chip-flash::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  border: 1px solid var(--ice);
  pointer-events: none;
  animation: iceSettle 460ms var(--ease-out) forwards;
}

.canal-add-btn {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--bg-panel);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.canal-nuevo-form {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.canal-nuevo-input {
  width: 112px;
  height: 28px;
  padding: 0 8px;
  background-color: var(--bg-panel);
  color: var(--text-primary);
  border: 1px solid var(--line-ice);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 16px;
}

.canal-nuevo-input:focus {
  outline: 1px solid var(--ice);
  outline-offset: -1px;
}

/* ── Banners tácticos (Seguridad, Passkey 1-toque, Aviso Push iOS) ── */

.banner-stack {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.security-banner {
  background-color: var(--alert-soft);
  color: var(--text-primary);
  border-bottom: 1px solid var(--alert-line);
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.security-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-primary);
  line-height: 1.4;
  min-width: 0;
  flex: 1 1 220px;
}

.security-label {
  color: var(--alert);
  font-weight: 600;
}

.security-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.security-btn {
  height: 28px;
  padding: 0 8px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  background-color: var(--alert);
  color: var(--bg-abyss);
}

.security-dismiss {
  height: 28px;
  padding: 0 8px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.71rem;
  border: 1px solid var(--alert-line);
  color: var(--text-primary);
}

.passkey-prompt,
.notice-strip {
  background-color: var(--bg-panel);
  color: var(--text-primary);
  border-bottom: 1px solid var(--line-ice);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.passkey-prompt-text,
.notice-strip-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.passkey-cta {
  height: 28px;
  padding: 0 12px;
  background-color: var(--ice);
  color: var(--ink-on-ice);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Panel desplegable [ ACCESOS ] ── */

.accesos-drawer {
  position: absolute;
  top: calc(44px + env(safe-area-inset-top));
  right: 8px;
  left: 8px;
  max-width: 520px;
  margin-left: auto;
  max-height: calc(100dvh - 120px);
  overflow-y: auto;
  background-color: var(--bg-panel);
  color: var(--text-primary);
  border: 1px solid var(--line-ice);
  border-radius: var(--radius);
  padding: 16px;
  z-index: 35;
  transform-origin: top right;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 180ms var(--ease-drawer), transform 180ms var(--ease-drawer);
}

.js .accesos-drawer[data-closing="1"] {
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
}

@starting-style {
  .accesos-drawer {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
}

.drawer-section {
  margin-bottom: 16px;
}

.drawer-section:last-child {
  margin-bottom: 0;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.drawer-title {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ice);
}

.access-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-subtle);
}

.access-row:last-child {
  border-bottom: 0;
}

.access-meta {
  min-width: 0;
  flex: 1;
}

.access-name {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-primary);
}

.access-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-secondary);
  overflow-wrap: break-word;
}

/* ── Flujo principal de mensajes ── */

.stream-wrap {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 12px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stream-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.quiet-btn {
  height: 24px;
  padding: 0 8px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--bg-panel);
}

.empty-state {
  margin: auto 0;
  padding: 28px 16px;
  text-align: left;
  border-left: 2px solid var(--line);
}

.empty-code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ice);
  margin: 0 0 8px;
}

.empty-hint {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.msg-row {
  display: flex;
  flex-direction: column;
  max-width: 92%;
}

.msg-row.is-user {
  align-self: flex-end;
  align-items: flex-end;
}

.msg-row.is-assistant {
  align-self: flex-start;
  align-items: flex-start;
  width: 100%;
  max-width: 96%;
}

.msg-card {
  position: relative;
  padding: 12px;
  border-radius: var(--radius);
  overflow-wrap: break-word;
  min-width: 0;
}

.msg-user {
  background-color: var(--bg-user);
  border: 1px solid var(--line-ice);
  color: var(--text-primary);
}

.msg-assistant {
  background-color: var(--bg-panel);
  border: 1px solid var(--line);
  color: var(--text-primary);
  width: 100%;
}

/* Entrada quirúrgica y pulso de confirmación hielo de 450ms */
.msg-fresh {
  animation: msgArrive 220ms var(--ease-spring) both;
}

.msg-assistant.msg-fresh::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: var(--radius);
  border: 1px solid var(--ice);
  box-shadow: 0 0 18px var(--ice-glow);
  pointer-events: none;
  animation: iceSettle 450ms var(--ease-out) forwards;
}

.msg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: 0.69rem;
  color: var(--text-secondary);
}

.msg-author {
  color: var(--ice);
  font-weight: 600;
}

.msg-confirm-badge {
  color: var(--ice);
  font-family: var(--font-mono);
  font-size: 0.69rem;
}

.msg-body {
  font-size: 0.97rem;
  line-height: 1.56;
  color: var(--text-primary);
}

.msg-body p {
  margin: 0 0 8px;
}

.msg-body p:last-child {
  margin-bottom: 0;
}

.msg-body ul,
.msg-body ol {
  margin: 8px 0;
  padding-left: 20px;
}

.msg-body li {
  margin-bottom: 4px;
}

.msg-body code {
  font-family: var(--font-mono);
  font-size: 0.84em;
  background-color: var(--bg-abyss);
  border: 1px solid var(--line);
  padding: 0 4px;
  border-radius: var(--radius);
  color: var(--ice);
}

.code-block {
  margin: 8px 0;
  background-color: var(--bg-abyss);
  color: var(--text-primary);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  border-bottom: 1px solid var(--line-subtle);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.copy-code-btn {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ice);
  padding: 4px;
}

.code-block pre {
  margin: 0;
  padding: 12px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.45;
}

.code-block pre code {
  background: none;
  border: 0;
  padding: 0;
  color: var(--text-primary);
}

.msg-body a {
  color: var(--ice);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.msg-thumb {
  display: block;
  max-width: min(260px, 100%);
  max-height: 240px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: zoom-in;
}

/* ── Botones táctiles [01] [02] para preguntas ── */

.options-grid {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.opt-btn {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  background-color: var(--bg-abyss);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  color: var(--text-primary);
}

.opt-idx {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ice);
  flex-shrink: 0;
}

.opt-label {
  font-size: 0.9rem;
  line-height: 1.38;
}

.opt-btn[data-picked="1"] {
  border-color: var(--ice);
  background-color: var(--ice-soft);
}

.opt-btn[data-dimmed="1"] {
  opacity: 0.45;
}

/* ── Línea viva mutante de estado + Barra de entrada inferior ── */

.live-status-wrap {
  flex-shrink: 0;
  padding: 0 12px;
  pointer-events: none;
}

.live-status {
  padding: 8px 12px;
  background-color: var(--bg-panel);
  color: var(--ice);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out);
}

.js .live-status[data-hidden="1"] {
  opacity: 0;
  transform: translateY(4px);
}

.live-prompt-glyph {
  margin-right: 8px;
  display: inline-block;
  animation: cryoPulse 0.9s var(--ease-out) infinite alternate;
}

.composer {
  flex-shrink: 0;
  position: relative;
  background-color: var(--bg-panel);
  color: var(--text-primary);
  border-top: 1px solid var(--line);
  padding: 8px 12px calc(12px + env(safe-area-inset-bottom));
}

/* Barra hairline de escaneo 1px en hielo eléctrico mientras ejecuta */
.scan-rail {
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 180ms var(--ease-out);
}

.js .scan-rail {
  opacity: 0;
}

.js .scan-rail[data-active="1"] {
  opacity: 1;
}

.scan-beam {
  width: 38%;
  height: 100%;
  background-color: var(--ice);
  will-change: transform;
  animation: cryoScan 1.35s linear infinite;
}

.attach-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  margin-bottom: 8px;
  background-color: var(--bg-abyss);
  color: var(--text-primary);
  border: 1px solid var(--line-ice);
  border-radius: var(--radius);
}

.attach-preview-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.attach-preview img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.attach-info {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.composer-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.attach-btn {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background-color: var(--bg-abyss);
  color: var(--text-secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.input-box {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  background-color: var(--bg-abyss);
  color: var(--text-primary);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
}

.input-box:focus-within {
  outline: 1px solid var(--ice);
  outline-offset: -1px;
}

.prompt-sign {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--ice);
  padding-top: 8px;
  margin-right: 8px;
  flex-shrink: 0;
}

.composer-textarea {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  max-height: 132px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.38;
  resize: none;
}

.composer-textarea:focus {
  outline: none;
}

.composer-textarea::placeholder {
  color: var(--text-muted);
}

.send-btn {
  height: 40px;
  padding: 0 12px;
  flex-shrink: 0;
  background-color: var(--ice);
  color: var(--ink-on-ice);
  border: 1px solid var(--ice);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
}

.send-btn:disabled {
  background-color: var(--bg-elevated);
  color: var(--text-muted);
  border-color: var(--line);
  cursor: not-allowed;
}

/* ── Visor de imagen a pantalla completa ── */

.lightbox {
  position: fixed;
  inset: 0;
  background-color: var(--bg-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 60;
}

.lightbox img {
  max-width: 100%;
  max-height: 90dvh;
  border: 1px solid var(--line-ice);
  border-radius: var(--radius);
}

/* ── Keyframes GPU (solo transform y opacity) ── */

@keyframes cryoPulse {
  from {
    opacity: 0.35;
  }
  to {
    opacity: 1;
  }
}

@keyframes cryoScan {
  from {
    transform: translateX(-110%);
  }
  to {
    transform: translateX(270%);
  }
}

@keyframes msgArrive {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes iceSettle {
  0% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .js .canal-pill[data-ready="1"],
  .js .canal-pill-edge[data-ready="1"],
  .tactile,
  .accesos-drawer,
  .live-status {
    transition-duration: 0.01ms !important;
  }
  .msg-fresh {
    animation: none !important;
  }
  .scan-beam,
  .live-prompt-glyph,
  .js .canal-chip[data-busy="1"] .canal-dot {
    animation: none !important;
  }
}
