/* jani-voice — oscuro a propósito: es una app de llamada. Cálida, en coral y durazno (lo creativo: diseño y redes),
   con verde agua de acento (lo de datos). Coral, la coordinadora, va en rosa. */

@property --spin {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

:root {
  color-scheme: dark;
  --bg: #0a0708;
  --bg-2: #161011;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #f7efe9;
  --muted: #b0a39f;
  --faint: #84766f;
  --blue: #ff6b57;
  --blue-2: #e8473a;
  --sky: #ffa66b;
  --ice: #ffd9c7;
  --violet: #ff5c8a;
  --teal: #5ce1c6;
  --red: #ff4d5e;
  --radius: 22px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, 'Segoe UI', sans-serif;
  --display: 'Instrument Serif', 'New York', ui-serif, Georgia, serif;
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;
  --z-app: 10;
  --z-fab: 20;
  --z-sheet: 40;
  --z-pill: 45;
  --z-call: 50;
  --z-toast: 60;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}

button:focus-visible,
textarea:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--ice);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 14px;
}
.mono {
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
}

/* ---------- fondo: aurora lenta + grano ---------- */

.aurora {
  position: fixed;
  inset: -25%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
  transition: opacity 1.2s var(--ease-io);
}
.aurora i {
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  will-change: transform;
  animation: drift 40s var(--ease-io) infinite alternate;
}
.aurora i:nth-child(1) {
  background: radial-gradient(closest-side, rgba(255, 107, 87, 0.3), transparent 72%);
  top: -8%;
  left: -12%;
}
.aurora i:nth-child(2) {
  background: radial-gradient(closest-side, rgba(255, 92, 138, 0.24), transparent 72%);
  top: 28%;
  right: -22%;
  animation-duration: 48s;
  animation-delay: -14s;
}
.aurora i:nth-child(3) {
  background: radial-gradient(closest-side, rgba(92, 225, 198, 0.13), transparent 72%);
  bottom: -18%;
  left: 8%;
  animation-duration: 56s;
  animation-delay: -26s;
}
body.in-call .aurora {
  opacity: 0.25;
}
@keyframes drift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(9vmax, 6vmax, 0) scale(1.12);
  }
  100% {
    transform: translate3d(-7vmax, 11vmax, 0) scale(0.94);
  }
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.08;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- contenedor: sigue al viewport visible (teclado de iOS) ---------- */

#app {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-app);
  height: var(--vvh, 100dvh);
  transform: translateY(var(--vvt, 0px));
  view-transition-name: app;
}

.view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  max-width: 720px;
  margin: 0 auto;
}
.view.enter {
  animation: view-in 0.5s var(--ease-out) both;
}
.view.enter-back {
  animation: view-in-back 0.5s var(--ease-out) both;
}
@keyframes view-in {
  from {
    opacity: 0;
    transform: translateX(28px);
  }
}
@keyframes view-in-back {
  from {
    opacity: 0;
    transform: translateX(-28px);
  }
}

::view-transition-old(app),
::view-transition-new(app) {
  animation-duration: 0.46s;
  animation-timing-function: var(--ease-out);
}
html[data-dir='fwd']::view-transition-old(app) {
  animation-name: vt-out-left;
}
html[data-dir='fwd']::view-transition-new(app) {
  animation-name: vt-in-right;
}
html[data-dir='back']::view-transition-old(app) {
  animation-name: vt-out-right;
}
html[data-dir='back']::view-transition-new(app) {
  animation-name: vt-in-left;
}
@keyframes vt-out-left {
  to {
    opacity: 0;
    transform: translateX(-18%) scale(0.98);
  }
}
@keyframes vt-in-right {
  from {
    opacity: 0;
    transform: translateX(22%);
  }
}
@keyframes vt-out-right {
  to {
    opacity: 0;
    transform: translateX(22%);
  }
}
@keyframes vt-in-left {
  from {
    opacity: 0;
    transform: translateX(-18%) scale(0.98);
  }
}

/* ---------- piezas comunes ---------- */

.icon-btn {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition:
    background 0.2s,
    transform 0.2s var(--ease-out);
}
.icon-btn:active {
  background: var(--surface-2);
  transform: scale(0.92);
}
.icon-btn.glass {
  background: var(--surface);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}
.icon-btn.ghost {
  pointer-events: none;
}

