/* Hallmark · atmospheric · custom · posture: committed · surface: absolute · signature: monolithic phosphor-green bunker console with cryptographic core emblem, sliding channel pill and 450ms confirmation flash */
/* critique: surgical 1px hacker-green console on #040806 abyss with #39FF88 phosphor neon protagonist, console corner reticles, 4px grid discipline, physical spring pill and zero decorative clutter */

:root {
  --bg-abyss: #040806;
  --bg-panel: #08110C;
  --bg-elevated: #0C1912;
  --bg-user: #0B1D14;
  --bg-overlay: rgba(4, 8, 6, 0.86);

  --line: #142B1E;
  --line-subtle: #0D1E15;
  --line-grid: rgba(57, 255, 136, 0.024);
  --line-active: rgba(57, 255, 136, 0.38);

  --hack: #39FF88;
  --hack-dim: #133824;
  --hack-soft: rgba(57, 255, 136, 0.10);
  --hack-glow: rgba(57, 255, 136, 0.24);
  --ink-on-hack: #031109;

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

  --text-primary: #E7F7EE;
  --text-secondary: #8EB89F;
  --text-muted: #537B64;

  --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(--hack);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

/* ── App Shell (100dvh centrado y acotado en pantallas anchas, con retícula casi invisible) ── */

.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);
  background-image:
    linear-gradient(to right, var(--line-grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-grid) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--text-primary);
  border-left: 1px solid var(--line-subtle);
  border-right: 1px solid var(--line-subtle);
  position: relative;
}

/* ── Nuevo Logo Geométrico "Núcleo Criptográfico" (SVG puro, cero letras) ── */

.core-logo {
  display: block;
  flex-shrink: 0;
  overflow: visible;
}

.core-frame {
  fill: none;
  stroke: var(--hack-dim);
  stroke-width: 1.4;
}

.core-ring {
  fill: none;
  stroke: var(--hack-dim);
  stroke-width: 1;
}

.core-ticks {
  fill: none;
  stroke: var(--hack);
  stroke-width: 1.4;
  opacity: 0.72;
}

.core-shell {
  fill: var(--hack);
}

.core-diamond {
  fill: var(--hack);
  transform-origin: 16px 16px;
  opacity: 0.56;
  transition: opacity 200ms var(--ease-out), transform 220ms var(--ease-spring);
}

.core-logo-auth .core-diamond {
  opacity: 0.96;
}

.core-logo[data-online="1"] .core-diamond {
  opacity: 1;
  animation: hackCorePulse 1.6s var(--ease-out) infinite alternate;
}

.core-logo.core-flash {
  animation: hackLogoKick 450ms var(--ease-spring);
}

/* ── Esquinas técnicas tipo consola (┌ ┐ └ ┘) con ::before de 8 trazos de 1px ── */

.auth-panel::before,
.msg-assistant.msg-fresh::before {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  background:
    linear-gradient(var(--hack), var(--hack)) left top / 8px 1px no-repeat,
    linear-gradient(var(--hack), var(--hack)) left top / 1px 8px no-repeat,
    linear-gradient(var(--hack), var(--hack)) right top / 8px 1px no-repeat,
    linear-gradient(var(--hack), var(--hack)) right top / 1px 8px no-repeat,
    linear-gradient(var(--hack), var(--hack)) left bottom / 8px 1px no-repeat,
    linear-gradient(var(--hack), var(--hack)) left bottom / 1px 8px no-repeat,
    linear-gradient(var(--hack), var(--hack)) right bottom / 8px 1px no-repeat,
    linear-gradient(var(--hack), var(--hack)) right bottom / 1px 8px no-repeat;
}

.composer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 8px;
  pointer-events: none;
  background:
    linear-gradient(var(--line-active), var(--line-active)) left top / 8px 1px no-repeat,
    linear-gradient(var(--line-active), var(--line-active)) left top / 1px 8px no-repeat,
    linear-gradient(var(--line-active), var(--line-active)) right top / 8px 1px no-repeat,
    linear-gradient(var(--line-active), var(--line-active)) right top / 1px 8px no-repeat;
}

/* ── 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-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
}

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

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

.auth-tag {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.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(--hack);
  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(--hack);
  color: var(--ink-on-hack);
  border: 1px solid var(--hack);
}

.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);
}

.btn-primary:disabled,
.btn-ghost:disabled {
  background-color: var(--bg-elevated);
  color: var(--text-secondary);
  border-color: var(--line);
  cursor: not-allowed;
}

.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-active);
    color: var(--hack);
  }
  .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.9rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.06em;
  white-space: nowrap;
  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(--hack);
}

.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.68rem;
  white-space: nowrap;
}

.micro-btn[data-active="1"] {
  border-color: var(--line-active);
  color: var(--hack);
  background-color: var(--hack-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 verde 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(--hack-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(--hack);
  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(--hack);
}

.canal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--hack);
  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: hackPulse 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(--hack);
  pointer-events: none;
  animation: hackSettle 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-active);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 16px;
}

.canal-nuevo-input:focus {
  outline: 1px solid var(--hack);
  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-active);
  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(--hack);
  color: var(--ink-on-hack);
  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-active);
  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(--hack);
}

.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-active);
  background-color: var(--bg-panel);
}

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

.empty-hint {
  margin: 0;
  font-size: 0.92rem;
  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-client-inbox {
  align-self: flex-start;
  align-items: flex-start;
}

.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-active);
  color: var(--text-primary);
}

.msg-client-idea {
  background-color: var(--bg-elevated);
  border: 1px solid var(--line-active);
  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 destello de borde verde fósforo 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(--hack);
  box-shadow: 0 0 18px var(--hack-glow);
  pointer-events: none;
  animation: hackSettle 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(--hack);
  font-weight: 600;
}

.msg-confirm-badge {
  color: var(--hack);
  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(--hack);
}

.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(--hack);
  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(--hack);
  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(--hack);
  flex-shrink: 0;
}

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

.opt-btn[data-picked="1"] {
  border-color: var(--hack);
  background-color: var(--hack-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(--hack);
  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: hackPulse 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 láser de escaneo 1px verde fósforo 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(--hack);
  will-change: transform;
  animation: hackScan 1.35s linear infinite;
}

.composer-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.composer-mode-hint {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.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-active);
  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(--hack);
  outline-offset: -1px;
}

.prompt-sign {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--hack);
  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(--hack);
  color: var(--ink-on-hack);
  border: 1px solid var(--hack);
  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-secondary);
  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-active);
  border-radius: var(--radius);
}

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

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

@keyframes hackCorePulse {
  from {
    opacity: 0.52;
    transform: scale(0.88);
  }
  to {
    opacity: 1;
    transform: scale(1.08);
  }
}

@keyframes hackLogoKick {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.22);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes hackScan {
  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 hackSettle {
  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,
  .core-diamond {
    transition-duration: 0.01ms !important;
  }
  .msg-fresh,
  .core-logo.core-flash {
    animation: none !important;
  }
  .scan-beam,
  .live-prompt-glyph,
  .core-logo[data-online="1"] .core-diamond,
  .js .canal-chip[data-busy="1"] .canal-dot {
    animation: none !important;
  }
}
