/* ============================================================
   DrugReminder PWA - estilo HUD inspirado no Jarvis (Iron Man)
   ============================================================ */

/* Variaveis de tema. Mude aqui se quiser ajustar a paleta. */
:root {
  --bg-deep: #050a14;
  --bg-panel: #0a1628;
  --bg-card: rgba(15, 30, 55, 0.6);

  --cyan: #00d4ff;
  --cyan-dim: #4fc3f7;
  --cyan-glow: rgba(0, 212, 255, 0.4);

  --green: #00ff95;
  --amber: #ffaa00;
  --red: #ff4757;

  --text-bright: #e0f4ff;
  --text-muted: #6b8aa8;

  --border: rgba(0, 212, 255, 0.25);
  --border-active: rgba(0, 212, 255, 0.7);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Rajdhani', sans-serif;
  background: var(--bg-deep);
  color: var(--text-bright);
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

/* Brilho de fundo sutil */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at top, rgba(0, 212, 255, 0.08), transparent 60%),
    radial-gradient(ellipse at bottom, rgba(0, 212, 255, 0.05), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.hud {
  position: relative;
  min-height: 100dvh;
  width: min(100%, 920px);
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 20px 120px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  z-index: 1;
}

body.pairing-mode .reminders,
body.pairing-mode .app-footer {
  display: none;
}

/* ============================================================
   Cabecalho
   ============================================================ */
.hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.hud-top-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  min-width: 0;
}

.hud-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-family: 'Orbitron', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
}

.brand-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
  min-width: 0;
}

.brand-name {
  color: var(--text-bright);
  min-width: 0;
  overflow-wrap: anywhere;
}
.brand-accent { color: var(--cyan); text-shadow: 0 0 10px var(--cyan-glow); }

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse-dot 2s infinite;
}
.status-dot.offline {
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hud-clock {
  font-family: 'Orbitron', sans-serif;
  font-size: 22px;
  color: var(--cyan);
  text-shadow: 0 0 8px var(--cyan-glow);
  white-space: nowrap;
}

.audio-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(0, 212, 255, 0.05);
  cursor: pointer;
  user-select: none;
  min-width: 0;
}

.audio-toggle input {
  display: none;
}

.audio-toggle-label,
.audio-toggle-state {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  letter-spacing: 1.5px;
}

.audio-toggle-state {
  min-width: 26px;
  color: var(--red);
}

.audio-toggle-track {
  width: 44px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 71, 87, 0.18);
  border: 1px solid rgba(255, 71, 87, 0.35);
  position: relative;
  transition: all 160ms ease;
}

.audio-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 10px rgba(255, 71, 87, 0.4);
  transition: transform 160ms ease, background 160ms ease;
}

.audio-toggle input:checked + .audio-toggle-track {
  background: rgba(0, 255, 149, 0.18);
  border-color: rgba(0, 255, 149, 0.35);
}

.audio-toggle input:checked + .audio-toggle-track .audio-toggle-thumb {
  transform: translateX(22px);
  background: var(--green);
  box-shadow: 0 0 10px rgba(0, 255, 149, 0.4);
}

.patient-label {
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--text-muted);
  font-weight: 600;
}

.patient-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 22px;
  color: var(--cyan);
  letter-spacing: 1px;
}

.patient-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.4;
}

.pairing-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: 12px;
  box-shadow: 0 0 24px rgba(0, 212, 255, 0.16);
}

.pairing-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pairing-badge {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--cyan);
}

.pairing-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 20px;
  letter-spacing: 1px;
  color: var(--text-bright);
}

.pairing-copy {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.45;
}

.pairing-form {
  display: grid;
  gap: 12px;
}

.pairing-label {
  color: var(--text-muted);
  font-size: 14px;
  letter-spacing: 1px;
}

.pairing-input {
  width: 100%;
  border: 1px solid var(--border-active);
  border-radius: 10px;
  background: rgba(0, 212, 255, 0.06);
  color: var(--text-bright);
  padding: 16px 18px;
  font-family: 'Orbitron', sans-serif;
  font-size: 28px;
  letter-spacing: 3px;
  text-align: center;
  outline: none;
}

.pairing-input:focus {
  box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.22);
}

.pairing-submit {
  margin-top: 4px;
}

#audioUnlockCard {
  border-color: rgba(255, 170, 0, 0.45);
  box-shadow: 0 0 24px rgba(255, 170, 0, 0.12);
}

/* ============================================================
   Lista de lembretes
   ============================================================ */
.section-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  letter-spacing: 4px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 20px;
  font-weight: 500;
}

.title-bracket {
  color: var(--cyan);
  margin: 0 8px;
}

.pending-audio-hint {
  margin: -10px 0 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  letter-spacing: 1px;
}

.update-banner {
  margin: -4px 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid rgba(255, 170, 0, 0.35);
  border-radius: 12px;
  background: rgba(255, 170, 0, 0.08);
  color: #ffd37a;
  font-size: 15px;
}

.update-reload-button {
  width: auto;
  min-width: 220px;
  margin: 0;
  padding-inline: 18px;
}

.reminders-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.loading, .empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 16px;
  letter-spacing: 1px;
}

/* ============================================================
   Card de cada lembrete
   ============================================================ */
.reminder {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Estado: aguardando o paciente confirmar (status=sent) */
.reminder.active {
  border-color: var(--border-active);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.2),
              inset 0 0 20px rgba(0, 212, 255, 0.05);
}

/* Estado: atrasado (status=retrying ou ja passou da hora) */
.reminder.overdue {
  border-color: #ff4d5f;
  box-shadow: 0 0 22px rgba(255, 77, 95, 0.34);
  animation: pulse-overdue 2s infinite;
}

@keyframes pulse-overdue {
  0%, 100% { box-shadow: 0 0 22px rgba(255, 77, 95, 0.34); }
  50%      { box-shadow: 0 0 34px rgba(255, 77, 95, 0.62); }
}

/* Estado: ja tomado */
.reminder.taken {
  border-color: rgba(0, 255, 149, 0.4);
  opacity: 0.7;
}

.reminder-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.reminder-body {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.reminder-image-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.reminder-image {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border-active);
  background: rgba(0, 212, 255, 0.08);
  box-shadow: 0 0 18px rgba(0, 212, 255, 0.14);
}

.reminder-image.placeholder {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
  padding: 6px;
}

.reminder-content {
  min-width: 0;
}

.reminder-patient,
.reminder-medication,
.reminder-dosage,
.reminder-instructions {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.reminder-status {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  letter-spacing: 2px;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(0, 212, 255, 0.15);
  color: var(--cyan);
}

.reminder.overdue .reminder-status {
  background: rgba(255, 77, 95, 0.18);
  color: #ff6b7a;
}

.reminder.taken .reminder-status {
  background: rgba(0, 255, 149, 0.15);
  color: var(--green);
}

.reminder-time {
  font-family: 'Orbitron', sans-serif;
  font-size: 24px;
  color: var(--cyan);
  font-weight: 700;
  text-shadow: 0 0 8px var(--cyan-glow);
}

.reminder-medication {
  font-family: 'Orbitron', sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 4px;
  letter-spacing: 1px;
}

.reminder-patient {
  display: inline-flex;
  align-items: center;
  margin-bottom: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0, 212, 255, 0.14);
  border: 1px solid rgba(0, 212, 255, 0.34);
  color: var(--cyan);
  font-family: 'Orbitron', sans-serif;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  box-shadow: inset 0 0 18px rgba(0, 212, 255, 0.08), 0 0 18px rgba(0, 212, 255, 0.08);
}

.reminder-dosage {
  font-size: 18px;
  color: var(--cyan-dim);
  margin-bottom: 12px;
}

.reminder-instructions {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

/* ============================================================
   Botao "Ja tomei"
   ============================================================ */
.btn-taken {
  width: 100%;
  padding: 16px;
  font-family: 'Orbitron', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--cyan);
  background: rgba(0, 212, 255, 0.08);
  border: 2px solid var(--cyan);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
}