.btn {
  height: 54px;
  border-radius: 18px;
  font-weight: 600;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 20px;
  transition:
    transform 0.2s var(--ease-out),
    filter 0.2s,
    background 0.2s;
}
.btn:active {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.6;
  cursor: default;
}
.btn-primary {
  background: linear-gradient(135deg, #ff7d63, var(--blue-2) 55%, #ffa66b);
  color: #ffffff;
  box-shadow:
    0 10px 30px -10px rgba(232, 71, 58, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-ghost {
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.btn-quiet {
  color: var(--muted);
  height: 46px;
}
.btn.small {
  height: 48px;
  padding: 0 18px;
  font-size: 15px;
}

.field {
  width: 100%;
  height: 54px;
  border-radius: 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 0 18px;
  font: 16px var(--font);
  color: var(--text);
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.field:focus {
  border-color: rgba(255, 130, 100, 0.7);
  box-shadow: 0 0 0 4px rgba(255, 107, 87, 0.15);
}
.field::placeholder {
  color: var(--faint);
}

/* ---------- entrar ---------- */

.login {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
.login h1 {
  font: italic 400 72px/1 var(--display);
  margin: 26px 0 6px;
  letter-spacing: -0.01em;
}
.login-actions {
  width: 100%;
  max-width: 340px;
  display: grid;
  gap: 12px;
  margin-top: 30px;
}
.login-err {
  min-height: 22px;
  margin: 0;
  color: #ff9aa4;
  font-size: 14px;
}
.shake {
  animation: shake 0.42s var(--ease-out);
}
@keyframes shake {
  20%,
  60% {
    transform: translateX(-8px);
  }
  40%,
  80% {
    transform: translateX(8px);
  }
}

.big-orb,
.empty-orb {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #fff3ec 0 6%, transparent 22%),
    radial-gradient(circle at 50% 50%, #ffab8a 0%, #e8473a 42%, #6e1d12 78%, #200805 100%);
  box-shadow:
    0 0 80px -10px rgba(232, 71, 58, 0.55),
    0 0 160px -30px rgba(255, 92, 138, 0.45),
    inset 0 -14px 30px rgba(0, 0, 0, 0.35);
  animation: breathe 4.8s var(--ease-io) infinite;
  position: relative;
}
.big-orb::after,
.empty-orb::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 55%, rgba(255, 224, 210, 0.35) 70%, transparent 85%);
  mix-blend-mode: screen;
  animation: spin 9s linear infinite;
}
@keyframes breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- inicio ---------- */

.home-head {
  padding: calc(var(--safe-t) + 22px) 22px 4px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.brand {
  font: 600 12px/1 var(--font);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  gap: 9px;
  align-items: center;
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  animation: ping 2.6s var(--ease-out) infinite;
}
.offline .live-dot {
  background: var(--faint);
  animation: none;
}
@keyframes ping {
  0% {
    box-shadow: 0 0 0 0 rgba(92, 225, 198, 0.55);
  }
  70%,
  100% {
    box-shadow: 0 0 0 9px rgba(92, 225, 198, 0);
  }
}
.hello {
  font: 400 44px/1.02 var(--display);
  letter-spacing: -0.012em;
  margin: 16px 0 8px;
}
.hello em {
  font-style: italic;
  background: linear-gradient(100deg, var(--ice), var(--blue) 60%, var(--sky));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.summary {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 16px calc(var(--safe-b) + 120px);
  mask-image: linear-gradient(transparent 0, #000 18px);
}
.section-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 22px 8px 10px;
  font: 600 12px var(--font);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}
.section-label .hint {
  letter-spacing: 0.04em;
  text-transform: none;
  font-weight: 500;
}

.conv-swipe {
  position: relative;
  margin-bottom: 10px;
  border-radius: var(--radius);
  transition:
    max-height 0.25s var(--ease-out),
    opacity 0.25s;
}
.conv-swipe > .conv {
  margin-bottom: 0;
  touch-action: pan-y;
}
.conv-swipe-bg {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-right: 22px;
  border-radius: var(--radius);
  background: rgba(255, 77, 94, 0.18);
  color: var(--red);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
}
.conv-swipe.is-swiping .conv-swipe-bg,
.conv-swipe.is-leaving .conv-swipe-bg {
  display: flex;
}
.conv-swipe.is-armed .conv-swipe-bg {
  background: var(--red);
  color: #fff;
}
.conv-swipe.is-leaving {
  opacity: 0;
}
.conv-call {
  display: none;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--teal);
  border: 1px solid rgba(92, 225, 198, 0.4);
  background: rgba(92, 225, 198, 0.1);
  border-radius: 999px;
  padding: 2px 8px;
}
.is-call .conv-call {
  display: inline-flex;
}
.conv-call-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  animation: call-pulse 1.4s ease-in-out infinite;
}
@keyframes call-pulse {
  50% {
    opacity: 0.3;
  }
}

.conv {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  padding: 14px 14px 14px 14px;
  margin-bottom: 10px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  position: relative;
  animation: rise 0.5s var(--ease-out) both;
  transition:
    transform 0.25s var(--ease-out),
    background 0.25s;
}
.conv:active {
  transform: scale(0.985);
  background: var(--surface-2);
}
.conv.is-running {
  border-color: transparent;
  background:
    linear-gradient(#1a1213, #1a1213) padding-box,
    conic-gradient(from var(--spin), rgba(255, 255, 255, 0.07) 0 62%, var(--blue) 76%, var(--sky) 84%, rgba(255, 255, 255, 0.07) 96%) border-box;
  animation:
    rise 0.5s var(--ease-out) both,
    border-spin 3.2s linear infinite;
}
@keyframes border-spin {
  to {
    --spin: 360deg;
  }
}
.conv.is-other {
  background: rgba(255, 255, 255, 0.025);
}

.avatar {
  --h: 20;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 50%;
  position: relative;
  background: radial-gradient(
    circle at 33% 28%,
    hsl(calc(var(--h) + 25) 100% 90%) 0 7%,
    hsl(var(--h) 95% 64%) 32%,
    hsl(calc(var(--h) - 35) 75% 32%) 72%,
    hsl(calc(var(--h) - 60) 70% 12%) 100%
  );
  box-shadow:
    0 8px 20px -8px hsl(var(--h) 90% 55% / 0.7),
    inset 0 -4px 10px rgba(0, 0, 0, 0.35);
}
.avatar::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 60%, hsl(calc(var(--h) + 40) 100% 80% / 0.9) 80%, transparent 95%);
  -webkit-mask: radial-gradient(closest-side, transparent 86%, #000 88%);
  mask: radial-gradient(closest-side, transparent 86%, #000 88%);
  opacity: 0;
  transition: opacity 0.4s;
}
/* La carita de Lisa en chico: dos ojos blancos que parpadean, como en la llamada. */
.ai-eyes {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 17%;
  padding-bottom: 8%;
  pointer-events: none;
}
.ai-eyes i {
  width: 13%;
  height: 16%;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
  animation: ai-blink 5.5s infinite;
}
@keyframes ai-blink {
  0%,
  94%,
  100% {
    transform: scaleY(1);
  }
  96% {
    transform: scaleY(0.1);
  }
}
.is-running .avatar {
  animation: breathe 2.6s var(--ease-io) infinite;
}
.is-running .avatar::after {
  opacity: 1;
  animation: spin 1.8s linear infinite;
}

.glyph {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.conv-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.conv-top {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.conv-title {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-time {
  font-size: 13px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  flex: none;
}
.conv-sub {
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.conv-sub:empty {
  display: none;
}
.conv-sub.activity,
.working .txt,
.call-activity .txt {
  background: linear-gradient(90deg, var(--ice) 0%, #fff 40%, var(--ice) 60%, var(--sky) 100%) 0 0 / 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 2.4s linear infinite;
}
@keyframes shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -150% 0;
  }
}
.conv-foot {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}
/* Sin llamada ni cola, el pie queda vacío y no ocupa alto. */
.conv:not(.is-call) .conv-foot:has(.conv-state:empty):has(.conv-when:empty):has(.conv-branch:empty):has(.conv-agents:empty):has(.conv-by:empty) {
  display: none;
}
.conv-lead {
  flex: none;
  width: 74px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.chip-cwd {
  max-width: 100%;
  font: 500 10px/1 var(--mono);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip-cwd:empty {
  display: none;
}
.conv-state {
  font-size: 12px;
  color: var(--faint);
}
.conv.is-ended {
  opacity: 0.72;
}
.unread-dot {
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 14px var(--blue);
  transform: scale(0);
  transition: transform 0.35s var(--spring);
}
.is-unread .unread-dot {
  transform: scale(1);
}

.more {
  width: 100%;
  height: 48px;
  border-radius: 16px;
  color: var(--muted);
  font-size: 14px;
  border: 1px dashed var(--line-2);
}
.more:active {
  background: var(--surface);
}

.empty {
  text-align: center;
  padding: 60px 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.empty-orb {
  width: 110px;
  height: 110px;
  margin-bottom: 26px;
}
.empty p {
  margin: 4px 0;
}
.empty p:first-of-type {
  font: italic 400 26px var(--display);
}

.fab {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-b) + 22px);
  z-index: var(--z-fab);
  transform: translateX(-50%);
  height: 62px;
  padding: 0 28px 0 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 999px;
  font-weight: 650;
  font-size: 17px;
  white-space: nowrap;
  color: #ffffff;
  background: linear-gradient(135deg, #ff7d63, var(--blue-2) 50%, #ffa66b);
  box-shadow:
    0 14px 40px -10px rgba(232, 71, 58, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.25s var(--ease-out);
  animation: fab-in 0.7s var(--spring) both 0.1s;
}
.fab:active {
  transform: translateX(-50%) scale(0.96);
}
@keyframes fab-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(30px) scale(0.9);
  }
}
.fab-orb {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffd9c7 0 8%, #ff7d63 40%, #b8321f 85%);
  box-shadow:
    inset 0 -3px 8px rgba(90, 24, 14, 0.35),
    0 0 0 2px rgba(255, 255, 255, 0.35);
}

/* ---------- conversa ---------- */

.chat-head {
  padding: calc(var(--safe-t) + 6px) 8px 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
  z-index: 2;
  background: linear-gradient(var(--bg) 55%, transparent);
  transition: padding 0.4s var(--ease-out);
}
body.call-min .chat-head {
  padding-top: calc(var(--safe-t) + 58px);
}
.chat-title {
  flex: 1;
  min-width: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.chat-title b {
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-title small {
  font: 12px var(--mono);
  color: var(--faint);
}
.chat-head.busy .chat-title small {
  color: var(--sky);
}

.scroller {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px 18px 18px;
  overscroll-behavior: contain;
}
.banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--muted);
  background: rgba(255, 92, 138, 0.08);
  border: 1px solid rgba(255, 92, 138, 0.25);
  border-radius: 16px;
  padding: 12px 14px;
  margin: 4px 0 16px;
}
.banner svg {
  flex: none;
  color: var(--violet);
  margin-top: 2px;
}
.messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.hint-empty {
  text-align: center;
  color: var(--faint);
  font: italic 22px/1.3 var(--display);
  padding: 30vh 20px 0;
}

.msg {
  animation: rise 0.45s var(--ease-out) both;
  overflow-wrap: anywhere;
}
.msg.still,
.steps.still {
  animation: none;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
.msg.user {
  /* Mantener apretado abre el menú del mensaje (rama, copiar), no el de iOS. */
  -webkit-touch-callout: none;
  align-self: flex-end;
  max-width: 86%;
  padding: 11px 16px;
  border-radius: 22px 22px 6px 22px;
  background: linear-gradient(135deg, rgba(255, 130, 100, 0.24), rgba(232, 71, 58, 0.13));
  border: 1px solid rgba(255, 130, 100, 0.28);
  white-space: pre-wrap;
  line-height: 1.45;
}
.msg.user .via {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 6px;
  vertical-align: -3px;
  border-radius: 50%;
  background: rgba(255, 130, 100, 0.25);
  color: var(--ice);
}
.msg.claude {
  align-self: stretch;
  line-height: 1.62;
  font-size: 16px;
}
.msg.claude.error {
  color: #ff9aa4;
}
.msg.claude > :first-child {
  margin-top: 0;
}
.msg.claude > :last-child {
  margin-bottom: 0;
}
.msg.claude p {
  margin: 0 0 0.7em;
}
.msg.claude a {
  color: var(--ice);
}
.msg.claude strong {
  font-weight: 650;
}
.msg.claude code {
  font: 0.86em var(--mono);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 5px;
}
.msg.claude pre {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  overflow-x: auto;
  font-size: 13px;
}
.msg.claude pre code {
  background: none;
  border: 0;
  padding: 0;
}
.msg.claude ul,
.msg.claude ol {
  padding-left: 1.3em;
  margin: 0 0 0.7em;
}
.msg.claude li {
  margin: 0.2em 0;
}
.msg.claude table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 14px;
}
.msg.claude th,
.msg.claude td {
  border: 1px solid var(--line);
  padding: 6px 9px;
}
.msg.claude blockquote {
  margin: 0 0 0.7em;
  padding-left: 12px;
  border-left: 3px solid var(--line-2);
  color: var(--muted);
}

.steps {
  align-self: flex-start;
  max-width: 100%;
  animation: rise 0.4s var(--ease-out) both;
}
.steps summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 7px 12px 7px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.steps summary::-webkit-details-marker {
  display: none;
}
.steps-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.steps-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--violet);
  box-shadow: 0 0 10px var(--violet);
}
.steps summary svg {
  flex: none;
  transition: transform 0.25s var(--ease-out);
}
.steps[open] summary svg {
  transform: rotate(90deg);
}
.steps-list {
  margin: 8px 0 0 14px;
  padding: 2px 0 2px 16px;
  border-left: 1px solid var(--line-2);
  font: 12.5px/1.5 var(--mono);
  color: var(--muted);
  list-style: none;
}
.steps-list li {
  padding: 3px 0;
  overflow-wrap: anywhere;
}

.working {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  font-size: 14px;
  animation: rise 0.4s var(--ease-out) both;
}
.working .txt {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.spark {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  background: conic-gradient(from var(--spin), var(--violet), var(--teal), var(--blue), var(--violet));
  -webkit-mask: radial-gradient(closest-side, transparent 55%, #000 58%);
  mask: radial-gradient(closest-side, transparent 55%, #000 58%);
  animation: border-spin 1.2s linear infinite;
}
.stop {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  border: 1px solid var(--line-2);
}
.stop:active {
  background: var(--surface-2);
}

.composer {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 12px calc(var(--safe-b) + 10px);
  background: linear-gradient(transparent, var(--bg) 35%);
}
.to-bottom {
  position: absolute;
  z-index: 2;
  bottom: calc(100% + 4px);
  left: 50%;
  width: 40px;
  height: 40px;
  margin-left: -20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text);
  background: rgba(38, 28, 27, 0.85);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line-2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(8px) scale(0.8);
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.3s var(--spring);
}
.to-bottom.on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.to-bottom:active {
  transform: scale(0.92);
}
body.kb-open .composer {
  padding-bottom: 10px;
}
.input-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  min-height: 52px;
  padding: 6px 6px 6px 18px;
  border-radius: 26px;
  background: rgba(38, 27, 27, 0.8);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  transition: border-color 0.2s;
}
.input-wrap:focus-within {
  border-color: rgba(255, 130, 100, 0.5);
}
.input-wrap textarea {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  resize: none;
  background: none;
  color: var(--text);
  font: 16px/1.4 var(--font);
  padding: 9px 0;
  max-height: 140px;
}
.input-wrap {
  flex-wrap: wrap;
  padding-left: 6px;
}
.attach {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.attach-tray {
  flex-basis: 100%;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 6px 2px;
}
.attach-tray[hidden] {
  display: none;
}
.attach-thumb {
  position: relative;
  flex: none;
}
.attach-thumb img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 14px;
  display: block;
}
.attach-x {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(26, 19, 18, 0.92);
  border: 1px solid var(--line);
}
.msg-images {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.msg-images img {
  max-width: 220px;
  max-height: 260px;
  border-radius: 14px;
  display: block;
}
.msg-images video {
  width: 100%;
  max-width: 300px;
  max-height: 420px;
  border-radius: 14px;
  display: block;
  background: #000;
}
.msg.claude.shown .msg-images {
  margin-bottom: 4px;
}
.msg.claude.shown .msg-images img {
  max-width: 100%;
  max-height: 420px;
}
.viewer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--safe-t) + 64px) 12px 24px;
  background: rgba(6, 3, 3, 0.96);
  opacity: 0;
  transition: opacity 0.25s var(--ease-out);
}
.viewer.open {
  opacity: 1;
}
.viewer img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
}
.viewer-x {
  position: absolute;
  top: calc(var(--safe-t) + 10px);
  right: 14px;
}
.input-wrap textarea::placeholder {
  color: var(--faint);
}
.send {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--blue);
  transform: scale(0);
  opacity: 0;
  transition:
    transform 0.3s var(--spring),
    opacity 0.2s;
}
.has-text .send {
  transform: scale(1);
  opacity: 1;
}
.call-btn {
  width: 36px;
  height: 36px;
  margin-right: 4px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: radial-gradient(circle at 35% 30%, #fff3ec, #ffab8a 38%, var(--blue-2) 78%);
  box-shadow:
    0 6px 16px -6px rgba(232, 71, 58, 0.8),
    inset 0 -2px 6px rgba(90, 24, 14, 0.3);
  transition: transform 0.25s var(--ease-out);
}
.call-btn:active {
  transform: scale(0.92);
}

/* ---------- hojas ---------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-sheet);
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.35s;
}
.sheet-backdrop.open {
  opacity: 1;
}
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: calc(var(--z-sheet) + 1);
  max-width: 720px;
  margin: 0 auto;
  max-height: 88dvh;
  overflow-y: auto;
  padding: 10px 20px calc(var(--safe-b) + 22px);
  border-radius: 30px 30px 0 0;
  background: rgba(27, 18, 18, 0.94);
  border-top: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(30px) saturate(1.4);
  backdrop-filter: blur(30px) saturate(1.4);
  transform: translateY(105%);
  transition: transform 0.5s var(--ease-out);
}
.sheet.open {
  transform: translateY(0);
}
.grabber {
  width: 40px;
  height: 5px;
  border-radius: 3px;
  background: var(--line-2);
  margin: 0 auto 14px;
}
.sheet h2 {
  font: 400 32px/1.1 var(--display);
  margin: 4px 0 6px;
}
.sheet .label {
  display: block;
  margin: 22px 0 6px;
  font: 600 12px var(--font);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}
.sheet .row {
  display: flex;
  gap: 10px;
}
.roots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.root {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  font: 500 14px var(--mono);
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: all 0.2s var(--ease-out);
}
.root[aria-pressed='true'] {
  color: var(--ice);
  border-color: rgba(255, 130, 100, 0.6);
  background: rgba(255, 107, 87, 0.12);
}
.root-hint {
  min-height: 21px;
  margin: 12px 2px 0;
  color: var(--faint);
  font-size: 14px;
}
.sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 24px;
}
.sheet-actions.single {
  grid-template-columns: 1fr;
  margin-top: 12px;
}
.voices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.voice {
  text-align: left;
  display: grid;
  grid-template-columns: 1fr auto;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: all 0.2s var(--ease-out);
}
.voice-name {
  font-weight: 600;
}
.voice-desc {
  grid-column: 1;
  font-size: 13px;
  color: var(--muted);
}
.voice-check {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  color: var(--blue);
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.3s var(--spring);
}
.voice[aria-pressed='true'] {
  border-color: rgba(255, 130, 100, 0.6);
  background: rgba(255, 107, 87, 0.1);
}
.voice[aria-pressed='true'] .voice-check {
  opacity: 1;
  transform: scale(1);
}

/* ---------- llamada ---------- */

.call {
  position: fixed;
  inset: 0;
  z-index: var(--z-call);
  display: flex;
  flex-direction: column;
  align-items: center;
  background: radial-gradient(120% 75% at 50% 38%, #26100f 0%, #110a09 55%, #080404 100%);
  opacity: 0;
  transform: scale(1.04);
  transition:
    opacity 0.5s var(--ease-out),
    transform 0.6s var(--ease-out);
  overflow: hidden;
}
.call.open {
  opacity: 1;
  transform: none;
}
.call.minimized {
  opacity: 0;
  transform: scale(0.92) translateY(-12%);
  pointer-events: none;
}
.call::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(60% 40% at 50% 40%, var(--glow, rgba(255, 107, 87, 0.16)), transparent 70%);
  transition: background 1s var(--ease-io);
}
.call[data-state='thinking'] {
  --glow: rgba(255, 92, 138, 0.2);
}
.call[data-state='speaking'] {
  --glow: rgba(255, 166, 107, 0.2);
}
.call[data-state='muted'],
.call[data-state='connecting'] {
  --glow: rgba(190, 150, 160, 0.1);
}

.orb-canvas {
  position: absolute;
  left: 50%;
  top: 38%;
  width: min(125vw, 680px);
  height: min(125vw, 680px);
  transform: translate(-50%, -50%);
}
.orb-canvas.orb-fallback {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3ec, #ffab8a 30%, #e8473a 60%, #4f150c);
  animation: breathe 3s var(--ease-io) infinite;
}
.call-top {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 720px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-t) + 8px) 10px 0;
}
.call-title {
  text-align: center;
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}
.call-title b {
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 64vw;
}
.call-title small {
  font: 13px var(--mono);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.call-stage {
  flex: 1;
}
.call-bottom {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 560px;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.call-label {
  min-height: 36px;
  margin: 0 0 8px;
  font: italic 400 30px/1.2 var(--display);
  color: var(--text);
  transition: opacity 0.3s;
}
.call-label:empty {
  opacity: 0;
}
.captions {
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
}
.captions p {
  margin: 0;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.35s var(--ease-out),
    transform 0.35s var(--ease-out);
}
.captions p.show {
  opacity: 1;
  transform: none;
}
.cap-user {
  font-size: 15px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cap-model {
  font-size: 19px;
  line-height: 1.4;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.call-activity {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  height: 38px;
  margin-top: 14px;
  padding: 0 14px 0 8px;
  border-radius: 999px;
  background: rgba(255, 92, 138, 0.1);
  border: 1px solid rgba(255, 92, 138, 0.25);
  font-size: 14px;
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  transition:
    opacity 0.35s var(--ease-out),
    transform 0.35s var(--ease-out);
}
.call-activity.show {
  opacity: 1;
  transform: none;
}
.call-activity .txt {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.call-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 24px 0 calc(var(--safe-b) + 28px);
}
.ctl {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  transition:
    transform 0.25s var(--ease-out),
    background 0.25s,
    color 0.25s;
}
.ctl:active {
  transform: scale(0.9);
}
.ctl[aria-pressed='true'] {
  background: var(--text);
  color: #111;
}
.ctl.hangup {
  width: 78px;
  height: 78px;
  border: 0;
  background: var(--red);
  color: #fff;
  box-shadow: 0 14px 36px -10px rgba(255, 77, 94, 0.8);
}

.call-pill {
  position: fixed;
  top: calc(var(--safe-t) + 8px);
  left: 50%;
  z-index: var(--z-pill);
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 16px 0 8px;
  border-radius: 999px;
  background: rgba(30, 19, 19, 0.88);
  border: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.8);
  font-size: 14px;
  font-weight: 600;
  transform: translate(-50%, -160%);
  transition: transform 0.5s var(--spring);
}
.call-pill.show {
  transform: translate(-50%, 0);
}
.mini-orb {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffc2a6, var(--blue-2) 60%, #6e1d12);
  box-shadow: 0 0 16px rgba(255, 107, 87, 0.6);
  animation: breathe 2.2s var(--ease-io) infinite;
}
.call-pill[data-state='thinking'] .mini-orb {
  background: radial-gradient(circle at 35% 30%, #e9fffa, #ff5c8a 45%, #861b3e);
  box-shadow: 0 0 16px rgba(255, 92, 138, 0.7);
}
.pill-time {
  font: 13px var(--mono);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- avisos ---------- */

#toasts {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--safe-b) + 100px);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  padding: 0 16px;
}
.toast {
  max-width: 440px;
  padding: 12px 18px;
  border-radius: 18px;
  background: rgba(38, 27, 27, 0.95);
  border: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  font-size: 15px;
  text-align: center;
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: translateY(14px) scale(0.97);
  transition:
    opacity 0.35s var(--ease-out),
    transform 0.35s var(--ease-out);
}
.toast.show {
  opacity: 1;
  transform: none;
}

/* ---------- pantallas grandes: la app queda centrada como un teléfono ---------- */

@media (min-width: 760px) {
  .hello {
    font-size: 56px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .aurora i {
    animation: none;
  }
}

.btn-danger {
  background: linear-gradient(135deg, #ff5f6d, #e5384a);
  color: #ffffff;
  box-shadow: 0 10px 30px -10px rgba(229, 56, 74, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
/* El switch que da el toque háptico en iOS: fuera de la pantalla, pero presente. */
.haptic {
  position: fixed;
  left: -100px;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* Conversa cuyo objetivo ya se logró: borde verde con brillo suave, lista para archivar. */
.conv-done {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  display: none;
}
.conv.is-done .conv-done {
  display: inline;
}
.conv.is-done {
  border-color: transparent;
  background:
    linear-gradient(#0c1410, #0c1410) padding-box,
    linear-gradient(135deg, #4ade80, rgba(74, 222, 128, 0.25) 45%, rgba(92, 225, 198, 0.2) 70%, #5ce1c6) border-box;
  box-shadow:
    0 0 0 1px rgba(74, 222, 128, 0.06),
    0 6px 24px -10px rgba(74, 222, 128, 0.45);
}
.conv.is-done:active {
  background:
    linear-gradient(#111c16, #111c16) padding-box,
    linear-gradient(135deg, #4ade80, rgba(74, 222, 128, 0.25) 45%, rgba(92, 225, 198, 0.2) 70%, #5ce1c6) border-box;
}

/* Conversa que espera algo de Jani (un sí, una respuesta, una prueba): borde amarillo. */
.conv-wait {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  display: none;
}
.conv.is-waiting .conv-wait {
  display: inline;
}
.conv.is-waiting {
  border-color: transparent;
  background:
    linear-gradient(#15130a, #15130a) padding-box,
    linear-gradient(135deg, #facc15, rgba(250, 204, 21, 0.25) 45%, rgba(251, 191, 36, 0.2) 70%, #fbbf24) border-box;
  box-shadow:
    0 0 0 1px rgba(250, 204, 21, 0.06),
    0 6px 24px -10px rgba(250, 204, 21, 0.45);
}
.conv.is-waiting:active {
  background:
    linear-gradient(#1d1a0e, #1d1a0e) padding-box,
    linear-gradient(135deg, #facc15, rgba(250, 204, 21, 0.25) 45%, rgba(251, 191, 36, 0.2) 70%, #fbbf24) border-box;
}

/* ---------- filtro de conversas ---------- */

/* Por persona: va debajo de los filtros de estado, un poco más chica. */
.filters.people {
  margin-top: -6px;
}
.filters.people .filter {
  height: 30px;
  padding: 0 10px;
  gap: 5px;
}
.conv-by {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  font: 500 12px var(--font);
  color: var(--muted);
}
.conv-by:empty {
  display: none;
}

.filters {
  display: flex;
  gap: 6px;
  margin: -2px 4px 12px;
  /* Con cuatro filtros no caben en un iPhone angosto: se deslizan de lado. */
  overflow-x: auto;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar {
  display: none;
}
.filter {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font: 500 13px var(--font);
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: all 0.2s var(--ease-out);
}
.filter-n {
  font: 500 11px var(--mono);
  opacity: 0.7;
}
.filter[aria-pressed='true'] {
  color: var(--ice);
  border-color: rgba(255, 130, 100, 0.6);
  background: rgba(255, 107, 87, 0.12);
}
.filter-empty {
  margin: 6px 8px 14px;
  font-size: 14px;
}

/* ---------- Coral, la sesión padre: rosa y verde agua, una esfera con satélites ---------- */

.wali-hero {
  position: relative;
  margin: 10px 0 4px;
  border-radius: 30px;
  isolation: isolate;
  animation: rise 0.55s var(--ease-out) both;
}
/* Un borde que respira en rosa y verde agua: la distingue de cualquier conversa. */
.wali-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--spin), rgba(255, 92, 138, 0.55), rgba(92, 225, 198, 0.45), rgba(255, 166, 107, 0.35), rgba(255, 92, 138, 0.55));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: border-spin 9s linear infinite;
  z-index: -1;
}
.wali-hero.is-thinking::before {
  animation-duration: 2.4s;
}
.wali-hero-main {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  padding: 18px 76px 18px 16px;
  border-radius: inherit;
  background:
    radial-gradient(130% 150% at 0% 0%, rgba(255, 92, 138, 0.3), transparent 55%),
    radial-gradient(120% 160% at 100% 110%, rgba(92, 225, 198, 0.17), transparent 60%),
    rgba(30, 16, 16, 0.75);
  box-shadow:
    0 24px 60px -28px rgba(255, 80, 125, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.09);
  transition: transform 0.25s var(--ease-out);
}
.wali-hero-main:active {
  transform: scale(0.985);
}
.wali-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wali-eyebrow {
  font: 600 10.5px/1 var(--font);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 200, 215, 0.75);
}
.wali-name {
  font: italic 400 40px/1 var(--display);
  letter-spacing: -0.01em;
  background: linear-gradient(100deg, #ffe6ec, #ff86a8 45%, var(--teal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding: 2px 0 4px;
}
.wali-line {
  font-size: 14.5px;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wali-sub {
  font-size: 12.5px;
  color: var(--muted);
}
.wali-sub:empty {
  display: none;
}
.wali-hero-call {
  position: absolute;
  right: 14px;
  top: 50%;
  translate: 0 -50%;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #ff7aa0, #e03a6e 55%, #3fc6ae);
  box-shadow:
    0 12px 30px -10px rgba(250, 70, 118, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.2s var(--ease-out);
}
.wali-hero-call:active {
  transform: scale(0.92);
}

/* La esfera: núcleo rosa con la carita, un halo que gira y los satélites (las sesiones que trabajan). */
.wali-orb {
  position: relative;
  flex: none;
  width: 78px;
  height: 78px;
}
.wali-orb .core {
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 27%, #fff 0 5%, #ffd3df 14%, #ff6f97 38%, #b02552 72%, #3a0a1a 100%);
  box-shadow:
    0 0 34px rgba(255, 92, 138, 0.6),
    inset 0 -6px 14px rgba(0, 0, 0, 0.35);
  animation: breathe 4.5s var(--ease-io) infinite;
}
.wali-orb .halo {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 40%, rgba(92, 225, 198, 0.9) 60%, transparent 72%, rgba(255, 134, 168, 0.85) 88%, transparent 100%);
  -webkit-mask: radial-gradient(closest-side, transparent 88%, #000 90%);
  mask: radial-gradient(closest-side, transparent 88%, #000 90%);
  animation: spin 7s linear infinite;
}
.is-thinking .wali-orb .halo,
.is-padre.thinking .mini-orb::after {
  animation-duration: 1.4s;
}
.wali-orb .sats {
  position: absolute;
  inset: 0;
  animation: spin 16s linear infinite;
}
.wali-orb .sats i {
  --h: 220;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 9px;
  margin: -4.5px;
  border-radius: 50%;
  background: hsl(var(--h) 95% 68%);
  box-shadow: 0 0 10px hsl(var(--h) 95% 60%);
  transform: rotate(var(--a)) translateX(41px);
}
.wali-badge {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font: 700 12px/1 var(--font);
  color: #1b1405;
  background: #ffc861;
  box-shadow: 0 0 0 3px rgba(30, 16, 16, 0.9);
  animation: rise 0.4s var(--spring) both;
}
.wali-badge:empty {
  display: none;
}
.wali-orb.big {
  width: 120px;
  height: 120px;
  margin: 0 auto 18px;
}
.wali-orb.big .core {
  inset: 16px;
}

/* Las sesiones que abrió Coral llevan una brújula chica en el avatar. */
.from-wali-badge {
  position: absolute;
  right: -3px;
  bottom: -3px;
  z-index: 2;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #ff7aa0, #d1325f);
  box-shadow: 0 0 0 2.5px var(--bg);
}

/* ---------- la conversa con Coral ---------- */

body.padre-mode .aurora i:nth-child(1) {
  background: radial-gradient(closest-side, rgba(255, 92, 138, 0.34), transparent 72%);
}
body.padre-mode .aurora i:nth-child(3) {
  background: radial-gradient(closest-side, rgba(92, 225, 198, 0.2), transparent 72%);
}
.padre-title {
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 10px;
}
.padre-title-txt {
  display: flex;
  flex-direction: column;
  text-align: left;
  min-width: 0;
}
.padre-title b {
  font: italic 400 24px/1 var(--display);
  background: linear-gradient(100deg, #ffe6ec, #ff86a8 50%, var(--teal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-bottom: 2px;
}
.padre-head .chat-title small {
  white-space: nowrap;
  font: 11.5px var(--font);
  color: var(--muted);
}
.mini-orb {
  position: relative;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 27%, #fff 0 5%, #ffd3df 14%, #ff6f97 38%, #b02552 72%, #3a0a1a 100%);
  box-shadow: 0 0 18px rgba(255, 92, 138, 0.55);
}
.mini-orb::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 55%, rgba(92, 225, 198, 0.95) 75%, transparent 90%);
  -webkit-mask: radial-gradient(closest-side, transparent 84%, #000 87%);
  mask: radial-gradient(closest-side, transparent 84%, #000 87%);
  opacity: 0;
  transition: opacity 0.4s;
}
.padre-head.busy .mini-orb::after {
  opacity: 1;
  animation: spin 1.4s linear infinite;
}
.wali-reset {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  margin-right: 6px;
  border-radius: 999px;
  font: 600 12.5px/1 var(--font);
  color: #ffd8e2;
  background: rgba(255, 92, 138, 0.13);
  border: 1px solid rgba(255, 92, 138, 0.32);
  white-space: nowrap;
}
.wali-reset:active {
  transform: scale(0.95);
}

.wali-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 16px 12px;
  scrollbar-width: none;
  position: relative;
  z-index: 2;
  mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 22px), transparent);
}
.wali-strip::-webkit-scrollbar {
  display: none;
}
.wali-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 200px;
  height: 32px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  animation: rise 0.35s var(--ease-out) both;
}
.wali-pill .t {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wali-pill .k {
  font: 600 10px/1 var(--font);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ffc4d4;
}
.wali-pill.topic {
  background: rgba(255, 92, 138, 0.16);
  border-color: rgba(255, 92, 138, 0.4);
}
.wali-pill.news {
  color: #ffd98f;
  background: rgba(255, 200, 97, 0.1);
  border-color: rgba(255, 200, 97, 0.35);
}
/* Con un tema abierto, las novedades esperan: se ven quietas, en pausa. */
.wali-pill.news.held {
  opacity: 0.75;
  border-style: dashed;
}
.wali-pill .st {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--faint);
}
.wali-pill.st-run .st {
  background: hsl(var(--h) 95% 68%);
  box-shadow: 0 0 0 0 hsl(var(--h) 95% 68% / 0.6);
  animation: sess-ping 1.8s var(--ease-out) infinite;
}
.wali-pill.st-queue .st {
  background: transparent;
  border: 1.5px solid var(--sky);
}
.wali-pill.st-news .st {
  background: #ffc861;
}
.wali-pill.st-wait .st {
  background: #ffc861;
  opacity: 0.6;
}
.wali-pill.st-done .st {
  background: var(--teal);
}
@keyframes sess-ping {
  0% {
    box-shadow: 0 0 0 0 hsl(var(--h) 95% 68% / 0.6);
  }
  80%,
  100% {
    box-shadow: 0 0 0 7px hsl(var(--h) 95% 68% / 0);
  }
}

.msg.notice {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 92%;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: #ffd98f;
  background: rgba(255, 200, 97, 0.08);
  border: 1px solid rgba(255, 200, 97, 0.25);
}
.msg.user.from-wali {
  background: linear-gradient(135deg, rgba(255, 92, 138, 0.24), rgba(209, 50, 95, 0.12));
  border-color: rgba(255, 92, 138, 0.35);
}
.from-label {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
  font: italic 400 16px/1 var(--display);
  color: #ffc4d4;
}
.banner.banner-wali {
  background: rgba(255, 92, 138, 0.1);
}
.banner a {
  color: #ffc4d4;
  font-weight: 600;
}
.hint-empty.padre-empty {
  padding-top: 14vh;
  font-style: normal;
}
.padre-empty p:first-of-type {
  font: 400 34px/1.1 var(--display);
  color: var(--text);
  margin: 0 0 10px;
}
.padre-empty em {
  background: linear-gradient(100deg, #ffe6ec, #ff86a8 50%, var(--teal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.padre-empty .muted {
  font: 15px/1.5 var(--font);
  max-width: 300px;
  margin: 0 auto;
}
@media (prefers-reduced-motion: reduce) {
  .wali-hero::before,
  .wali-orb .halo,
  .wali-orb .sats,
  .wali-orb .core {
    animation: none;
  }
}

/* Mantener apretada una tarjeta abre sus opciones: sin la burbuja ni la selección de texto de iOS. */
.conv {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* ---------- lectura en voz alta (reading.js): el texto se revela al ritmo de la voz ---------- */
/* Lo que todavía no se leyó, atenuado pero legible (5,3:1 sobre el fondo). */
::highlight(wv-unread) {
  color: #8c7d78;
}
.msg.claude.rd-on {
  position: relative;
}
.msg.claude > .rd-mark + * {
  margin-top: 0;
}
/* Hasta dónde se escuchó: una raya fina sobre el texto, que no empuja nada. */
.rd-mark {
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  margin-left: 1px;
  border-radius: 2px;
  background: var(--sky);
  box-shadow: 0 0 0 3px rgba(255, 166, 107, 0.16);
  pointer-events: none;
}
.rd-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 34px;
  margin-top: -6px;
  font-size: 13px;
  line-height: 1.3;
  color: var(--muted);
  overflow: hidden;
  transition:
    opacity 0.25s var(--ease-out),
    min-height 0.3s var(--ease-out),
    margin 0.3s var(--ease-out);
}
.rd-foot.rd-gone {
  opacity: 0;
  min-height: 0;
  margin-top: -14px;
}
.rd-live,
.rd-cut-txt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.rd-live::before {
  content: '';
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sky);
  animation: rd-pulse 1.4s ease-in-out infinite;
}
.rd-cut-txt::before {
  content: '';
  flex: none;
  width: 2px;
  height: 14px;
  border-radius: 2px;
  background: var(--sky);
}
.rd-more {
  flex: none;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 17px;
  border: 1px solid rgba(255, 166, 107, 0.35);
  background: rgba(255, 166, 107, 0.12);
  color: var(--ice);
  font: 600 13px var(--font);
}
.rd-more:active {
  background: rgba(255, 166, 107, 0.22);
}
.rd-more:disabled {
  opacity: 0.6;
}
@keyframes rd-pulse {
  50% {
    opacity: 0.35;
  }
}
@media (prefers-reduced-motion: reduce) {
  .rd-live::before {
    animation: none;
  }
  .rd-foot {
    transition: none;
  }
}

/* ---------- notas de voz ---------- */
/* Con el cuadro vacío está el micrófono; al escribir o adjuntar, la flecha toma su lugar. */
.act {
  position: relative;
  width: 38px;
  height: 38px;
  flex: none;
}
.act .send,
.mic-btn {
  position: absolute;
  inset: 0;
}
.mic-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted);
  transition:
    transform 0.3s var(--spring),
    opacity 0.2s;
}
.mic-btn:active {
  color: var(--text);
  background: var(--surface-2);
}
.has-text .mic-btn {
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}
.input-wrap:not(.has-text) .act .send {
  pointer-events: none;
}

/* Grabando: la barra ocupa todo el cuadro. */
.input-wrap.recording > :not(.rec-bar):not(.attach-tray) {
  display: none;
}
.input-wrap.recording {
  border-color: rgba(255, 77, 94, 0.45);
}
.rec-bar {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
}
.rec-bar[hidden] {
  display: none;
}
.rec-cancel {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.rec-cancel:active {
  color: var(--red);
  background: rgba(255, 77, 94, 0.12);
}
.rec-dot {
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 10px rgba(255, 77, 94, 0.8);
  animation: rec-blink 1.2s ease-in-out infinite;
}
@keyframes rec-blink {
  50% {
    opacity: 0.25;
  }
}
.rec-time {
  flex: none;
  font: 600 15px/1 var(--font);
  font-variant-numeric: tabular-nums;
  color: var(--text);
  min-width: 36px;
}
.rec-levels {
  flex: 1;
  min-width: 0;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  overflow: hidden;
}
.rec-levels i {
  flex: none;
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: var(--ice);
  opacity: 0.85;
  transform: scaleY(0.12);
  transition: transform 0.1s linear;
}
.rec-send {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
}
.rec-send:active {
  transform: scale(0.92);
}

/* La burbuja: reproductor arriba y lo que se transcribió debajo, más chico. */
.msg.user.has-voice {
  min-width: 220px;
}
.voice-note {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
}
.voice-note audio {
  display: none;
}
.vn-play {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
}
.vn-play:active {
  transform: scale(0.92);
}
.vn-track {
  position: relative;
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
}
.vn-track::before {
  content: '';
  position: absolute;
  inset: -14px 0;
}
.vn-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 2px;
  background: var(--ice);
}
.vn-time {
  flex: none;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  min-width: 30px;
  text-align: right;
}
.vn-text {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
}
.msg.user.voice-pending {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  white-space: normal;
}
.voice-pending .spark {
  width: 18px;
  height: 18px;
}
.voice-pending .vn-time {
  min-width: 0;
  text-align: left;
}
.voice-pending.failed {
  border-color: rgba(255, 77, 94, 0.45);
}
.voice-pending.failed .spark {
  display: none;
}
.vn-retry {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text);
  border: 1px solid var(--line);
}
@media (prefers-reduced-motion: reduce) {
  .rec-dot {
    animation: none;
  }
  .rec-levels i {
    transition: none;
  }
}

/* Bandera verde que Jani pone a mano: «ya estoy listo con esto». Sólo un recordatorio suyo. */
.conv-flag {
  display: none;
  flex: none;
  align-self: center;
  color: #4ade80;
}
.conv.is-flagged .conv-flag {
  display: inline-flex;
}
.flag-toggle {
  width: 100%;
  margin-top: 20px;
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.35);
}
.flag-toggle[aria-pressed='true'] {
  background: rgba(74, 222, 128, 0.12);
}

/* Pospuestas y programadas: cuándo vuelven, en el pie de la tarjeta; y en las opciones, los chips de días. */
.conv-when {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 500 12px var(--font);
  color: var(--ice);
}
.conv-when:empty {
  display: none;
}
.when-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.when-chip {
  height: 38px;
  font-family: var(--font);
}
.when-date {
  position: relative;
}
.when-date-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}
.later-now {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--ice);
  font-size: 14px;
}
.later-now > span {
  flex: 1;
  min-width: 0;
}
.later-task > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.later-text {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.later-undo {
  height: auto;
  flex: none;
  font-size: 13px;
  padding: 6px 10px;
}
.field.area {
  height: auto;
  min-height: 84px;
  padding: 14px 18px;
  margin-bottom: 10px;
  resize: none;
  line-height: 1.4;
}
.later-go {
  width: 100%;
  margin-top: 12px;
}

/* ---------- la compu: lista fija a la izquierda y la conversa a la derecha, como Claude Code ---------- */

body.desk-mode .aurora {
  opacity: 0.32;
}
.desk {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(300px, 340px) 1fr;
}
.side,
.pane {
  position: relative;
  min-width: 0;
  min-height: 0;
}
.side {
  border-right: 1px solid var(--line);
  background: rgba(17, 11, 11, 0.72);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
}
.desk .view {
  max-width: none;
}
.view.enter-fade {
  animation: fade-in 0.22s var(--ease-out) both;
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
.desk kbd,
.welcome kbd,
.composer-hint kbd {
  font: 500 11px/1 var(--font);
  color: var(--faint);
  padding: 3px 5px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.desk .list,
.desk .scroller {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}
.desk button:not(:disabled):hover {
  cursor: pointer;
}

/* La barra: marca, nueva conversa, buscador y el resumen. */
.side-head {
  padding: 14px 12px 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.side-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 0 6px;
}
.side-top .icon-btn {
  width: 34px;
  height: 34px;
  color: var(--muted);
}
.side-top .icon-btn:hover {
  color: var(--text);
  background: var(--surface);
}
.side-new,
.side-search {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 10px 0 12px;
  border-radius: 11px;
  font-size: 14px;
}
.side-new {
  width: 100%;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 130, 100, 0.32), rgba(232, 71, 58, 0.2));
  border: 1px solid rgba(255, 130, 100, 0.4);
  transition: background 0.2s;
}
.side-new:hover {
  background: linear-gradient(135deg, rgba(255, 130, 100, 0.42), rgba(232, 71, 58, 0.3));
}
.side-new span,
.side-search input {
  flex: 1;
  min-width: 0;
  text-align: left;
}
.side-search {
  color: var(--faint);
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: text;
  transition: border-color 0.2s;
}
.side-search:focus-within {
  border-color: rgba(255, 130, 100, 0.5);
}
.side-search input {
  border: 0;
  outline: none;
  background: none;
  color: var(--text);
  font: 14px var(--font);
}
.side-search input::-webkit-search-cancel-button {
  display: none;
}
.side-search input::placeholder {
  color: var(--faint);
}
.side-head .summary {
  font-size: 12.5px;
  padding: 2px 6px 0;
  color: var(--faint);
}

.desk .list {
  padding: 4px 8px 24px;
  mask-image: linear-gradient(transparent 0, #000 10px);
}
.desk .section-label {
  margin: 16px 6px 6px;
  font-size: 10.5px;
}
.desk .filters {
  flex-wrap: wrap;
  overflow: visible;
  margin: 2px 2px 8px;
  gap: 4px;
}
.desk .filter {
  height: 26px;
  padding: 0 9px;
  font-size: 12px;
  gap: 5px;
}
.desk .filter:hover {
  color: var(--text);
  border-color: var(--line-2);
}
.desk .filter-empty {
  font-size: 13px;
}
.desk .more {
  height: 36px;
  font-size: 13px;
  border-radius: 10px;
}
.desk .more:hover {
  color: var(--text);
  background: var(--surface);
}

/* Las conversas en la barra: filas compactas; la elegida con una raya a la izquierda. */
.desk .conv-swipe {
  margin-bottom: 3px;
  border-radius: 12px;
}
.desk .conv-swipe-bg {
  display: none;
}
.desk .conv {
  gap: 10px;
  padding: 9px 10px 9px 10px;
  border-radius: 12px;
  animation: none;
  transition: background 0.15s, filter 0.15s;
}
/* Sin estado, la fila es plana; trabajando, completada o esperando conservan su borde de color. */
:where(.desk) .conv {
  background: transparent;
  border-color: transparent;
}
.desk .conv.is-running {
  animation: border-spin 3.2s linear infinite;
}
.desk .conv.is-other {
  background: transparent;
  border-color: transparent;
}
.desk .conv.is-other:hover {
  background: var(--surface);
}
:where(.desk) .conv:not(.is-running, .is-done, .is-waiting):hover {
  background: var(--surface);
}
.desk .conv.is-running:hover,
.desk .conv.is-done:hover,
.desk .conv.is-waiting:hover {
  filter: brightness(1.3);
}
.desk .conv:active {
  transform: none;
}
:where(.desk) .conv.is-active:not(.is-running, .is-done, .is-waiting) {
  background-color: var(--surface-2);
  border-color: var(--line-2);
}
.desk .conv.is-active::before,
.desk .wali-hero.is-active::after {
  content: '';
  position: absolute;
  left: -5px;
  top: 50%;
  width: 3px;
  height: 22px;
  translate: 0 -50%;
  border-radius: 3px;
  background: var(--ice);
  box-shadow: 0 0 10px var(--sky);
}
.desk .conv.is-done,
.desk .conv.is-waiting {
  box-shadow: none;
}
.desk .conv-lead {
  width: auto;
  align-self: flex-start;
  margin-top: 1px;
}
.desk .avatar,
.desk .glyph {
  width: 30px;
  height: 30px;
}
.desk .glyph {
  border-radius: 9px;
}
.desk .glyph svg {
  width: 16px;
  height: 16px;
}
.desk .from-wali-badge,
.desk .branch-badge {
  transform: scale(0.8);
  transform-origin: bottom right;
}
.desk .conv-body {
  gap: 1px;
}
.desk .conv-top {
  align-items: center;
  gap: 6px;
}
.desk .conv-title {
  font-size: 14px;
}
.desk .conv-top .chip-cwd {
  flex: none;
  max-width: 84px;
  font-size: 9.5px;
  padding: 2px 5px;
}
.desk .conv-time {
  font-size: 11.5px;
}
.desk .conv-sub {
  font-size: 12.5px;
  -webkit-line-clamp: 1;
}
.desk .conv-foot {
  margin-top: 2px;
  font-size: 12px;
}
.desk .unread-dot {
  width: 8px;
  height: 8px;
  align-self: center;
}

/* Coral arriba de la barra, en chico. */
.desk .wali-hero {
  margin: 6px 0 2px;
  border-radius: 16px;
  animation: none;
}
.desk .wali-hero-main {
  gap: 10px;
  padding: 8px 54px 8px 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
.desk .wali-hero-main:hover {
  filter: brightness(1.2);
}
.desk .wali-hero-main:active {
  transform: none;
}
.desk .wali-orb {
  width: 50px;
  height: 50px;
}
.desk .wali-orb .core {
  inset: 7px;
}
.desk .wali-orb .sats i {
  width: 6px;
  height: 6px;
  margin: -3px;
  transform: rotate(var(--a)) translateX(25px);
}
.desk .wali-eyebrow {
  display: none;
}
.desk .wali-name {
  font-size: 26px;
  padding: 0 0 2px;
}
.desk .wali-line {
  font-size: 12.5px;
  -webkit-line-clamp: 1;
}
.desk .wali-sub {
  font-size: 11.5px;
}
.desk .wali-hero-call {
  width: 38px;
  height: 38px;
  right: 10px;
}
.desk .wali-hero-call svg {
  width: 17px;
  height: 17px;
}

/* La conversa: encabezado fino, texto en una columna cómoda de leer y el cuadro abajo, centrado. */
.pane .chat-head {
  padding: 10px 16px 10px 22px;
  gap: 8px;
  min-height: 58px;
  border-bottom: 1px solid var(--line);
  background: rgba(14, 10, 9, 0.55);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
body.call-min .pane .chat-head {
  padding-top: 58px;
}
.pane .chat-head > .icon-btn:first-child {
  display: none;
}
.pane .chat-title {
  text-align: left;
}
.pane .chat-title b {
  font-size: 15px;
}
.pane .padre-title {
  justify-content: flex-start;
}
.pane .chat-head .icon-btn:hover {
  background: var(--surface);
}
.pane .wali-strip {
  padding: 10px 22px;
  border-bottom: 1px solid var(--line);
  mask-image: none;
  flex-wrap: wrap;
}
.pane .scroller {
  padding: 28px 32px 28px;
}
.pane .scroller > * {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}
.pane .messages {
  gap: 18px;
}
.pane .msg.claude {
  font-size: 15.5px;
  line-height: 1.65;
}
.pane .msg.user {
  max-width: 78%;
  font-size: 15.5px;
}
.pane .msg-images img {
  cursor: zoom-in;
}
.pane .hint-empty {
  padding-top: 22vh;
}
.pane .composer {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 6px 32px 14px;
}
.pane .input-wrap,
.composer-hint {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}
.pane .input-wrap {
  min-height: 58px;
  border-radius: 18px;
  padding: 8px 8px 8px 8px;
  background: rgba(31, 22, 22, 0.9);
}
.pane .input-wrap textarea {
  font-size: 15.5px;
  max-height: 280px;
}
.composer-hint {
  display: flex;
  justify-content: space-between;
  padding: 0 10px;
  font-size: 11.5px;
  color: var(--faint);
}
.pane .chat.is-drop .input-wrap {
  border-color: var(--sky);
  box-shadow: 0 0 0 4px rgba(255, 166, 107, 0.18);
}
.pane .chat.is-drop .scroller {
  outline: 2px dashed rgba(255, 166, 107, 0.45);
  outline-offset: -12px;
  border-radius: 20px;
}
.pane .steps summary:hover {
  background: var(--surface-2);
}

/* Sin conversa abierta: el cuadro para empezar y los atajos. */
.welcome {
  overflow-y: auto;
  justify-content: center;
}
.welcome-in {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 32px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.welcome .empty-orb {
  width: 88px;
  height: 88px;
  margin: 0 0 22px;
}
.welcome-title {
  font: 400 46px/1.02 var(--display);
  letter-spacing: -0.012em;
  text-align: center;
  margin: 0 0 26px;
}
.welcome-title em {
  font-style: italic;
  background: linear-gradient(100deg, var(--ice), var(--blue) 60%, var(--sky));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.welcome-card {
  width: 100%;
  border-radius: 20px;
  background: rgba(31, 22, 22, 0.9);
  border: 1px solid var(--line-2);
  box-shadow: 0 30px 80px -40px rgba(255, 107, 87, 0.55);
  transition: border-color 0.2s;
}
.welcome-card:focus-within {
  border-color: rgba(255, 130, 100, 0.55);
}
.welcome-card textarea {
  display: block;
  width: 100%;
  min-height: 92px;
  resize: none;
  border: 0;
  outline: none;
  background: none;
  color: var(--text);
  font: 16px/1.5 var(--font);
  padding: 16px 18px 6px;
}
.welcome-card textarea::placeholder {
  color: var(--faint);
}
.welcome-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 10px 12px;
}
.welcome-bar .roots {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}
.welcome-bar .root {
  height: 30px;
  padding: 0 10px;
  font-size: 12.5px;
  gap: 6px;
}
.welcome-bar .root:hover {
  border-color: var(--line-2);
  color: var(--text);
}
.welcome-call {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
}
.welcome-call:hover {
  color: var(--text);
  background: var(--surface);
}
.welcome-card .send {
  transform: none;
  opacity: 0.35;
}
.welcome-card.has-text .send {
  opacity: 1;
}
.welcome-hint {
  margin: 12px 0 34px;
  font-size: 13px;
  color: var(--faint);
}
.shortcuts {
  display: grid;
  grid-template-columns: auto auto;
  gap: 9px 14px;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.shortcuts dt {
  text-align: right;
}
.shortcuts dd {
  margin: 0;
}

/* Las hojas del celu son ventanas centradas en la compu. */
body.desk-mode .sheet {
  top: 50%;
  bottom: auto;
  left: 50%;
  right: auto;
  width: min(560px, calc(100vw - 48px));
  max-height: 84vh;
  margin: 0;
  padding: 24px 28px 26px;
  border-radius: 24px;
  border: 1px solid var(--line-2);
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: translate(-50%, -47%) scale(0.97);
  transition:
    transform 0.28s var(--ease-out),
    opacity 0.2s ease;
}
body.desk-mode .sheet.open {
  opacity: 1;
  transform: translate(-50%, -50%);
}
body.desk-mode .grabber {
  display: none;
}
body.desk-mode .root:hover,
body.desk-mode .voice:hover {
  border-color: var(--line-2);
}
body.desk-mode #toasts {
  bottom: 110px;
}

/* Menú del clic derecho en la compu: chico, pegado al cursor, como los de escritorio. */
.ctx-menu {
  position: fixed;
  z-index: 200;
  min-width: 196px;
  padding: 5px;
  border-radius: 10px;
  background: rgba(38, 27, 27, 0.97);
  border: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.75);
  font-size: 13.5px;
  outline: none;
  opacity: 0;
  transform: scale(0.98);
  transform-origin: top left;
  transition: opacity 0.08s ease-out, transform 0.08s ease-out;
}
.ctx-menu.open {
  opacity: 1;
  transform: none;
}
.ctx-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 6px 9px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: default;
  outline: none;
}
.ctx-item > svg {
  flex: none;
  width: 15px;
  color: var(--muted);
}
.ctx-item > span {
  flex: 1;
}
.ctx-item:hover,
.ctx-item:focus-visible,
.ctx-item:focus,
.ctx-has-sub.sub-open {
  background: var(--blue-2);
}
.ctx-item:hover > svg,
.ctx-item:focus > svg,
.ctx-has-sub.sub-open > svg {
  color: var(--text);
}
.ctx-item.danger {
  color: #ff8a95;
}
.ctx-item.danger:hover,
.ctx-item.danger:focus {
  background: var(--red);
  color: #fff;
}
.ctx-sep {
  height: 1px;
  margin: 5px 6px;
  background: var(--line-2);
}
.ctx-sub {
  display: none;
  position: absolute;
  top: -6px;
  left: calc(100% + 4px);
  min-width: 150px;
  opacity: 1;
  transform: none;
}
.ctx-menu.sub-left .ctx-sub {
  left: auto;
  right: calc(100% + 4px);
}
.ctx-has-sub.sub-open > .ctx-sub {
  display: block;
}
/* Puente invisible sobre el hueco, para que el mouse llegue al submenú sin cerrarlo. */
.ctx-sub::before {
  content: '';
  position: absolute;
  inset: 0 -8px;
  z-index: -1;
}

/* Ramas: conversas que salieron de otra (una copia con lo conversado, o una hija con un encargo).
   Van en verde agua, para no confundirse con lo de Coral (rosa). */
.branch-badge {
  position: absolute;
  right: -3px;
  bottom: -3px;
  z-index: 2;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #06261f;
  background: linear-gradient(135deg, #9af3df, #2fbf9f);
  box-shadow: 0 0 0 2.5px var(--bg);
}
/* En la lista cuelgan de su conversa, corridas a la derecha, con una línea que las une. */
.conv-swipe.is-branch {
  margin-left: calc(var(--depth, 1) * 20px);
}
.conv-swipe.is-branch::before {
  content: '';
  position: absolute;
  left: -13px;
  top: -10px;
  width: 10px;
  height: calc(50% + 10px);
  border-left: 1.5px solid rgba(92, 225, 198, 0.45);
  border-bottom: 1.5px solid rgba(92, 225, 198, 0.45);
  border-bottom-left-radius: 10px;
  pointer-events: none;
}
.conv-swipe.is-branch.is-swiping::before {
  display: none;
}
.conv-branch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  font: 500 12px var(--font);
  color: var(--teal);
}
.conv-branch span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conv-branch svg {
  flex: none;
}
.conv-branch:empty {
  display: none;
}
.banner.banner-branch {
  background: rgba(92, 225, 198, 0.08);
  border-color: rgba(92, 225, 198, 0.3);
}
.banner.banner-branch svg {
  color: var(--teal);
}
.banner.banner-branch a {
  color: var(--teal);
}
.msg.user.from-branch {
  background: linear-gradient(135deg, rgba(92, 225, 198, 0.2), rgba(47, 191, 159, 0.08));
  border-color: rgba(92, 225, 198, 0.35);
}
.from-branch .from-label {
  color: var(--teal);
}
.wali-pill.branch-k {
  color: var(--teal);
  background: rgba(92, 225, 198, 0.1);
  border-color: rgba(92, 225, 198, 0.35);
}
.wali-pill.branch-k .k {
  color: var(--teal);
}
.branch-btn {
  width: 100%;
  margin-top: 10px;
  color: var(--teal);
  border-color: rgba(92, 225, 198, 0.35);
}

/* Volviste a un punto anterior y todavía no mandaste nada: se puede deshacer. */
.banner.banner-rewind {
  background: rgba(255, 200, 97, 0.08);
  border-color: rgba(255, 200, 97, 0.3);
}
.banner.banner-rewind svg,
.banner.banner-rewind a {
  color: #ffd98f;
}

/* ---------- subagentes ---------- */
/* La fila en vivo: encabezado con cuántos trabajan y un chip por agente. */
.agents-bar {
  margin-top: 14px;
  animation: rise 0.35s var(--ease-out) both;
}
.agents-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  font: 600 14px var(--font);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
}
.agents-line > svg {
  color: var(--faint);
}
.agents-dots {
  display: inline-flex;
  gap: 5px;
}
.agents-dots .agent-dot {
  width: 8px;
  height: 8px;
}
.agent-meta:empty {
  display: none;
}
.agents-head {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px 8px;
  font: 600 14px var(--font);
  color: var(--text);
  cursor: pointer;
}
.agents-all {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-weight: 500;
  font-size: 13px;
  color: var(--muted);
}
.agent-chips {
  display: flex;
  gap: 8px;
}
.agent-chips > .agent-chip {
  flex: 1 1 0;
  min-width: 0;
}
.agent-chip,
.agent-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 9px 11px;
  border-radius: 14px;
  text-align: left;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  cursor: pointer;
  transition:
    background 0.2s,
    opacity 0.3s;
}
.agent-chip:active,
.agent-card:active {
  background: rgba(255, 255, 255, 0.07);
}
.agent-chip-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.agent-title {
  font: 600 13px/1.25 var(--font);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agent-act,
.agent-meta {
  font-size: 12px;
  line-height: 1.25;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agent-meta {
  font-family: var(--mono);
  font-size: 11px;
}
.agent-more {
  flex: none;
  min-width: 48px;
  min-height: 48px;
  border-radius: 14px;
  font: 600 14px var(--font);
  color: var(--ice);
  border: 1px dashed var(--line);
  cursor: pointer;
}
/* El punto: late mientras trabaja, verde agua listo, rojo si falló. */
.agent-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: hsl(var(--h) 95% 68%);
}
.st-running .agent-dot {
  box-shadow: 0 0 0 0 hsl(var(--h) 95% 68% / 0.6);
  animation: sess-ping 1.8s var(--ease-out) infinite;
}
.st-done .agent-dot {
  background: var(--teal);
}
.st-error .agent-dot {
  background: #ff7a7a;
}
.st-background .agent-dot {
  background: transparent;
  border: 1.5px solid var(--sky);
}
.agent-chip.st-done,
.agent-chip.st-background {
  opacity: 0.6;
}
/* En el historial: los agentes lanzados juntos van en un bloque. */
.agents-team {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: rise 0.4s var(--ease-out) both;
}
.agent-card {
  width: 100%;
}
.agent-card > svg {
  flex: none;
  color: var(--faint);
}
.agent-state {
  flex: none;
  font: 600 12px var(--font);
  color: var(--muted);
}
.agent-card.st-running .agent-state {
  color: var(--ice);
}
.agent-card.st-done .agent-state {
  color: var(--teal);
}
.agent-card.st-error .agent-state {
  color: #ff9a9a;
}
.agent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.agent-sheet h2 {
  font-size: 24px;
  line-height: 1.2;
}
.agent-report {
  margin-top: 14px;
  line-height: 1.55;
}
.agent-steps {
  margin-top: 16px;
}
.agent-steps summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}
/* En la lista: un satélite por agente trabajando alrededor del avatar. */
.agent-sats {
  position: absolute;
  inset: 0;
  pointer-events: none;
  animation: spin 12s linear infinite;
}
.agent-sats i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  margin: -3px;
  border-radius: 50%;
  background: hsl(var(--h) 95% 70%);
  box-shadow: 0 0 6px hsl(var(--h) 95% 60%);
  transform: rotate(var(--a)) translateX(28px);
}
.conv-agents {
  font: 600 12px var(--font);
  color: var(--ice);
}
.conv-agents:empty {
  display: none;
}

/* Arriba del cuadro: el resumen y, al lado, el avance de los pendientes. */
.dock {
  display: flex;
  gap: 8px;
  margin: 0 14px -2px;
}
/* El resumen de la conversa, fijo arriba del cuadro: dos líneas; tocarlo lo abre entero. */
.recap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  min-height: 36px;
  text-align: left;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
}
.recap svg {
  flex: none;
  margin-top: 2px;
  color: var(--ice);
}
.recap-txt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.recap[aria-expanded='true'] .recap-txt {
  -webkit-line-clamp: unset;
}

@media (prefers-reduced-motion: reduce) {
  .agent-sats,
  .st-running .agent-dot {
    animation: none;
  }
}

/* ---------- pendientes ---------- */
.todo-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-left: auto;
  padding: 0 12px;
  border-radius: 14px;
  font: 600 13px var(--mono);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  cursor: pointer;
}
/* El anillo se llena con lo hecho. */
.todo-ring {
  --p: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: conic-gradient(var(--teal) calc(var(--p) * 360deg), rgba(255, 255, 255, 0.12) 0);
  -webkit-mask: radial-gradient(closest-side, transparent 58%, #000 62%);
  mask: radial-gradient(closest-side, transparent 58%, #000 62%);
}
.todo-panel {
  display: none;
}
.todo-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.todo-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 15px;
}
.todo-head .muted {
  font: 500 12px var(--mono);
}
.todo-bar {
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.todo-bar i {
  display: block;
  height: 100%;
  background: var(--teal);
  border-radius: inherit;
  transition: width 0.4s var(--ease-out);
}
.todo-list {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.todo {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  border-radius: 10px;
  animation: rise 0.3s var(--ease-out) both;
}
.todo:not(.is-sub) + .todo:not(.is-sub),
.todo.is-sub + .todo:not(.is-sub) {
  margin-top: 6px;
}
.todo.is-sub {
  padding-left: 24px;
  min-height: 36px;
}
.todo-text {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 1.35;
  color: var(--text);
}
.todo:not(.is-sub) > .todo-text {
  font-weight: 600;
}
.todo.is-done > .todo-text {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.25);
}
/* El check: 44 px de área para el dedo, 20 de caja. */
.todo-check {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.todo-check::before {
  content: '';
  grid-area: 1 / 1;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1.5px solid var(--faint);
}
.todo-check svg {
  grid-area: 1 / 1;
  color: #06261f;
  z-index: 1;
}
.todo.is-done .todo-check::before {
  background: var(--teal);
  border-color: var(--teal);
}
.todo-x {
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--faint);
  border-radius: 8px;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.15s;
}
.todo:hover .todo-x,
.todo-x:focus-visible,
.todo-sheet .todo-x {
  opacity: 1;
}
.todo-add {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 12px;
  color: var(--muted);
  border: 1px dashed var(--line);
}
.todo-add-input {
  flex: 1;
  min-width: 0;
  font: 400 14px var(--font);
  color: var(--text);
  background: none;
  border: 0;
  outline: none;
}
.todo-empty {
  line-height: 1.5;
}
/* En la compu ancha, la lista vive en un panel a la derecha de la conversa. */
@media (min-width: 1180px) {
  .desk .view.chat.has-todos {
    padding-right: 320px;
  }
  .desk .view.chat.has-todos .todo-panel {
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    overflow-y: auto;
    padding: 22px 18px;
    border-left: 1px solid var(--line);
    background: rgba(10, 7, 8, 0.5);
  }
  .desk .view.chat.has-todos .todo-pill {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .todo,
  .todo-bar i {
    animation: none;
    transition: none;
  }
}

/* Esconder la lista de pendientes (opcional; por defecto se ve). */
.todo-head {
  gap: 8px;
}
.todo-head .muted {
  margin-left: auto;
}
.todo-hide {
  flex: none;
  width: 32px;
  height: 32px;
  margin: -6px -6px -6px 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--faint);
  cursor: pointer;
}
.todo-hide:hover {
  color: var(--text);
}
.todos-btn {
  color: var(--ice);
  border-color: var(--line);
}
.todo-toggle {
  display: none !important;
}
body.todos-off .todo-panel,
body.todos-off .todo-pill {
  display: none !important;
}
@media (min-width: 1180px) {
  body.todos-off .desk .view.chat.has-todos {
    padding-right: 0;
  }
  body.todos-off .desk .view.chat.has-todos .todo-toggle {
    display: grid !important;
  }
}
