:root {
  --ink: #17212b;
  --muted: #667781;
  --line: #e3e8ea;
  --panel: #ffffff;
  --soft-panel: #f7f9fa;
  --whatsapp-deep: #075e54;
  --whatsapp: #008069;
  --whatsapp-bright: #00a884;
  --whatsapp-pale: #d9fdd3;
  --chat-bg: #efeae2;
  --commerce-yellow: #f8c800;
  --danger: #d9485f;
  --warning: #b26a00;
  --shadow: 0 24px 70px rgba(22, 39, 50, 0.22);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background:
    linear-gradient(180deg, var(--whatsapp-deep) 0 138px, #d9dedf 138px 100%),
    #d9dedf;
  color: var(--ink);
  overflow: hidden;
}

button,
textarea,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff;
  color: var(--whatsapp-deep);
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.svg-definitions {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.demo-stage {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px;
  position: relative;
}

.prototype-caption {
  position: absolute;
  top: 8px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  transform: translateX(-50%);
}

.prototype-caption span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #32d296;
  box-shadow: 0 0 0 4px rgba(50, 210, 150, 0.16);
}

.app-shell {
  width: min(1180px, 100%);
  height: min(860px, calc(100dvh - 64px));
  min-height: 650px;
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  overflow: hidden;
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

/* Información lateral */

.info-panel {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 30px 26px 24px;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(circle at 100% 0%, rgba(248, 200, 0, 0.12), transparent 35%),
    linear-gradient(180deg, #fff, #fbfcfc);
  overflow-y: auto;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 18px;
  background: #f5f7f8;
  box-shadow: inset 0 0 0 1px rgba(7, 94, 84, 0.08);
}

.brand-mark img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.eyebrow,
.brand-block h1,
.brand-block p {
  margin: 0;
}

.brand-block .eyebrow {
  margin-bottom: 3px;
  color: #8a6e00;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.brand-block h1 {
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.brand-block p:last-child {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.connection-card {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 24px 0 27px;
  padding: 13px 14px;
  border: 1px solid #d9eee8;
  border-radius: 12px;
  background: #f0faf7;
}

.status-dot,
.mobile-status-dot {
  display: inline-block;
  border-radius: 50%;
  background: var(--whatsapp-bright);
}

.status-dot {
  width: 10px;
  height: 10px;
  box-shadow: 0 0 0 5px rgba(0, 168, 132, 0.1);
}

.connection-card div {
  display: grid;
  gap: 2px;
}

.connection-card strong {
  color: #075e54;
  font-size: 13px;
}

.connection-card small {
  color: #568078;
  font-size: 11px;
}

.connection-card.is-offline {
  border-color: #f2d8dc;
  background: #fff4f5;
}

.connection-card.is-offline .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(217, 72, 95, 0.1);
}

.connection-card.is-offline strong {
  color: #a83248;
}

.connection-card.is-offline small {
  color: #9b6470;
}

.panel-section + .panel-section {
  margin-top: 27px;
}

.panel-label {
  margin: 0 0 10px;
  color: #86949c;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.source-list,
.verification-flow {
  padding: 0;
  margin: 0;
  list-style: none;
}

.source-list {
  display: grid;
  gap: 5px;
}

.source-list li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 11px;
  padding: 9px 7px;
  border-radius: 10px;
}

.source-list li:hover {
  background: #f4f6f7;
}

.source-monogram {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.source-monogram.commerce {
  background: var(--commerce-yellow);
  color: #111;
}

.source-monogram.republica {
  background: #eb1c2d;
  color: #fff;
}

.source-monogram.peruano {
  background: #273c76;
  color: #fff;
}

.source-list li > span:nth-child(2) {
  display: grid;
  gap: 2px;
}

.source-list strong {
  font-size: 13px;
}

.source-list small {
  color: var(--muted);
  font-size: 11px;
}

.source-list .verified {
  width: 17px;
  height: 17px;
  color: var(--whatsapp-bright);
  stroke-width: 2.5;
}

.flow-section {
  padding-top: 25px;
  border-top: 1px solid #edf0f1;
}

.verification-flow {
  display: grid;
  gap: 0;
}

.verification-flow li {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 55px;
}

.verification-flow li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 18px;
  top: 42px;
  width: 1px;
  height: 25px;
  background: #d7dedf;
}

.verification-flow li > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #dbe6e3;
  border-radius: 11px;
  background: #fff;
  color: var(--whatsapp);
}

.verification-flow li > span .icon {
  width: 18px;
  height: 18px;
}

.verification-flow div {
  display: grid;
  gap: 2px;
}

.verification-flow strong {
  font-size: 12px;
}

.verification-flow small {
  color: var(--muted);
  font-size: 10px;
}

.panel-disclaimer {
  margin: auto 0 0;
  padding-top: 26px;
  color: #849198;
  font-size: 10px;
  line-height: 1.5;
}

/* Chat */

.chat-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 66px minmax(0, 1fr) auto;
  background: var(--chat-bg);
}

.chat-header {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 16px;
  background: #f0f2f5;
  box-shadow: 0 1px 0 rgba(17, 27, 33, 0.09);
}

.chat-contact {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.contact-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: visible;
  border-radius: 50%;
  background: #fff;
}

.contact-avatar img {
  width: 39px;
  height: 39px;
  object-fit: contain;
  border-radius: 50%;
}

.contact-avatar > span {
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 10px;
  height: 10px;
  border: 2px solid #f0f2f5;
  border-radius: 50%;
  background: #25d366;
}

.chat-contact > div:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.chat-contact strong {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-contact small {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
}

.mobile-status-dot {
  width: 6px;
  height: 6px;
}

.header-action {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #54656f;
  cursor: pointer;
}

.header-action:hover,
.header-action:focus-visible {
  background: #e5e9eb;
  color: #27343b;
  outline: none;
}

.header-action .icon {
  width: 18px;
  height: 18px;
}

.header-action span {
  font-size: 11px;
  font-weight: 700;
}

.chat-wallpaper {
  min-height: 0;
  position: relative;
  overflow: hidden;
  background-color: var(--chat-bg);
  background-image:
    linear-gradient(rgba(239, 234, 226, 0.9), rgba(239, 234, 226, 0.9)),
    radial-gradient(circle at 8px 8px, rgba(68, 76, 78, 0.2) 1px, transparent 1.4px),
    radial-gradient(circle at 22px 24px, rgba(68, 76, 78, 0.14) 1px, transparent 1.4px);
  background-size: auto, 30px 30px, 42px 42px;
}

.chat-history {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px clamp(18px, 6vw, 70px) 24px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(84, 101, 111, 0.35) transparent;
  scrollbar-width: thin;
}

.chat-history::-webkit-scrollbar {
  width: 6px;
}

.chat-history::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background: rgba(84, 101, 111, 0.3);
}

.system-chip {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 390px;
  margin: 0 auto 5px;
  padding: 7px 10px;
  border-radius: 7px;
  background: #ffeecd;
  box-shadow: 0 1px 1px rgba(11, 20, 26, 0.08);
  color: #7a692b;
  font-size: 10px;
  line-height: 1.35;
  text-align: center;
}

.system-chip .icon {
  width: 14px;
  height: 14px;
}

.message-row {
  width: 100%;
  display: flex;
}

.bot-row {
  justify-content: flex-start;
}

.user-row {
  justify-content: flex-end;
}

.message-bubble {
  position: relative;
  max-width: min(620px, 86%);
  min-width: 94px;
  padding: 9px 10px 7px;
  border-radius: 8px;
  box-shadow: 0 1px 1px rgba(11, 20, 26, 0.13);
  font-size: 13px;
  line-height: 1.45;
  animation: bubble-in 180ms ease-out both;
}

.message-bubble::before {
  content: "";
  position: absolute;
  top: 0;
  width: 0;
  height: 0;
  border-style: solid;
}

.bot-bubble {
  border-top-left-radius: 2px;
  background: #fff;
}

.bot-bubble::before {
  left: -7px;
  border-width: 0 8px 9px 0;
  border-color: transparent #fff transparent transparent;
}

.user-bubble {
  border-top-right-radius: 2px;
  background: var(--whatsapp-pale);
}

.user-bubble::before {
  right: -7px;
  border-width: 0 0 9px 8px;
  border-color: transparent transparent transparent var(--whatsapp-pale);
}

@keyframes bubble-in {
  from { opacity: 0; transform: translateY(4px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.message-bubble p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-bubble p + p {
  margin-top: 7px;
}

.welcome-bubble {
  max-width: min(540px, 90%);
  padding: 12px 13px 8px;
}

.welcome-bubble .welcome-title {
  margin-bottom: 5px;
  color: #075e54;
  font-weight: 800;
}

.suggestion-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid #edf0f1;
}

.suggestion {
  padding: 6px 9px;
  border: 1px solid #cfe5df;
  border-radius: 999px;
  background: #f6fbfa;
  color: #087865;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.suggestion:hover,
.suggestion:focus-visible {
  border-color: #83c9b9;
  background: #eaf7f4;
  outline: none;
}

.message-meta {
  display: block;
  margin-top: 4px;
  color: #7c8b93;
  font-size: 9px;
  line-height: 1;
  text-align: right;
}

.delivery-ticks {
  margin-left: 1px;
  color: #53bdeb;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: -3px;
}

.voice-message {
  min-width: min(340px, 64vw);
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.voice-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--whatsapp);
  color: #fff;
}

.voice-avatar .icon {
  width: 17px;
  height: 17px;
}

.voice-message audio {
  width: 100%;
  height: 36px;
  accent-color: var(--whatsapp);
}

.voice-caption {
  margin-top: 6px !important;
  padding-top: 6px;
  border-top: 1px solid rgba(74, 117, 65, 0.13);
}

.loading-bubble {
  min-width: 230px;
  padding: 11px 13px;
}

.loading-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #075e54;
  font-weight: 750;
}

.loading-line .icon {
  width: 17px;
  height: 17px;
}

.loading-bubble small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.typing-dots {
  display: inline-flex;
  gap: 3px;
  margin-left: 1px;
}

.typing-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--whatsapp);
  animation: typing 1.1s ease-in-out infinite;
}

.typing-dots i:nth-child(2) { animation-delay: 0.14s; }
.typing-dots i:nth-child(3) { animation-delay: 0.28s; }

@keyframes typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}