.btn-taken:hover:not(:disabled) {
  background: var(--cyan);
  color: var(--bg-deep);
  box-shadow: 0 0 30px var(--cyan-glow);
}

.btn-taken:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-taken:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================================
   Rodape com botao do microfone
   ============================================================ */
.hud-footer {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.agent-button {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-panel);
  border: 2px solid var(--cyan);
  color: var(--cyan);
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  box-shadow: 0 0 30px var(--cyan-glow),
              inset 0 0 20px rgba(0, 212, 255, 0.1);
  transition: all 0.2s ease;
}

.agent-button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 40px var(--cyan-glow),
              inset 0 0 30px rgba(0, 212, 255, 0.2);
}

.agent-button:active {
  transform: scale(0.95);
}

/* Anel pulsante ao redor do botao */
.mic-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid var(--cyan);
  opacity: 0.5;
  animation: ring-pulse 2.5s infinite;
}

@keyframes ring-pulse {
  0%   { transform: scale(1);   opacity: 0.6; }
  100% { transform: scale(1.4); opacity: 0;   }
}

.mic-icon {
  width: 28px;
  height: 28px;
}

.mic-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 9px;
  letter-spacing: 2px;
  font-weight: 700;
}

/* ============================================================
   Toasts (mensagens temporarias)
   ============================================================ */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
  pointer-events: none;
}

.toast {
  background: var(--bg-panel);
  border: 1px solid var(--cyan);
  border-radius: 6px;
  padding: 12px 20px;
  color: var(--text-bright);
  font-size: 15px;
  letter-spacing: 1px;
  box-shadow: 0 4px 20px var(--cyan-glow);
  animation: toast-in 0.3s ease;
}

.toast.success {
  border-color: var(--green);
  box-shadow: 0 4px 20px rgba(0, 255, 149, 0.3);
}

.toast.error {
  border-color: var(--red);
  box-shadow: 0 4px 20px rgba(255, 71, 87, 0.3);
}

.hidden {
  display: none !important;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0);     }
}

/* ============================================================
   Modos explicitos de layout
   ============================================================ */
body[data-layout='tablet'] .hud {
  width: 100%;
  max-width: 100%;
  padding: 20px 16px 112px;
  gap: 20px;
}

body[data-layout='tablet'] .hud-brand {
  font-size: 16px;
  letter-spacing: 1.4px;
}

body[data-layout='tablet'] .hud-clock {
  font-size: 19px;
}

body[data-layout='tablet'] .audio-toggle {
  padding: 7px 9px;
  gap: 6px;
}

body[data-layout='tablet'] .audio-toggle-label,
body[data-layout='tablet'] .audio-toggle-state {
  font-size: 10px;
  letter-spacing: 1.1px;
}

body[data-layout='tablet'] .audio-toggle-track {
  width: 40px;
  height: 20px;
}

body[data-layout='tablet'] .audio-toggle-thumb {
  width: 14px;
  height: 14px;
}

body[data-layout='tablet'] .audio-toggle input:checked + .audio-toggle-track .audio-toggle-thumb {
  transform: translateX(20px);
}

body[data-layout='tablet'] .reminder-medication {
  font-size: 23px;
}

body[data-layout='tablet'] .reminder-patient {
  font-size: 17px;
  letter-spacing: 1.2px;
}

body[data-layout='tablet'] .reminder-time {
  font-size: 21px;
}

body[data-layout='phone'] .hud {
  padding: 14px 12px 104px;
  gap: 18px;
}

body[data-layout='phone'] .hud-header {
  align-items: stretch;
  flex-direction: column;
  gap: 12px;
}

body[data-layout='phone'] .hud-brand {
  width: 100%;
  font-size: 14px;
  gap: 10px;
  letter-spacing: 1px;
}

