/* ========================================
   Cuida — versión personal
   Sistema de diseño calmado, claro, para adultos mayores.
   ======================================== */

:root {
  /* Marca */
  --cuida-green: #1B7A6E;
  --cuida-green-light: #2BA89A;
  --cuida-green-bg: #E8F5F2;
  --cuida-coral: #E07856;
  --cuida-coral-light: #F4B860;
  --cuida-red: #D9534F;

  /* Neutros */
  --ink: #1F2D2B;
  --ink-soft: #5C6B69;
  --ink-ghost: #94A3A0;
  --bg: #F7F9F8;
  --surface: #FFFFFF;
  --border: #E5ECEA;
  --border-strong: #D5DDDB;

  /* Tipografía */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Sombras suaves */
  --shadow-sm: 0 1px 2px rgba(31, 45, 43, 0.04), 0 1px 3px rgba(31, 45, 43, 0.06);
  --shadow-md: 0 4px 12px rgba(31, 45, 43, 0.06), 0 2px 4px rgba(31, 45, 43, 0.04);
  --shadow-lg: 0 12px 32px rgba(31, 45, 43, 0.08), 0 4px 12px rgba(31, 45, 43, 0.04);

  /* Espaciado */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
}

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

html { font-size: 17px; }

body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(ellipse at top right, rgba(43, 168, 154, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at top left, rgba(43, 168, 154, 0.04) 0%, transparent 50%),
    var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom);
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
p { margin: 0; }
button { font-family: inherit; }

/* ========================================
   CONTENEDOR PRINCIPAL — limita ancho en escritorio
   ======================================== */
main {
  max-width: 460px;
  margin: 0 auto;
  padding: 0 18px 32px;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 480px) {
  main {
    padding: 0 20px 40px;
  }
}

/* En desktop muy ancho, agregamos sombra sutil para que se vea "card" */
@media (min-width: 720px) {
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
      radial-gradient(ellipse at top right, rgba(43, 168, 154, 0.12) 0%, transparent 60%),
      radial-gradient(ellipse at bottom left, rgba(224, 120, 86, 0.05) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
  }
}

/* ========================================
   TOPBAR
   ======================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  padding-top: calc(14px + env(safe-area-inset-top));
  background: rgba(247, 249, 248, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  min-height: 60px;
}

/* En escritorio, centrar el contenido del topbar */
@media (min-width: 460px) {
  .topbar {
    padding-left: max(18px, calc((100% - 460px) / 2 + 18px));
    padding-right: max(18px, calc((100% - 460px) / 2 + 18px));
  }
}

.topbar__back {
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  margin-right: 4px;
}
.topbar__back:active { background: var(--bg); }

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

img.topbar__logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.topbar__title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--cuida-green);
}

/* Botón decorativo de persona (modo personal — ya no se usa) */
.topbar__person {
  background: var(--cuida-green-bg);
  border: none;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--cuida-green);
  cursor: pointer;
}
.topbar__person:active { background: #d5ebe6; }

.topbar__menu {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--cuida-green-bg);
  border: none;
  border-radius: 999px;
  padding: 8px 14px 8px 10px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--cuida-green);
  cursor: pointer;
  max-width: 50%;
}
.topbar__menu-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar__menu:active { background: #d5ebe6; }

/* ========================================
   SCREENS
   ======================================== */
.screen {
  padding: 20px 18px 80px;
  max-width: 640px;
  margin: 0 auto;
  animation: fade-in 0.25s ease-out;
}

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

.section-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 28px 0 14px;
}

/* ========================================
   HOME — HERO (saludo + corazón decorativo)
   ======================================== */
.hero {
  padding: 12px 0 4px;
  margin-bottom: 26px;
}
.hero__text {
  width: 100%;
}
.hero__hi {
  display: inline-block;
  color: var(--cuida-green);
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: 4px;
  border-bottom: 2px solid var(--cuida-green-light);
  padding-bottom: 4px;
}
.hero__title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-top: 14px;
}
.hero__title-1 { color: var(--ink); display: block; }
.hero__title-2 { color: var(--cuida-green); display: block; margin-top: 2px; }