.transcript-card {
  margin-bottom: 10px;
  padding: 9px 10px;
  border-left: 3px solid var(--whatsapp-bright);
  border-radius: 5px;
  background: #f2f6f7;
}

.transcript-card > span {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
  color: #587078;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.transcript-card .icon {
  width: 13px;
  height: 13px;
}

.transcript-card blockquote {
  margin: 0;
  color: #36474f;
  font-size: 12px;
  font-style: italic;
  white-space: pre-wrap;
}

.verdict {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  font-size: 13px;
}

.verdict .icon {
  width: 18px;
  height: 18px;
  stroke-width: 2.3;
}

.verdict-success { color: #08775d; }
.verdict-danger { color: #bd3048; }
.verdict-warning { color: #9b5c00; }
.verdict-neutral { color: #52646e; }

.result-explanation {
  color: #27343b;
  font-size: 12.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.retrieval-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 7px 8px;
  border-radius: 6px;
  background: #f1f8f6;
  color: #4d7068;
  font-size: 10px;
  font-weight: 700;
}

.retrieval-note .icon {
  width: 14px;
  height: 14px;
}

.evidence-disclosure {
  margin-top: 9px;
  border-top: 1px solid #e8ecee;
}

.evidence-disclosure > summary {
  min-height: 35px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 1px 5px;
  color: #087865;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.evidence-disclosure > summary::-webkit-details-marker {
  display: none;
}

.evidence-disclosure > summary .icon {
  width: 15px;
  height: 15px;
}

.evidence-chevron {
  margin-left: auto;
  color: #7b8c93;
  transition: transform 160ms ease;
}

.evidence-disclosure[open] .evidence-chevron {
  transform: rotate(180deg);
}

.evidence-list {
  display: grid;
  gap: 7px;
  padding: 4px 0 2px;
}

.evidence-card {
  padding: 9px 10px;
  border: 1px solid #e5eaec;
  border-radius: 7px;
  background: #fbfcfc;
}

.evidence-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  color: #829198;
  font-size: 9px;
}

.evidence-source {
  display: inline-flex;
  padding: 2px 6px;
  border-radius: 999px;
  background: #fff3c1;
  color: #745d00;
  font-weight: 850;
}

.evidence-title {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  color: #176b5e;
  font-size: 11.5px;
  font-weight: 750;
  line-height: 1.35;
  text-decoration: none;
}

a.evidence-title:hover,
a.evidence-title:focus-visible {
  color: #004d40;
  text-decoration: underline;
  outline: none;
}

.evidence-title .icon {
  width: 12px;
  height: 12px;
  margin-top: 2px;
}

.evidence-card p {
  margin-top: 5px;
  color: #687981;
  font-size: 10px;
  line-height: 1.4;
}

.evidence-state {
  display: inline-flex;
  margin-top: 6px;
  padding: 3px 6px;
  border-radius: 4px;
  background: #fff1da;
  color: #906000;
  font-size: 9px;
  font-weight: 750;
}

.toast {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 14px;
  max-width: calc(100% - 32px);
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(31, 44, 52, 0.94);
  box-shadow: 0 5px 20px rgba(11, 20, 26, 0.25);
  color: #fff;
  font-size: 11px;
  text-align: center;
  transform: translateX(-50%);
  animation: toast-in 160ms ease both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 5px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Compositor y audio */

.composer-shell {
  position: relative;
  z-index: 4;
  padding: 9px 11px 7px;
  border-top: 1px solid rgba(17, 27, 33, 0.08);
  background: #f0f2f5;
}

.composer {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: end;
  gap: 6px;
}

.composer textarea {
  width: 100%;
  min-height: 42px;
  max-height: 120px;
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: 21px;
  background: #fff;
  color: #26343b;
  font-size: 14px;
  line-height: 19px;
  outline: none;
  resize: none;
  scrollbar-width: thin;
}

.composer textarea::placeholder {
  color: #8696a0;
}

.composer textarea:focus {
  border-color: #b9ddd4;
  box-shadow: 0 0 0 2px rgba(0, 168, 132, 0.08);
}

.composer textarea:disabled {
  opacity: 0.7;
}

.composer-action,
.send-action,
.icon-button,
.record-cancel,
.stop-recording {
  border: 0;
  cursor: pointer;
}

.composer-action {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  color: #54656f;
}

.composer-action:hover,
.composer-action:focus-visible {
  background: #e2e6e8;
  color: #25333a;
  outline: none;
}

.composer-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.composer-action .icon {
  width: 22px;
  height: 22px;
}

.mic-action .icon {
  width: 21px;
  height: 21px;
}

.send-action {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--whatsapp);
  box-shadow: 0 2px 5px rgba(0, 128, 105, 0.28);
  color: #fff;
}

.send-action:hover,
.send-action:focus-visible {
  background: #006f5c;
  outline: 2px solid rgba(0, 128, 105, 0.2);
  outline-offset: 2px;
}

.send-action:disabled {
  cursor: wait;
  opacity: 0.55;
}

.send-action .icon {
  width: 20px;
  height: 20px;
  transform: translateX(1px);
}

.composer.is-busy .send-action .icon {
  animation: send-pulse 900ms ease-in-out infinite alternate;
}

@keyframes send-pulse {
  to { opacity: 0.45; transform: translateX(1px) scale(0.9); }
}

.composer-hint {
  margin: 5px 50px 0;
  color: #99a5ab;
  font-size: 9px;
  text-align: center;
}

.audio-preview {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 10px;
  margin: 0 48px 8px;
  padding: 9px 10px;
  border: 1px solid #dce5e6;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(11, 20, 26, 0.06);
}

.audio-preview-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e4f6f1;
  color: var(--whatsapp);
}

.audio-preview-icon .icon {
  width: 21px;
  height: 21px;
}

.audio-preview-content {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.audio-preview-content strong {
  font-size: 11px;
}

.audio-preview-content > span {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-preview-content audio {
  width: 100%;
  height: 30px;
  margin-top: 3px;
  accent-color: var(--whatsapp);
}

.icon-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  color: #6f7d84;
}

.icon-button:hover,
.icon-button:focus-visible {
  background: #fbe8eb;
  color: var(--danger);
  outline: none;
}

.icon-button .icon {
  width: 18px;
  height: 18px;
}

.recording-bar {
  min-height: 50px;
  display: grid;
  grid-template-columns: 38px 8px 45px minmax(90px, 1fr) auto 42px;
  align-items: center;
  gap: 9px;
  padding: 2px 4px;
}

.record-cancel,
.stop-recording {
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.record-cancel {
  width: 38px;
  height: 38px;
  background: transparent;
  color: var(--danger);
}

.record-cancel:hover,
.record-cancel:focus-visible {
  background: #fbe8eb;
  outline: none;
}

.record-cancel .icon {
  width: 19px;
  height: 19px;
}

.recording-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e53950;
  animation: recording-pulse 1s ease-in-out infinite alternate;
}

@keyframes recording-pulse {
  to { opacity: 0.28; }
}

#recordingTimer {
  color: #d4344d;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.recording-wave {
  height: 28px;
  display: flex;
  align-items: center;
  gap: 3px;
  overflow: hidden;
}

.recording-wave i {
  width: 3px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 3px;
  background: #65b7a7;
  animation: wave 900ms ease-in-out infinite alternate;
}

.recording-wave i:nth-child(2n) { animation-delay: -0.2s; }
.recording-wave i:nth-child(3n) { animation-delay: -0.45s; }
.recording-wave i:nth-child(4n) { animation-delay: -0.65s; }

@keyframes wave {
  0% { height: 5px; opacity: 0.5; }
  100% { height: 25px; opacity: 1; }
}

.recording-label {
  color: #718087;
  font-size: 10px;
}

.stop-recording {
  width: 42px;
  height: 42px;
  background: var(--whatsapp);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 128, 105, 0.25);
}

.stop-recording:hover,
.stop-recording:focus-visible {
  background: #006f5c;
  outline: 2px solid rgba(0, 128, 105, 0.18);
  outline-offset: 2px;
}

.stop-recording .icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Responsive */

@media (max-width: 920px) {
  body {
    overflow: auto;
    background: var(--chat-bg);
  }

  .demo-stage {
    min-height: 100dvh;
    display: block;
    padding: 0;
  }

  .prototype-caption,
  .info-panel {
    display: none;
  }

  .app-shell {
    width: 100%;
    height: 100dvh;
    min-height: 560px;
    display: block;
    border-radius: 0;
    box-shadow: none;
  }

  .chat-panel {
    height: 100dvh;
  }
}

@media (min-width: 921px) and (max-height: 713px) {
  body {
    overflow: auto;
  }

  .demo-stage {
    min-height: 640px;
    padding: 12px;
  }

  .prototype-caption {
    display: none;
  }

  .app-shell {
    height: calc(100dvh - 24px);
    min-height: 616px;
  }
}

@media (max-width: 620px) {
  .chat-panel {
    grid-template-rows: 62px minmax(0, 1fr) auto;
  }

  .chat-header {
    padding: 8px 10px;
  }

  .contact-avatar {
    width: 40px;
    height: 40px;
  }

  .contact-avatar img {
    width: 36px;
    height: 36px;
  }

  .header-action {
    width: 40px;
    padding: 0;
    justify-content: center;
  }

  .header-action span,
  .composer-hint {
    display: none;
  }

  .chat-history {
    padding: 14px 14px 20px;
  }

  .message-bubble {
    max-width: 91%;
    font-size: 13px;
  }

  .welcome-bubble {
    max-width: 94%;
  }

  .voice-message {
    min-width: min(275px, 70vw);
  }

  .composer-shell {
    padding: 7px max(7px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-left));
  }

  .composer {
    grid-template-columns: 38px minmax(0, 1fr) 42px;
    gap: 4px;
  }

  .composer-action {
    width: 38px;
    height: 42px;
  }

  .audio-preview {
    margin: 0 2px 7px;
  }

  .recording-bar {
    grid-template-columns: 36px 8px 43px minmax(55px, 1fr) 42px;
    gap: 6px;
  }

  .recording-label {
    display: none;
  }
}

@media (max-width: 370px) {
  .chat-contact small {
    max-width: 165px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .suggestion-list {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