body[data-layout='phone'] .hud-top-controls {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

body[data-layout='phone'] .hud-clock {
  font-size: 16px;
  text-align: right;
}

body[data-layout='phone'] .audio-toggle {
  width: 100%;
  padding: 6px 8px;
  gap: 6px;
}

body[data-layout='phone'] .audio-toggle-label,
body[data-layout='phone'] .audio-toggle-state {
  font-size: 9px;
  letter-spacing: 0.9px;
}

body[data-layout='phone'] .audio-toggle-track {
  width: 36px;
  height: 18px;
}

body[data-layout='phone'] .audio-toggle-thumb {
  top: 1px;
  left: 1px;
  width: 14px;
  height: 14px;
}

body[data-layout='phone'] .audio-toggle input:checked + .audio-toggle-track .audio-toggle-thumb {
  transform: translateX(18px);
}

body[data-layout='phone'] .pairing-card {
  padding: 16px;
}

body[data-layout='phone'] .pairing-title {
  font-size: 18px;
}

body[data-layout='phone'] .pairing-copy {
  font-size: 15px;
}

body[data-layout='phone'] .pairing-input {
  font-size: 22px;
  letter-spacing: 2px;
  padding: 14px 12px;
}

body[data-layout='phone'] .section-title {
  font-size: 12px;
  letter-spacing: 2.8px;
  margin-bottom: 14px;
}

body[data-layout='phone'] .pending-audio-hint {
  margin: -6px 0 14px;
  font-size: 13px;
}

body[data-layout='phone'] .update-banner {
  margin: -2px 0 14px;
  padding: 10px 12px;
  font-size: 13px;
}

body[data-layout='phone'] .update-reload-button {
  min-width: 0;
  width: 100%;
  padding-inline: 12px;
}

body[data-layout='phone'] .reminders-list {
  gap: 12px;
}

body[data-layout='phone'] .reminder {
  padding: 16px;
}

body[data-layout='phone'] .reminder-header {
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
}

body[data-layout='phone'] .reminder-status {
  font-size: 10px;
  letter-spacing: 1.4px;
  padding: 4px 8px;
}

body[data-layout='phone'] .reminder-time {
  font-size: 18px;
}

body[data-layout='phone'] .reminder-body {
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
}

body[data-layout='phone'] .reminder-image,
body[data-layout='phone'] .reminder-image.placeholder {
  width: 56px;
  height: 56px;
  border-radius: 10px;
}

body[data-layout='phone'] .reminder-image.placeholder {
  font-size: 9px;
  padding: 4px;
}

body[data-layout='phone'] .reminder-patient {
  display: flex;
  width: 100%;
  min-width: 0;
  margin-bottom: 10px;
  padding: 7px 10px;
  font-size: 14px;
  letter-spacing: 0.8px;
  line-height: 1.25;
}

body[data-layout='phone'] .reminder-medication {
  font-size: 18px;
  letter-spacing: 0.6px;
  line-height: 1.15;
  word-break: break-word;
}

body[data-layout='phone'] .reminder-dosage {
  font-size: 15px;
  margin-bottom: 10px;
}

body[data-layout='phone'] .reminder-instructions {
  font-size: 13px;
  margin-bottom: 12px;
  padding-top: 10px;
}

body[data-layout='phone'] .btn-taken {
  padding: 14px 12px;
  font-size: 13px;
  letter-spacing: 2px;
}

body[data-layout='phone'] .hud-footer {
  bottom: 16px;
}

body[data-layout='phone'] .agent-button {
  width: 72px;
  height: 72px;
}

/* ============================================================
   Responsivo tablet
   ============================================================ */
@media (max-width: 820px) {
  .hud {
    width: 100%;
    max-width: 100%;
    padding: 20px 16px 112px;
    gap: 20px;
  }

  .hud-brand {
    font-size: 16px;
    letter-spacing: 1.4px;
  }

  .hud-clock {
    font-size: 19px;
  }

  .audio-toggle {
    padding: 7px 9px;
    gap: 6px;
  }

  .audio-toggle-label,
  .audio-toggle-state {
    font-size: 10px;
    letter-spacing: 1.1px;
  }

  .audio-toggle-track {
    width: 40px;
    height: 20px;
  }

  .audio-toggle-thumb {
    width: 14px;
    height: 14px;
  }

  .audio-toggle input:checked + .audio-toggle-track .audio-toggle-thumb {
    transform: translateX(20px);
  }

  .reminder-medication {
    font-size: 23px;
  }

  .reminder-patient {
    font-size: 17px;
    letter-spacing: 1.2px;
  }

  .reminder-time {
    font-size: 21px;
  }
}

/* ============================================================
   Responsivo celular
   ============================================================ */
@media (max-width: 560px) {
  .hud {
    padding: 14px 12px 104px;
    gap: 18px;
  }

  .hud-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .hud-brand {
    width: 100%;
    font-size: 14px;
    gap: 10px;
    letter-spacing: 1px;
  }

  .hud-top-controls {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }

  .hud-clock {
    font-size: 17px;
  }

  .audio-toggle {
    padding: 6px 8px;
    gap: 6px;
  }

  .audio-toggle-label,
  .audio-toggle-state {
    font-size: 9px;
    letter-spacing: 0.9px;
  }

  .audio-toggle-track {
    width: 36px;
    height: 18px;
  }

  .audio-toggle-thumb {
    top: 1px;
    left: 1px;
    width: 14px;
    height: 14px;
  }

  .audio-toggle input:checked + .audio-toggle-track .audio-toggle-thumb {
    transform: translateX(18px);
  }

  .pairing-card {
    padding: 16px;
  }

  .pairing-title {
    font-size: 18px;
  }

  .pairing-copy {
    font-size: 15px;
  }

  .pairing-input {
    font-size: 22px;
    letter-spacing: 2px;
    padding: 14px 12px;
  }

  .section-title {
    font-size: 12px;
    letter-spacing: 2.8px;
    margin-bottom: 14px;
  }

  .pending-audio-hint {
    margin: -6px 0 14px;
    font-size: 13px;
  }

  .update-banner {
    margin: -2px 0 14px;
    padding: 10px 12px;
    font-size: 13px;
  }

  .update-reload-button {
    min-width: 0;
    width: 100%;
    padding-inline: 12px;
  }

  .reminders-list {
    gap: 12px;
  }

  .reminder {
    padding: 16px;
  }

  .reminder-header {
    align-items: center;
    margin-bottom: 10px;
  }

  .reminder-status {
    font-size: 10px;
    letter-spacing: 1.4px;
    padding: 4px 8px;
  }

  .reminder-time {
    font-size: 18px;
  }

  .reminder-body {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
  }

  .reminder-image,
  .reminder-image.placeholder {
    width: 56px;
    height: 56px;
    border-radius: 10px;
  }

  .reminder-image.placeholder {
    font-size: 9px;
    padding: 4px;
  }

  .reminder-patient {
    display: flex;
    width: 100%;
    min-width: 0;
    margin-bottom: 10px;
    padding: 7px 10px;
    font-size: 14px;
    letter-spacing: 0.8px;
    line-height: 1.25;
  }

  .reminder-medication {
    font-size: 18px;
    letter-spacing: 0.6px;
    line-height: 1.15;
    word-break: break-word;
  }

  .reminder-dosage {
    font-size: 15px;
    margin-bottom: 10px;
  }

  .reminder-instructions {
    font-size: 13px;
    margin-bottom: 12px;
    padding-top: 10px;
  }

  .btn-taken {
    padding: 14px 12px;
    font-size: 13px;
    letter-spacing: 2px;
  }

  .hud-footer {
    bottom: 16px;
  }

  .agent-button {
    width: 72px;
    height: 72px;
  }
}

@media (max-width: 380px) {
  .hud-top-controls {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .hud-clock {
    width: 100%;
    text-align: right;
  }
}

/* ============================================================
   Sali-IA visual refresh
   ============================================================ */
body.sali-theme {
  background:
    radial-gradient(circle at top left, rgba(168, 213, 186, 0.55), transparent 28%),
    linear-gradient(180deg, #fbf7f0 0%, #f6f2ea 100%);
  font-family: 'Inter', sans-serif;
  color: #4a4a4a;
}

body.sali-theme::before {
  background:
    radial-gradient(circle at top left, rgba(168, 213, 186, 0.55), transparent 26%),
    radial-gradient(circle at right bottom, rgba(235, 228, 214, 0.85), transparent 30%);
}

body.sali-theme .hud {
  width: min(100%, 1180px);
  max-width: 1180px;
  min-height: 100dvh;
  padding: 18px 20px 20px;
  gap: 14px;
}

body.sali-theme .hud-header {
  padding: 0;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

body.sali-theme .brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

body.sali-theme .brand-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.sali-theme .brand-logo {
  width: 120px;
  height: 84px;
  object-fit: contain;
}

body.sali-theme .hud-top-controls {
  gap: 12px;
}

body.sali-theme .connection-pill,
body.sali-theme .audio-toggle,
body.sali-theme .hud-clock {
  min-height: 48px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 25px rgba(94, 133, 105, 0.12);
}

body.sali-theme .connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  color: #2e6f4e;
  font-size: 15px;
  font-weight: 600;
}

body.sali-theme .connection-text {
  white-space: nowrap;
}

body.sali-theme .status-dot {
  width: 10px;
  height: 10px;
  box-shadow: none;
  background: #4caf6d;
}

body.sali-theme .status-dot.offline {
  background: #c65f5f;
  box-shadow: none;
}

body.sali-theme .audio-toggle {
  gap: 8px;
  padding: 0 14px;
  border: 0;
  color: #2e6f4e;
}

body.sali-theme .audio-toggle-label,
body.sali-theme .audio-toggle-state {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  letter-spacing: 0.06em;
}

body.sali-theme .audio-toggle-state {
  color: #2e6f4e;
}

body.sali-theme .audio-toggle-track {
  background: rgba(198, 95, 95, 0.14);
  border: 1px solid rgba(198, 95, 95, 0.18);
}

body.sali-theme .audio-toggle-thumb {
  background: #c65f5f;
  box-shadow: none;
}

body.sali-theme .audio-toggle input:checked + .audio-toggle-track {
  background: rgba(95, 175, 122, 0.2);
  border-color: rgba(95, 175, 122, 0.24);
}

body.sali-theme .audio-toggle input:checked + .audio-toggle-track .audio-toggle-thumb {
  background: #4caf6d;
  box-shadow: none;
}

body.sali-theme .hud-clock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  font-family: 'Nunito', sans-serif;
  font-size: 26px;
  color: #2e6f4e;
  text-shadow: none;
}

body.sali-theme .pairing-card {
  background: rgba(255, 255, 255, 0.94);
  border: 0;
  border-radius: 24px;
  box-shadow: 0 18px 40px rgba(63, 100, 77, 0.12);
}

body.sali-theme .pairing-title,
body.sali-theme .section-title,
body.sali-theme .reminder-medication,
body.sali-theme .time-pill,
body.sali-theme .btn-taken,
body.sali-theme .mic-label {
  font-family: 'Nunito', sans-serif;
}

body.sali-theme .pairing-title {
  color: #31513f;
}

body.sali-theme .pairing-copy,
body.sali-theme .pairing-label {
  color: #4a4a4a;
}

body.sali-theme .pairing-input {
  background: #f7fbf8;
  color: #31513f;
  border-color: rgba(95, 175, 122, 0.24);
}

body.sali-theme .reminders {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

body.sali-theme .app-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding-top: 6px;
  color: #7a877f;
  font-size: 11px;
  text-align: left;
  white-space: nowrap;
}

body.sali-theme .app-footer > span:first-child {
  flex: 1;
  min-width: 0;
}

body.sali-theme .reminders-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body.sali-theme .section-title {
  margin: 0;
  text-align: left;
  color: #2e6f4e;
  font-size: 24px;
  letter-spacing: 0;
  font-weight: 800;
}

body.sali-theme .title-bracket {
  display: none;
}

body.sali-theme .pending-audio-hint {
  margin: 0;
  margin-left: auto;
  text-align: right;
  font-size: 11px;
  color: #7a877f;
  flex-shrink: 0;
  white-space: nowrap;
}

body.pairing-mode .reminders-col-header {
  display: none;
}

body.sali-theme .reminders-col-header {
  display: grid;
  grid-template-columns: 130px 52px minmax(180px, 1fr) minmax(180px, 1fr) 90px 140px;
  gap: 0;
  padding: 0 20px 6px;
  flex-shrink: 0;
}

body.sali-theme .col-label {
  font-size: 10px;
  font-weight: 700;
  color: #9aaf9f;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 8px;
}

body.sali-theme .update-banner {
  margin: 0 0 12px;
  border: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  color: #8c6d39;
  box-shadow: 0 12px 28px rgba(87, 116, 92, 0.12);
}

body.sali-theme .reminders-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-content: start;
  overflow: auto;
  padding: 0 4px 16px;
}

body.sali-theme .loading,
body.sali-theme .empty-state {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(87, 116, 92, 0.12);
  color: #5c6c61;
}

body.sali-theme .reminder-group {
  border-radius: 16px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 4px;
}

body.sali-theme .reminder-group.g-overdue { background: rgba(198, 95, 95, 0.07); }
body.sali-theme .reminder-group.g-active  { background: rgba(95, 175, 122, 0.08); }
body.sali-theme .reminder-group.g-soon    { background: rgba(255, 255, 255, 0.55); }
body.sali-theme .reminder-group.g-later   { background: rgba(240, 239, 233, 0.55); }

body.sali-theme .group-sep {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 6px 4px;
}

body.sali-theme .group-sep-line {
  flex: 1;
  height: 1px;
}

body.sali-theme .g-overdue .group-sep-line { background: rgba(198, 95, 95, 0.22); }
body.sali-theme .g-active  .group-sep-line { background: rgba(95, 175, 122, 0.28); }
body.sali-theme .g-soon    .group-sep-line { background: rgba(95, 175, 122, 0.14); }
body.sali-theme .g-later   .group-sep-line { background: rgba(0, 0, 0, 0.08); }

body.sali-theme .group-sep-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

body.sali-theme .g-overdue .group-sep-label { color: #c65f5f; }
body.sali-theme .g-active  .group-sep-label { color: #2e6f4e; }
body.sali-theme .g-soon    .group-sep-label { color: #7a9f84; }
body.sali-theme .g-later   .group-sep-label { color: #9aaf9f; }

body.sali-theme .reminder {
  display: grid;
  grid-template-columns: 130px 52px minmax(180px, 1fr) minmax(180px, 1fr) 90px 140px;
  align-items: center;
  gap: 0;
  min-height: 58px;
  padding: 0 6px;
  border: 1.5px solid transparent;
  border-radius: 14px;
  box-shadow: 0 3px 12px rgba(87, 116, 92, 0.08);
  cursor: pointer;
}

body.sali-theme .g-overdue .reminder { background: rgba(255, 255, 255, 0.82); }
body.sali-theme .g-active  .reminder { background: rgba(255, 255, 255, 0.82); }
body.sali-theme .g-soon    .reminder { background: rgba(255, 255, 255, 0.75); }
body.sali-theme .g-later   .reminder { background: rgba(255, 255, 255, 0.60); }

body.sali-theme .reminder.active {
  border-color: rgba(95, 175, 122, 0.2);
  background: linear-gradient(90deg, rgba(244, 250, 246, 0.98), rgba(255, 255, 255, 0.96));
  outline: 0;
}

body.sali-theme .reminder.overdue {
  border-color: rgba(198, 95, 95, 0.22);
  background: linear-gradient(90deg, rgba(255, 247, 244, 0.98), rgba(255, 255, 255, 0.96));
  box-shadow: 0 3px 12px rgba(87, 116, 92, 0.08);
  animation: none;
}

body.sali-theme .reminder.taken {
  opacity: 0.6;
  border-color: transparent;
}

body.sali-theme .reminder:hover {
  box-shadow: 0 6px 20px rgba(87, 116, 92, 0.13);
  transform: translateX(1px);
}

body.sali-theme .reminder-cell {
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
}

body.sali-theme .reminder-header {
  display: none;
}

body.sali-theme .reminder-status {
  justify-content: center;
  flex-shrink: 0;
  border-radius: 999px;
  background: #f0efe9;
  color: #7d7d72;
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 0 12px;
  min-height: 40px;
  line-height: 1;
}

body.sali-theme .reminder.overdue .reminder-status {
  background: rgba(198, 95, 95, 0.14);
  color: #c65f5f;
  font-weight: 800;
}

body.sali-theme .reminder.active .reminder-status {
  background: rgba(95, 175, 122, 0.18);
  color: #2e6f4e;
}

body.sali-theme .reminder-time {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-height: 34px;
  min-width: auto;
  padding: 0 10px;
  border-radius: 999px;
  background: #f6f2ea;
  color: #2e6f4e;
  font-size: 16px;
  text-shadow: none;
  line-height: 1;
}

body.sali-theme .reminder-body {
  display: contents;
}

body.sali-theme .reminder-image-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
}

body.sali-theme .reminder-image-wrap.is-clickable {
  cursor: zoom-in;
}

body.sali-theme .reminder-image,
body.sali-theme .reminder-image.placeholder {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

body.sali-theme .reminder-image {
  border: 0;
  background: #f6f2ea;
  box-shadow: inset 0 0 0 1px rgba(95, 175, 122, 0.1);
}

body.sali-theme .reminder-image.placeholder {
  border: 0;
  background: #f6f2ea;
  color: #7a877f;
  font-size: 8px;
  text-align: center;
  padding: 4px;
}

/* ── Modal de detalhe do lembrete ── */
body.sali-theme .rdm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

body.sali-theme .rdm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 36, 28, 0.78);
  backdrop-filter: blur(5px);
}

body.sali-theme .rdm-panel {
  position: relative;
  z-index: 1;
  width: min(92vw, 780px);
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 28px 64px rgba(30, 60, 44, 0.32);
  padding: 28px 24px 24px;
}

body.sali-theme .rdm-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(46, 111, 78, 0.1);
  color: #2e6f4e;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
body.sali-theme .rdm-close:hover { background: rgba(46, 111, 78, 0.18); }

body.sali-theme .rdm-body {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  margin-top: 12px;
}

body.sali-theme .rdm-image-col {
  flex: 0 0 auto;
  width: min(44%, 280px);
  display: flex;
  align-items: center;
  justify-content: center;
}

body.sali-theme .rdm-img {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 16px;
  background: #f6f2ea;
}

body.sali-theme .rdm-img-placeholder {
  width: 100%;
  aspect-ratio: 1;
  max-height: 260px;
  border-radius: 16px;
  background: #f0ece2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9da89e;
  font-size: 0.85rem;
}

body.sali-theme .rdm-info-col {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

body.sali-theme .rdm-patient {
  display: inline-block;
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: 999px;
  background: #5faf7a;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body.sali-theme .rdm-medication {
  font-family: 'Nunito', sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  color: #1f4a30;
  margin: 0;
  line-height: 1.2;
}

body.sali-theme .rdm-dosage {
  font-size: 1.05rem;
  font-weight: 600;
  color: #2e6f4e;
  margin: 0;
}

body.sali-theme .rdm-instructions {
  font-size: 0.96rem;
  color: #4a4a4a;
  margin: 0;
  line-height: 1.5;
}

body.sali-theme .rdm-time {
  font-family: 'Nunito', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: #1f4a30;
  margin: 4px 0 0;
}

body.sali-theme .rdm-btn-taken {
  margin-top: 12px;
  width: 100%;
  padding: 16px;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 16px;
}

/* linha da lista clicável */
body.sali-theme article.reminder {
  cursor: pointer;
}
body.sali-theme article.reminder:hover {
  filter: brightness(1.04);
}

/* telas pequenas: empilhar imagem + info */
@media (max-width: 520px) {
  body.sali-theme .rdm-body {
    flex-direction: column;
    align-items: stretch;
  }
  body.sali-theme .rdm-image-col {
    width: 100%;
  }
  body.sali-theme .rdm-img,
  body.sali-theme .rdm-img-placeholder {
    max-height: 200px;
  }
}

body.sali-theme .reminder-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

body.sali-theme .reminder-patient {
  width: auto;
  max-width: 120px;
  margin-bottom: 0;
  padding: 0 11px;
  min-height: 28px;
  border-radius: 999px;
  border: 0;
  box-shadow: none;
  font-size: 11px;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.sali-theme .reminder-medication {
  margin-bottom: 0;
  color: #31513f;
  font-size: 17px;
  letter-spacing: 0;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.sali-theme .reminder-dosage {
  margin-bottom: 0;
  font-size: 12px;
  font-weight: 700;
  color: #2e6f4e;
  margin-top: 2px;
}

body.sali-theme .reminder-instructions {
  margin-bottom: 0;
  padding-top: 0;
  border-top: 0;
  font-size: 12px;
  line-height: 1.35;
  color: #4a4a4a;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 768px) {
  body.sali-theme .reminders-col-header {
    display: none;
  }

  body.sali-theme .reminder {
    grid-template-columns: 110px 44px minmax(0, 1fr) 96px;
    min-height: auto;
    padding: 10px 8px;
  }

  body.sali-theme .reminder-cell {
    padding: 0 6px;
  }

  body.sali-theme .reminder-image-wrap,
  body.sali-theme .reminder-image,
  body.sali-theme .reminder-image.placeholder {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }

  body.sali-theme .reminder-patient {
    max-width: 98px;
    min-height: 24px;
    font-size: 10px;
    padding: 0 9px;
  }

  body.sali-theme .reminder-medication {
    font-size: 14px;
  }

  body.sali-theme .reminder-dosage {
    font-size: 11px;
  }

  body.sali-theme .reminder-instructions {
    display: none;
  }

  body.sali-theme .reminder-time {
    font-size: 14px;
    padding: 0 8px;
    min-height: 30px;
  }

  body.sali-theme .btn-taken {
    font-size: 12px;
    height: 34px;
    min-height: 34px;
    padding: 0 10px;
  }
}

body.sali-theme .btn-taken {
  width: 100%;
  min-height: 40px;
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #4caf6d;
  color: #fff;
  font-size: 14px;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 16px rgba(95, 175, 122, 0.28);
  white-space: nowrap;
}

body.sali-theme .btn-taken:hover:not(:disabled) {
  background: #3d9e5f;
  color: #fff;
  box-shadow: 0 8px 20px rgba(95, 175, 122, 0.34);
}

body.sali-theme .btn-taken:disabled {
  background: rgba(95, 175, 122, 0.12);
  color: #5faf7a;
  box-shadow: none;
  cursor: default;
  font-size: 13px;
}

body.sali-theme .hud-footer {
  display: none;
}

body.sali-theme .top-agent-button {
  width: 82px;
  height: 82px;
  flex-shrink: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  background-image: none;
  box-shadow: none;
  color: #fff;
  isolation: isolate;
  padding: 0;
}

.agent-entry-glyph {
  width: 78px;
  height: 78px;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 4px 12px rgba(45, 106, 79, 0.45));
  animation: agent-logo-pulse 2.8s ease-in-out infinite;
  transform-origin: center;
  pointer-events: none;
  object-fit: contain;
}

@keyframes agent-logo-pulse {
  0%, 100% { transform: scale(1);    filter: drop-shadow(0 4px 12px rgba(45, 106, 79, 0.40)); }
  50%       { transform: scale(1.08); filter: drop-shadow(0 6px 20px rgba(45, 106, 79, 0.65)); }
}

.agent-entry-glyph path,
.agent-entry-glyph circle {
  vector-effect: non-scaling-stroke;
}

body.sali-theme .top-agent-button::after {
  content: none;
}

body.sali-theme .top-agent-button:hover,
body.sali-theme .top-agent-button:active {
  transform: none;
}

body.sali-theme .top-agent-button.is-disabled,
body.sali-theme .top-agent-button:disabled {
  background: linear-gradient(180deg, #bcc5bf, #9ea7a1);
  color: rgba(255, 255, 255, 0.82);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.14),
    0 10px 20px rgba(120, 128, 123, 0.18);
  cursor: not-allowed;
  animation: none;
}

body.sali-theme .top-agent-button.is-disabled::after,
body.sali-theme .top-agent-button:disabled::after {
  background: radial-gradient(circle, rgba(175, 181, 177, 0.42) 0%, rgba(160, 166, 162, 0.16) 44%, rgba(160, 166, 162, 0.03) 74%, transparent 100%);
  filter: blur(4px);
  animation: none;
  opacity: 0.5;
}

body.sali-theme .mic-ring {
  inset: -8px;
  border-color: rgba(95, 175, 122, 0.35);
  animation: none;
}

body.sali-theme .top-agent-button.is-disabled .mic-ring,
body.sali-theme .top-agent-button:disabled .mic-ring {
  border-color: rgba(177, 183, 179, 0.42);
  opacity: 0.55;
}

body.sali-theme .top-agent-button.is-disabled .agent-entry-glyph,
body.sali-theme .top-agent-button:disabled .agent-entry-glyph {
  animation: none;
  filter: grayscale(1) opacity(0.72);
}

body.sali-theme .mic-label {
  font-size: 10px;
  letter-spacing: 0.08em;
}

body.sali-theme .top-agent-button.is-recording::after {
  background:
    radial-gradient(circle, rgba(255, 135, 135, 0.82) 0%, rgba(214, 103, 103, 0.54) 28%, rgba(214, 103, 103, 0.22) 54%, rgba(214, 103, 103, 0.06) 74%, transparent 100%);
  animation: sali-mic-halo-recording 0.9s ease-in-out infinite;
}

body.sali-theme .top-agent-button.is-recording .agent-entry-glyph {
  animation: sali-agent-icon-recording 0.8s ease-in-out infinite;
}

body.sali-theme .top-agent-button.is-uploading::after {
  background:
    radial-gradient(circle, rgba(255, 225, 123, 0.82) 0%, rgba(239, 188, 48, 0.52) 28%, rgba(239, 188, 48, 0.2) 54%, rgba(239, 188, 48, 0.05) 74%, transparent 100%);
  animation: sali-mic-halo-uploading 1.4s ease-in-out infinite;
}

body.sali-theme .top-agent-button.is-uploading .agent-entry-glyph {
  animation: sali-agent-icon-uploading 1.2s ease-in-out infinite;
}

@keyframes sali-mic-halo {
  0%, 100% {
    transform: scale(0.94);
    opacity: 0.82;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
}

@keyframes sali-mic-halo-recording {
  0%, 100% {
    transform: scale(0.94);
    opacity: 0.86;
  }
  50% {
    transform: scale(1.26);
    opacity: 1;
  }
}

@keyframes sali-mic-halo-uploading {
  0%, 100% {
    transform: scale(0.95);
    opacity: 0.82;
  }
  50% {
    transform: scale(1.22);
    opacity: 0.94;
  }
}

@keyframes sali-agent-icon-float {
  0%, 100% {
    transform: translateY(0) rotate(-3deg) scale(1);
  }
  50% {
    transform: translateY(-4px) rotate(3deg) scale(1.06);
  }
}

@keyframes sali-agent-icon-recording {
  0%, 100% {
    transform: translateY(0) scale(1);
    filter: drop-shadow(0 10px 18px rgba(186, 60, 60, 0.22));
  }
  50% {
    transform: translateY(-3px) scale(1.1);
    filter: drop-shadow(0 12px 24px rgba(186, 60, 60, 0.36));
  }
}

@keyframes sali-agent-icon-uploading {
  0%, 100% {
    transform: translateY(0) rotate(-2deg) scale(1);
    filter: drop-shadow(0 10px 18px rgba(185, 142, 34, 0.22));
  }
  50% {
    transform: translateY(-3px) rotate(2deg) scale(1.08);
    filter: drop-shadow(0 12px 24px rgba(185, 142, 34, 0.34));
  }
}

body.sali-theme .toast {
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(87, 116, 92, 0.18);
  color: #31513f;
}

body.sali-theme .toast.success {
  box-shadow: 0 12px 28px rgba(95, 175, 122, 0.18);
}

body.sali-theme .toast.error {
  box-shadow: 0 12px 28px rgba(198, 95, 95, 0.18);
}

body.sali-theme[data-layout='tablet'] .hud,
body.sali-theme[data-layout='phone'] .hud {
  width: 100%;
  max-width: 100%;
}

body.sali-theme[data-layout='phone'] .hud {
  padding: 14px 12px 18px;
}

body.sali-theme[data-layout='phone'] .hud-header {
  flex-direction: column;
  align-items: stretch;
}

body.sali-theme[data-layout='phone'] .brand-block {
  justify-content: space-between;
}

body.sali-theme[data-layout='phone'] .brand-logo {
  width: 98px;
  height: 72px;
}

body.sali-theme[data-layout='phone'] .top-agent-button {
  width: 68px;
  height: 68px;
}

body.sali-theme[data-layout='phone'] .agent-entry-glyph {
  width: 30px;
  height: 30px;
}

body.sali-theme[data-layout='phone'] .hud-top-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

body.sali-theme[data-layout='phone'] .hud-clock {
  grid-column: span 2;
}

body.sali-theme[data-layout='phone'] .section-title {
  font-size: 20px;
}

body.sali-theme[data-layout='phone'] .app-footer {
  font-size: 10px;
  padding-top: 4px;
}

body.sali-theme[data-layout='phone'] .reminders-list {
  grid-template-columns: 1fr;
  gap: 12px;
}

body.sali-theme[data-layout='phone'] .reminder {
  min-height: 0;
  padding: 14px 14px 16px;
}

body.sali-theme[data-layout='phone'] .reminder-medication {
  font-size: clamp(1.35rem, 6.2vw, 1.7rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
}

body.sali-theme[data-layout='phone'] .reminder-header {
  gap: 10px;
}

body.sali-theme[data-layout='phone'] .reminder-status {
  min-height: 34px;
  padding: 0 10px;
  font-size: 11px;
}

body.sali-theme[data-layout='phone'] .reminder-time {
  min-height: 34px;
  min-width: 66px;
  padding: 0 10px;
  font-size: clamp(1.1rem, 5vw, 1.35rem);
}

body.sali-theme[data-layout='phone'] .reminder-body {
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

body.sali-theme[data-layout='phone'] .reminder-image,
body.sali-theme[data-layout='phone'] .reminder-image.placeholder {
  width: 48px;
  height: 48px;
  border-radius: 14px;
}

body.sali-theme[data-layout='phone'] .reminder-patient {
  margin-bottom: 8px;
  min-height: 28px;
  padding: 0 10px;
  font-size: clamp(0.76rem, 3.2vw, 0.9rem);
  letter-spacing: 0.03em;
}

body.sali-theme[data-layout='phone'] .reminder-dosage {
  margin-bottom: 6px;
  font-size: clamp(0.95rem, 4vw, 1.05rem);
}

body.sali-theme[data-layout='phone'] .reminder-instructions {
  font-size: clamp(0.88rem, 3.8vw, 0.98rem);
  line-height: 1.3;
}

body.sali-theme[data-layout='phone'] .btn-taken {
  min-height: 38px;
  font-size: 0.98rem;
  letter-spacing: 0.02em;
}

@media (max-width: 380px) {
  body.sali-theme[data-layout='phone'] .hud {
    padding: 12px 10px 16px;
  }

  body.sali-theme[data-layout='phone'] .top-agent-button {
    width: 60px;
    height: 60px;
  }

  body.sali-theme[data-layout='phone'] .brand-logo {
    width: 84px;
    height: 62px;
  }

  body.sali-theme[data-layout='phone'] .section-title {
    font-size: 18px;
  }

  body.sali-theme[data-layout='phone'] .pending-audio-hint {
    font-size: 0.9rem;
  }

  body.sali-theme[data-layout='phone'] .reminder {
    padding: 12px 12px 14px;
  }

  body.sali-theme[data-layout='phone'] .reminder-medication {
    font-size: clamp(1.15rem, 5.8vw, 1.45rem);
  }

  body.sali-theme[data-layout='phone'] .reminder-patient {
    font-size: 0.73rem;
  }

  body.sali-theme[data-layout='phone'] .reminder-time {
    min-width: 60px;
    font-size: 1rem;
  }

  body.sali-theme[data-layout='phone'] .btn-taken {
    min-height: 36px;
    font-size: 0.92rem;
  }
}

.voice-patient-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 0;
  margin-bottom: 0;
  color: #3f6a53;
}

.voice-patient-toggle {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #f7fbf7 0%, #edf6ef 100%);
  color: #4b7d5c;
  box-shadow: 0 12px 24px rgba(95, 132, 106, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}

.voice-patient-avatar,
.voice-patient-current-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.voice-patient-avatar-fallback,
.voice-patient-current-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4b7d5c;
}

.voice-patient-avatar-fallback svg,
.voice-patient-current-avatar-fallback svg {
  width: 21px;
  height: 21px;
}

.voice-patient-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 280px;
  max-width: min(86vw, 340px);
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 42px rgba(93, 121, 102, 0.18);
  display: grid;
  gap: 10px;
  z-index: 8;
}

.voice-patient-current {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f4fbf5 0%, #edf7ef 100%);
  border: 1px solid rgba(95, 175, 122, 0.14);
}

.voice-patient-current-avatar,
.voice-patient-current-avatar-fallback {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(180deg, #f7fbf7 0%, #edf6ef 100%);
  box-shadow: 0 10px 20px rgba(95, 132, 106, 0.12);
}

.voice-patient-current-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.voice-patient-current-copy strong {
  font-size: 0.94rem;
  color: #365847;
}

.voice-patient-current-copy span {
  color: #5f7868;
  font-size: 0.82rem;
  line-height: 1.35;
}

.voice-patient-popover label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #466a54;
}

.voice-patient-popover select {
  min-width: 0;
  width: 100%;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(79, 125, 92, 0.18);
  background: rgba(248, 251, 248, 0.96);
  color: #355a45;
  font: inherit;
}

.agent-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 12px;
}

.agent-screen-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(32, 49, 39, 0.34);
  backdrop-filter: blur(8px);
}

.agent-screen-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 680px);
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: clamp(10px, 1.4vw, 18px);
  border-radius: clamp(18px, 2vw, 28px);
  background: rgba(255, 252, 247, 0.96);
  box-shadow: 0 24px 60px rgba(92, 111, 94, 0.18);
  display: grid;
  gap: 12px;
}

.agent-screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.agent-screen-entry-glyph {
  width: clamp(36px, 5.6vw, 50px);
  height: clamp(36px, 5.6vw, 50px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  animation: sali-agent-icon-float 2.6s ease-in-out infinite;
  filter: drop-shadow(0 12px 24px rgba(82, 139, 100, 0.18));
  flex-shrink: 0;
  color: #4b7d5c;
}

.agent-screen-entry-glyph svg {
  width: 100%;
  height: 100%;
}

.agent-screen-brand-copy {
  display: grid;
  gap: 2px;
  color: #355947;
}

.agent-screen-brand-copy strong {
  font-family: "Nunito", sans-serif;
  font-size: clamp(0.82rem, 1.5vw, 0.98rem);
}

.agent-screen-eyebrow {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4c7f5f;
}

.agent-screen-close {
  border: 0;
  border-radius: 999px;
  padding: 9px 13px;
  background: linear-gradient(180deg, #f7fbf7 0%, #edf6ef 100%);
  color: #3f6a53;
  font: inherit;
  font-weight: 700;
}

.agent-screen-copy {
  display: grid;
  gap: 5px;
  color: #355947;
}

.agent-screen-copy h2 {
  margin: 0;
  font-family: "Nunito", sans-serif;
  font-size: clamp(0.95rem, 2.5vw, 1.48rem);
  line-height: 1.04;
}

.agent-screen-copy p {
  margin: 0;
  color: #68806f;
  line-height: 1.4;
  font-size: 0.88rem;
}

.agent-profiles-panel,
.agent-live-panel,
.agent-voice-panel {
  border: 1px solid rgba(88, 126, 99, 0.14);
  border-radius: 18px;
  background: #fffdf8;
  padding: clamp(10px, 1.5vw, 16px);
}

.agent-profiles-panel {
  display: grid;
  gap: 12px;
}

.agent-profiles-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.agent-profiles-head h3 {
  margin: 0;
  font-family: "Nunito", sans-serif;
  font-size: 0.92rem;
  color: #355947;
}

.agent-profiles-count {
  font-size: 0.76rem;
  color: #68806f;
}

.agent-profiles-callout {
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #f4fbf5 0%, #edf7ef 100%);
  border: 1px solid rgba(95, 175, 122, 0.14);
  display: grid;
  gap: 6px;
}

.agent-profiles-callout strong {
  color: #427f5b;
  font-size: 0.78rem;
}

.agent-profiles-callout p {
  margin: 0;
  color: #68806f;
  line-height: 1.45;
  font-size: 0.76rem;
}

.agent-profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 9px;
}

.agent-profiles-empty {
  padding: 22px 18px;
  border-radius: 18px;
  background: #f7fbf7;
  color: #68806f;
  text-align: center;
}

.agent-profile-card {
  border: 1px solid rgba(95, 132, 106, 0.12);
  border-radius: 16px;
  background: #fff;
  padding: 10px 8px;
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
  color: #2f4f3b;
  box-shadow: 0 14px 28px rgba(114, 129, 115, 0.08);
  min-width: 0;
}

.agent-profile-card.active {
  border-color: rgba(95, 175, 122, 0.38);
  background: linear-gradient(180deg, #fbfffb 0%, #f2fbf4 100%);
  box-shadow: 0 18px 36px rgba(95, 175, 122, 0.14);
}

.agent-profile-card strong {
  font-size: 0.8rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.agent-profile-card small {
  color: #68806f;
  font-size: 0.68rem;
  line-height: 1.2;
}

.agent-profile-avatar-wrap {
  width: 48px;
  height: 48px;
  position: relative;
}

.agent-profile-avatar,
.agent-profile-avatar-fallback {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.agent-profile-avatar {
  object-fit: cover;
  border: 2px solid rgba(95, 175, 122, 0.16);
}

.agent-profile-avatar-fallback {
  display: none;
  align-items: center;
  justify-content: center;
  color: #4b7d5c;
  background: linear-gradient(180deg, #f7fbf7 0%, #edf6ef 100%);
  box-shadow: 0 12px 24px rgba(95, 132, 106, 0.12);
}

.agent-profile-avatar-fallback.visible {
  display: inline-flex;
}

.agent-profile-avatar-fallback svg {
  width: 20px;
  height: 20px;
}

.agent-live-panel {
  display: grid;
  gap: 10px;
}

.agent-live-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.agent-live-badge,
.agent-live-state {
  font-size: 0.72rem;
  color: #5f7d69;
}

.agent-live-badge {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.agent-live-state {
  text-align: right;
}

.agent-transcript-window {
  min-height: 112px;
  padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fcfdfb 0%, #f3f8f4 100%);
  border: 1px solid rgba(95, 175, 122, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.agent-transcript-window.is-listening {
  background: linear-gradient(180deg, #f7fcf8 0%, #edf7ef 100%);
  border-color: rgba(95, 175, 122, 0.24);
}

.agent-transcript-window.is-uploading {
  background: linear-gradient(180deg, #fffaf0 0%, #fff4d8 100%);
  border-color: rgba(239, 188, 48, 0.26);
}

.agent-transcript-window.is-empty {
  background: linear-gradient(180deg, #fcfdfb 0%, #f7faf8 100%);
}

.agent-transcript-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #406350;
  max-width: 92%;
}

.agent-voice-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.agent-voice-copy {
  display: grid;
  gap: 6px;
}

.agent-voice-status {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e8f4ea;
  color: #427f5b;
  font-size: 0.76rem;
  font-weight: 700;
}

.agent-voice-copy p {
  margin: 0;
  max-width: 360px;
  color: #68806f;
  line-height: 1.35;
  font-size: 0.82rem;
}

.agent-voice-action {
  position: relative;
  min-width: 140px;
  padding: 12px 12px 11px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(180deg, #5faf7a 0%, #4f9e6c 100%);
  color: #fff;
  display: grid;
  justify-items: center;
  gap: 8px;
  box-shadow: 0 18px 36px rgba(79, 158, 108, 0.24);
}

.agent-voice-action svg {
  width: 24px;
  height: 24px;
  position: relative;
  z-index: 2;
}

.agent-voice-action span:last-child {
  position: relative;
  z-index: 2;
  font-weight: 700;
  font-size: 0.86rem;
}

.agent-voice-action-halo {
  position: absolute;
  inset: -16px;
  border-radius: 24px;
  background: radial-gradient(circle, rgba(119, 207, 148, 0.56) 0%, rgba(95, 175, 122, 0.2) 42%, transparent 76%);
  filter: blur(3px);
}

.agent-voice-action.is-recording .agent-voice-action-halo {
  background: radial-gradient(circle, rgba(255, 135, 135, 0.82) 0%, rgba(214, 103, 103, 0.28) 46%, transparent 76%);
}

.agent-voice-action.is-uploading .agent-voice-action-halo {
  background: radial-gradient(circle, rgba(255, 225, 123, 0.82) 0%, rgba(239, 188, 48, 0.28) 46%, transparent 76%);
}

.agent-voice-action:disabled {
  background: linear-gradient(180deg, #bcc5bf, #9ea7a1);
  box-shadow: 0 10px 20px rgba(120, 128, 123, 0.18);
  color: rgba(255, 255, 255, 0.82);
}

body.sali-theme[data-layout='tablet'] .agent-profiles-grid,
body.sali-theme[data-layout='phone'] .agent-profiles-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.sali-theme[data-layout='tablet'] .agent-screen-panel {
  width: min(100%, 680px);
}

body.sali-theme[data-layout='phone'] .agent-screen {
  padding: 8px;
}

body.sali-theme[data-layout='phone'] .agent-screen-panel {
  width: 100%;
  max-height: calc(100dvh - 16px);
  padding: 12px;
  border-radius: 18px;
}

body.sali-theme[data-layout='phone'] .agent-screen-header,
body.sali-theme[data-layout='phone'] .agent-voice-panel {
  flex-direction: column;
  align-items: stretch;
}

body.sali-theme[data-layout='phone'] .agent-screen-brand {
  width: 100%;
}

body.sali-theme[data-layout='phone'] .agent-screen-close {
  width: 100%;
}

body.sali-theme[data-layout='phone'] .agent-profiles-grid {
  grid-template-columns: 1fr;
}

body.sali-theme[data-layout='phone'] .agent-voice-action {
  width: 100%;
}

.agent-button.is-recording {
  background: linear-gradient(180deg, #e16464 0%, #c94545 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.18),
    0 0 24px rgba(225, 100, 100, 0.36),
    0 0 56px rgba(225, 100, 100, 0.28),
    0 20px 42px rgba(171, 76, 76, 0.34);
}

.agent-button.is-uploading {
  background: linear-gradient(180deg, #f0c24d 0%, #d9a92b 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.18),
    0 0 24px rgba(240, 194, 77, 0.34),
    0 0 56px rgba(240, 194, 77, 0.24),
    0 20px 42px rgba(181, 138, 35, 0.3);
}

.agent-button.is-recording .mic-ring,
.agent-button.is-uploading .mic-ring {
  opacity: 0.95;
  transform: scale(1.06);
}

.top-agent-button {
  animation: none;
}

.agent-button.is-recording {
  animation: mic-recording-pulse 0.9s ease-in-out infinite;
}

.agent-button.is-uploading {
  animation: mic-uploading-pulse 1.4s ease-in-out infinite;
}

@keyframes mic-idle-pulse {
  0%, 100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 18px 36px rgba(84, 170, 113, 0.18);
  }
  50% {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 22px 44px rgba(84, 170, 113, 0.28);
  }
}

@keyframes mic-recording-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 18px 36px rgba(191, 78, 78, 0.26);
  }
  50% {
    transform: scale(1.07);
    box-shadow: 0 24px 48px rgba(191, 78, 78, 0.4);
  }
}

@keyframes mic-uploading-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 18px 36px rgba(72, 149, 107, 0.22);
  }
  50% {
    transform: scale(1.04);
    box-shadow: 0 22px 42px rgba(72, 149, 107, 0.34);
  }
}

body.sali-theme[data-layout='phone'] .voice-patient-bar {
  justify-content: flex-end;
}

body.sali-theme[data-layout='phone'] .voice-patient-popover {
  min-width: 240px;
  right: 0;
}

.agent-screen-panel {
  width: calc(100vw - 24px);
  max-width: 980px;
  height: calc(100dvh - 24px);
  max-height: calc(100dvh - 24px);
  overflow: hidden;
  padding: clamp(14px, 2vw, 22px);
  border-radius: 28px;
  background: #060606;
  color: #f5f5f5;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: clamp(10px, 1.4vw, 16px);
}

.agent-screen-brand-copy,
.agent-screen-brand-copy strong,
.agent-screen-close,
.agent-live-state,
.agent-profiles-count,
.agent-profiles-strip-label,
.agent-call-help,
.agent-message-role,
.agent-voice-status {
  color: #f2f2f2;
}

.agent-screen-entry-glyph {
  color: #ffffff;
  filter: drop-shadow(0 10px 26px rgba(95, 175, 122, 0.18));
}

.agent-screen-eyebrow,
.agent-profiles-count,
.agent-live-state,
.agent-call-help,
.agent-message-role {
  color: rgba(255, 255, 255, 0.64);
}

.agent-screen-close {
  background: rgba(255, 255, 255, 0.08);
}

.agent-profiles-strip {
  display: grid;
  gap: 12px;
}

.agent-profiles-strip-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.agent-profiles-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  overflow: hidden;
  padding-bottom: 0;
}

.agent-profile-chip {
  border: 0;
  background: transparent;
  color: #ffffff;
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 78px;
  padding: 8px 4px;
}

.agent-profile-chip strong {
  font-size: 0.72rem;
  line-height: 1.15;
  font-weight: 700;
  text-align: center;
}

.agent-profile-chip .agent-profile-avatar-wrap {
  width: 52px;
  height: 52px;
}

.agent-profile-chip .agent-profile-avatar,
.agent-profile-chip .agent-profile-avatar-fallback {
  width: 52px;
  height: 52px;
}

.agent-profile-chip.active .agent-profile-avatar,
.agent-profile-chip.active .agent-profile-avatar-fallback {
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.12),
    0 0 28px rgba(95, 175, 122, 0.46),
    0 0 52px rgba(95, 175, 122, 0.24);
  transform: scale(1.04);
}

.agent-profile-chip.active strong {
  color: #8af4b2;
}

.agent-conversation-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.agent-conversation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.agent-conversation-list {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 12px;
  padding-right: 4px;
}

.agent-conversation-empty {
  color: rgba(255, 255, 255, 0.56);
  text-align: center;
  padding: 24px 12px;
  font-size: 0.9rem;
}

.agent-message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 84%;
}

.agent-message-user {
  justify-self: end;
  flex-direction: row-reverse;
}

.agent-message-assistant {
  justify-self: start;
}

.agent-message-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 50%;
}

.agent-message-content {
  display: grid;
  gap: 4px;
}

.agent-message-bubble {
  border-radius: 20px;
  padding: 12px 14px;
  font-size: 0.96rem;
  line-height: 1.45;
  backdrop-filter: blur(8px);
}

.agent-message-user .agent-message-bubble {
  background: rgba(255, 255, 255, 0.1);
  color: #f4f4f4;
}

.agent-message-assistant .agent-message-bubble {
  background: rgba(95, 175, 122, 0.18);
  color: #ffffff;
}

.agent-transcript-window {
  min-height: 84px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  text-align: left;
  justify-content: flex-start;
}

.agent-transcript-window.is-listening {
  background: rgba(95, 175, 122, 0.12);
  border-color: rgba(95, 175, 122, 0.28);
}

.agent-transcript-window.is-uploading {
  background: rgba(255, 210, 95, 0.12);
  border-color: rgba(255, 210, 95, 0.28);
}

.agent-transcript-text {
  max-width: 100%;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.95rem;
}

.agent-voice-status {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

.agent-voice-panel-call {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
}

.agent-call-help {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
}

.agent-voice-panel-call .agent-voice-action {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: clamp(126px, 16vw, 148px);
  height: clamp(126px, 16vw, 148px);
  min-width: clamp(126px, 16vw, 148px);
  min-height: clamp(126px, 16vw, 148px);
  padding: 14px 12px;
  gap: 8px;
  border-radius: 28px;
  background: linear-gradient(180deg, #5faf7a 0%, #4f9e6c 100%);
  color: #ffffff;
  box-shadow: 0 24px 46px rgba(38, 82, 54, 0.32);
  align-self: center;
  justify-self: end;
}

.agent-voice-panel-call .agent-voice-action .agent-voice-icon {
  width: clamp(28px, 3.2vw, 34px);
  height: clamp(28px, 3.2vw, 34px);
  display: block;
  flex-shrink: 0;
}

.agent-voice-panel-call .agent-voice-action #agentVoiceButtonLabel {
  display: block;
  text-align: center;
  line-height: 1.16;
  font-size: clamp(0.72rem, 1.1vw, 0.82rem);
  font-weight: 800;
  max-width: 96px;
}

.agent-voice-action-halo {
  inset: -10px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0%, rgba(95, 175, 122, 0.18) 52%, transparent 78%);
}

.agent-voice-panel-call .agent-voice-action.is-call-active {
  background: #ffffff;
  color: #111111;
}

.agent-voice-panel-call .agent-voice-action.is-recording {
  background: #d65353;
  color: #ffffff;
}

.agent-voice-panel-call .agent-voice-action.is-uploading {
  background: #f0c24d;
  color: #1f1f1f;
}

.agent-voice-panel-call .agent-voice-action .agent-voice-icon-close {
  display: none;
}

.agent-voice-panel-call .agent-voice-action.is-call-active .agent-voice-icon-close,
.agent-voice-panel-call .agent-voice-action.is-recording .agent-voice-icon-close,
.agent-voice-panel-call .agent-voice-action.is-uploading .agent-voice-icon-close {
  display: block;
}

.agent-voice-panel-call .agent-voice-action.is-call-active .agent-voice-icon-mic,
.agent-voice-panel-call .agent-voice-action.is-recording .agent-voice-icon-mic,
.agent-voice-panel-call .agent-voice-action.is-uploading .agent-voice-icon-mic {
  display: none;
}

.agent-voice-panel-call .agent-voice-action.is-disabled {
  background: #6f6f6f;
  color: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.18);
}

body.sali-theme[data-layout='phone'] .agent-screen-panel {
  width: 100%;
  max-height: calc(100dvh - 12px);
  padding: 14px 14px 16px;
}

body.sali-theme[data-layout='phone'] .agent-voice-panel-call {
  grid-template-columns: 1fr;
}

body.sali-theme[data-layout='phone'] .agent-voice-panel-call .agent-voice-action {
  width: 100%;
  min-width: 0;
  height: 74px;
  min-height: 74px;
  border-radius: 22px;
  flex-direction: row;
  justify-self: stretch;
}

body.sali-theme[data-layout='phone'] .agent-voice-panel-call .agent-voice-action #agentVoiceButtonLabel {
  max-width: none;
}

body.sali-theme[data-layout='tablet'] .agent-screen-panel,
body.sali-theme[data-layout='desktop'] .agent-screen-panel {
  width: calc(100vw - 24px);
  max-width: 980px;
  height: calc(100dvh - 24px);
  max-height: calc(100dvh - 24px);
}

body.sali-theme[data-layout='phone'] .agent-message {
  max-width: 92%;
}