@media (max-width: 380px) {
  .hero__title { font-size: 1.85rem; }
}

@media (min-width: 640px) {
  .hero__title { font-size: 2.6rem; }
}

/* Pregunta principal (clipboard + texto) */
.prompt-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 16px;
}
.prompt-row__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--cuida-green-bg);
  color: var(--cuida-green);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.prompt-row__text {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.quick-summary {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.summary-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.summary-card__icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  flex-shrink: 0;
}
.summary-card__icon--pressure { background: var(--cuida-green-bg); color: var(--cuida-green); }
.summary-card__icon--glucose { background: #FFEDE5; color: var(--cuida-coral); }
.summary-card__icon--meds { background: #FFF6E1; color: #B07A1A; }

.summary-card__info { flex: 1; min-width: 0; }
.summary-card__label {
  font-size: 0.82rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}
.summary-card__value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-top: 2px;
}
.summary-card__time {
  font-size: 0.85rem;
  color: var(--ink-ghost);
  margin-top: 2px;
}

/* ========================================
   DEVICE CARDS — estilo mock
   ======================================== */
.device-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.device-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 8px 16px 8px 8px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: var(--shadow-sm);
  font: inherit;
  overflow: hidden;
}
.device-card:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-md);
}

.device-card__image {
  width: 90px;
  height: 90px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.device-card--pressure .device-card__image { background: linear-gradient(135deg, #E8F5F2 0%, #D5EBE6 100%); }
.device-card--glucose .device-card__image  { background: linear-gradient(135deg, #FFEDE5 0%, #FFE0D2 100%); }
.device-card--meds .device-card__image     { background: linear-gradient(135deg, #FFF6E1 0%, #FFEDC5 100%); }

.device-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.device-card__text {
  flex: 1;
  min-width: 0;
}
.device-card__text h3 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.device-card__text p {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-top: 2px;
}

.device-card__arrow {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.device-card__arrow--pressure { background: var(--cuida-green-bg); color: var(--cuida-green); }
.device-card__arrow--glucose  { background: #FFEDE5; color: var(--cuida-coral); }
.device-card__arrow--meds     { background: #FFF6E1; color: #B07A1A; }

/* ========================================
   TRUST CHIP (datos protegidos)
   ======================================== */
.trust-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--cuida-green-bg);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-top: 20px;
}
.trust-chip__icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cuida-green);
  flex-shrink: 0;
}
.trust-chip__text { flex: 1; min-width: 0; }
.trust-chip__title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--cuida-green);
  line-height: 1.2;
}
.trust-chip__subtitle {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 2px;
}
.trust-chip__badge {
  color: var(--cuida-green);
  flex-shrink: 0;
}

/* ========================================
   ACTION GRID (botones de abajo, 2 columnas)
   ======================================== */
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.action-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  position: relative;
  transition: transform 0.12s ease, background 0.12s ease;
}
.action-card:active {
  transform: scale(0.98);
}
.action-card--history { background: #E8F5F2; border-color: #D5EBE6; }
.action-card--history:active { background: #D5EBE6; }
.action-card--report  { background: #F0E6F7; border-color: #DEC9EA; }
.action-card--report:active { background: #DEC9EA; }

.action-card__icon {
  flex-shrink: 0;
}
.action-card--history .action-card__icon { color: var(--cuida-green); }
.action-card--report .action-card__icon  { color: #8B5CB8; }

.action-card__text {
  flex: 1;
  min-width: 0;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.15;
  display: flex;
  flex-direction: column;
}
.action-card--history .action-card__text { color: var(--cuida-green); }
.action-card--report .action-card__text  { color: #6E3E97; }

.action-card__arrow {
  flex-shrink: 0;
}
.action-card--history .action-card__arrow { color: var(--cuida-green); }
.action-card--report .action-card__arrow  { color: #8B5CB8; }

/* ========================================
   LINK BUTTONS (legacy — usado en otras pantallas si quedó)
   ======================================== */
.link-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-top: 12px;
  cursor: pointer;
  font-size: 0.98rem;
  color: var(--cuida-green);
  font-weight: 500;
  text-align: left;
}
.link-button:active { background: var(--cuida-green-bg); }
.link-button svg { color: var(--cuida-green); flex-shrink: 0; }

/* ========================================
   BOTONES
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 22px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: -0.01em;
}

.btn--big {
  padding: 18px 24px;
  font-size: 1.1rem;
  width: 100%;
}

.btn--primary {
  background: var(--cuida-green);
  color: white;
  box-shadow: 0 4px 12px rgba(27, 122, 110, 0.25);
}
.btn--primary:active {
  background: #156058;
  transform: scale(0.98);
}

.btn--secondary {
  background: var(--surface);
  color: var(--cuida-green);
  border: 1.5px solid var(--cuida-green-bg);
}
.btn--secondary:active {
  background: var(--cuida-green-bg);
  transform: scale(0.98);
}

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

/* ========================================
   CAPTURE
   ======================================== */
.capture { padding-top: 8px; }
.capture__title {
  font-size: 1.5rem;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.capture__hint {
  color: var(--ink-soft);
  font-size: 1rem;
  margin-bottom: 20px;
  line-height: 1.5;
}

.capture__preview {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--surface);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 20px;
  position: relative;
}
.capture__preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.capture__placeholder {
  text-align: center;
  color: var(--ink-ghost);
  padding: 30px;
}
.capture__placeholder svg {
  color: var(--cuida-green-light);
  margin-bottom: 12px;
  opacity: 0.6;
}
.capture__placeholder p {
  font-size: 0.95rem;
}

/* ========================================
   CONFIRM
   ======================================== */
.confirm { padding-top: 8px; }
.confirm__title {
  font-size: 1.5rem;
  margin-bottom: 6px;
}
.confirm__hint {
  color: var(--ink-soft);
  margin-bottom: 24px;
}

.field {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 12px;
}
.field__label {
  font-size: 0.82rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
  margin-bottom: 6px;
}
.field__input {
  font-family: inherit;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  outline: none;
}
.field__input--text {
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0;
}
.field__unit {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.confirm__date {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 24px;
}
.confirm__date label {
  display: block;
  font-size: 0.82rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
  margin-bottom: 6px;
}
.confirm__date input {
  font-family: inherit;
  font-size: 1rem;
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  outline: none;
  color: var(--ink);
}

.confirm__actions {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px;
}

/* ========================================
   HISTORY
   ======================================== */
.history__title {
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.history__filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -18px 16px;
  padding: 0 18px 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.history__filters::-webkit-scrollbar { display: none; }

.chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.chip--active {
  background: var(--cuida-green);
  color: white;
  border-color: var(--cuida-green);
}

.history__list {
  display: grid;
  gap: 10px;
}

.history__day {
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-weight: 500;
  letter-spacing: 0.02em;
  margin: 14px 0 4px;
  text-transform: capitalize;
}
.history__day:first-child { margin-top: 0; }

.history-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}
.history-card__icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.history-card__icon--pressure { background: var(--cuida-green-bg); color: var(--cuida-green); }
.history-card__icon--glucose { background: #FFEDE5; color: var(--cuida-coral); }
.history-card__icon--meds { background: #FFF6E1; color: #B07A1A; }

.history-card__info { flex: 1; min-width: 0; }
.history-card__main {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.history-card__sub {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin-top: 2px;
}

.history__empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-ghost);
}
.history__empty p {
  font-size: 1rem;
  margin-top: 12px;
}

/* ========================================
   PATIENTS
   ======================================== */
.patients__title {
  font-size: 1.5rem;
  margin-bottom: 6px;
}
.patients__hint {
  color: var(--ink-soft);
  margin-bottom: 20px;
}
.patients__list { display: grid; gap: 10px; margin-bottom: 16px; }

.patient-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  width: 100%;
}
.patient-card--active {
  border-color: var(--cuida-green);
  background: var(--cuida-green-bg);
}
.patient-card__avatar {
  width: 44px;
  height: 44px;
  background: var(--cuida-green);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.patient-card__info { flex: 1; }
.patient-card__name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}
.patient-card__meta {
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.patient-card__check { color: var(--cuida-green); }

/* ========================================
   LOADER
   ======================================== */
.loader {
  position: fixed;
  inset: 0;
  background: rgba(31, 45, 43, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(4px);
}
.loader__box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px 40px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  min-width: 240px;
}
.loader__spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--cuida-green-bg);
  border-top-color: var(--cuida-green);
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader__text {
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 500;
}

/* ========================================
   TOAST
   ======================================== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: white;
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  z-index: 300;
  box-shadow: var(--shadow-lg);
  max-width: 90%;
  text-align: center;
  animation: toast-in 0.25s ease-out;
}
.toast--error { background: var(--cuida-red); }
.toast--success { background: var(--cuida-green); }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ========================================
   MODAL
   ======================================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(31, 45, 43, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 250;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal__box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}
.modal__box h3 {
  font-size: 1.2rem;
  margin-bottom: 16px;
}
.modal__box label {
  display: block;
  font-size: 0.88rem;
  color: var(--ink-soft);
  font-weight: 500;
  margin-bottom: 16px;
}
.modal__box input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  outline: none;
}
.modal__box input:focus { border-color: var(--cuida-green); }
.modal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

/* ========================================
   ACCESIBILIDAD
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Pantallas más grandes (tablets) */
@media (min-width: 640px) {
  .device-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .greeting__name { font-size: 2rem; }
}

/* ========================================
   FIX: el atributo `hidden` debe ganarle al display:flex
   ======================================== */
[hidden] {
  display: none !important;
}

/* ========================================
   CHOOSE CAPTURE METHOD (nuevo)
   ======================================== */
.choose { padding-top: 8px; }
.choose__title {
  font-size: 1.5rem;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.choose__hint {
  color: var(--ink-soft);
  font-size: 1rem;
  margin-bottom: 24px;
  line-height: 1.5;
}

.method-card {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 12px;
  cursor: pointer;
  text-align: left;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: var(--shadow-sm);
  font: inherit;
}
.method-card:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-md);
}

.method-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.method-card__icon--camera { background: var(--cuida-green-bg); color: var(--cuida-green); }
.method-card__icon--gallery { background: #FFEDE5; color: var(--cuida-coral); }
.method-card__icon--manual { background: #FFF6E1; color: #B07A1A; }

.method-card__text { flex: 1; min-width: 0; }
.method-card__text h3 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.method-card__text p {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-top: 2px;
}
.method-card__arrow {
  color: var(--ink-ghost);
  flex-shrink: 0;
}

/* ========================================
   HISTORY CARD AHORA ES CLICKABLE
   ======================================== */
.history-card {
  cursor: pointer;
  transition: transform 0.1s ease, background 0.1s ease;
}
.history-card:active {
  transform: scale(0.985);
  background: var(--cuida-green-bg);
}
.history-card__chevron {
  color: var(--ink-ghost);
  flex-shrink: 0;
}

/* ========================================
   BOTÓN ELIMINAR
   ======================================== */
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  color: var(--cuida-red);
  border: 1.5px solid #F8D7D6;
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
  font-family: inherit;
}
.btn-danger:active {
  background: #FFF1F0;
  transform: scale(0.98);
}

.btn--danger-solid {
  background: var(--cuida-red);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 22px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.btn--danger-solid:active {
  background: #B83F3C;
  transform: scale(0.98);
}

/* ========================================
   TOPBAR SPACER (cuando se oculta el chip)
   ======================================== */
.topbar__spacer { display: inline-block; width: 40px; }

/* ========================================
   FIX: SVG e imágenes nunca deben atrapar clicks dentro de botones
   ======================================== */
button svg,
button img,
.device-card *,
.action-card *,
.method-card *,
.history-card * {
  pointer-events: none;
}

/* Restaurar pointer-events para inputs dentro de tarjetas (por si acaso) */
.device-card input,
.action-card input,
.method-card input {
  pointer-events: auto;
}

/* ========================================
   CTA PYMEAPPS (lead capture)
   ======================================== */
.pymeapps-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #1B7A6E 0%, #2BA89A 100%);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-top: 18px;
  text-decoration: none;
  color: white;
  box-shadow: 0 4px 14px rgba(27, 122, 110, 0.25);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.pymeapps-cta:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(27, 122, 110, 0.2);
}
.pymeapps-cta__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pymeapps-cta__text { flex: 1; min-width: 0; }
.pymeapps-cta__title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.pymeapps-cta__sub {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-top: 2px;
  line-height: 1.3;
}
.pymeapps-cta__arrow {
  flex-shrink: 0;
  opacity: 0.9;
}

/* ========================================
   DISCLAIMER MÉDICO
   ======================================== */
.medical-disclaimer {
  margin-top: 22px;
  padding: 12px 14px;
  background: #FFF6E1;
  border-left: 3px solid #F4B860;
  border-radius: 8px;
  font-size: 0.82rem;
  color: #5C3A0F;
  line-height: 1.5;
}
.medical-disclaimer strong { color: #5C3A0F; font-weight: 600; }

/* ========================================
   FOOTER
   ======================================== */
.app-footer {
  margin-top: 28px;
  padding: 18px 0 4px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--border);
}
.app-footer__link {
  color: var(--cuida-green);
  text-decoration: none;
  font-weight: 500;
  padding: 4px 2px;
}
.app-footer__link:active { opacity: 0.6; }
.app-footer__sep { color: var(--ink-ghost); margin: 0 2px; }
.app-footer__brand {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--ink-ghost);
}
.app-footer__brand a {
  color: var(--ink-soft);
  text-decoration: none;
}
.app-footer__brand strong { color: var(--cuida-green); font-weight: 600; }

/* ========================================
   PÁGINAS LEGALES (Privacidad, Términos, Acerca)
   ======================================== */
.legal {
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 4px 40px;
}
.legal__title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  color: var(--ink);
}
.legal__updated {
  font-size: 0.85rem;
  color: var(--ink-ghost);
  margin-bottom: 24px;
}
.legal h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--cuida-green);
  margin: 22px 0 8px;
  letter-spacing: -0.01em;
}
.legal p {
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.55;
  margin-bottom: 10px;
}
.legal ul {
  margin: 0 0 12px;
  padding-left: 20px;
}
.legal li {
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.55;
  margin-bottom: 6px;
}
.legal__contact {
  background: var(--cuida-green-bg);
  padding: 12px 16px;
  border-radius: 10px;
  text-align: center;
  font-size: 1rem;
  margin: 8px 0 16px;
  color: var(--cuida-green);
}
.legal__contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--cuida-green);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  margin: 8px 0 24px;
  box-shadow: 0 4px 12px rgba(27, 122, 110, 0.25);
}
.legal__contact-btn:active { transform: scale(0.97); }

.about-intro {
  font-size: 1.05rem !important;
  color: var(--ink) !important;
  line-height: 1.6 !important;
  margin: 8px 0 18px !important;
  padding: 14px 16px;
  background: var(--cuida-green-bg);
  border-radius: var(--radius-md);
}
.about-brand {
  margin: 8px 0 20px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.about-brand__name {
  font-size: 1.2rem !important;
  font-weight: 700 !important;
  color: var(--cuida-green) !important;
  margin-bottom: 4px !important;
  letter-spacing: -0.01em;
}
.about-brand__tagline {
  font-size: 0.9rem !important;
  color: var(--ink-soft) !important;
  margin-bottom: 10px !important;
}
.about-brand__desc {
  font-size: 0.92rem !important;
  color: var(--ink) !important;
  line-height: 1.5 !important;
  margin: 0 !important;
}
