/* App del adulto mayor – "Cielo".
   Arriba, el cielo de esta hora con el día escrito en grande (como un reloj de día).
   Abajo, una hoja blanca con lo que toca ahora y lo demás, en orden de importancia. */
:root { font-size: 19px; }
html[data-font="grande"] { font-size: 22px; }
html[data-font="enorme"] { font-size: 25px; }
body { background: var(--page); }
body[data-view="viewHome"], body[data-view="viewLink"] { background: var(--sheet); }
.screen { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(132px + env(safe-area-inset-bottom)); }
p { margin: 0; }
h2, h3 { margin: 0; }

/* ---------- Cielo ---------- */
.sky { padding: calc(14px + env(safe-area-inset-top)) 22px 40px; }
.sky-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px; }
.hi { font-size: 1.05rem; font-weight: 600; color: var(--sky-ink-2); }
.sky-btn { width: 56px; height: 52px; border: 0; border-radius: 18px; background: var(--sky-chip); color: var(--sky-ink); display: inline-flex; align-items: baseline; justify-content: center; gap: 1px; cursor: pointer; font-family: var(--font-display); font-weight: 600; }
.sky-btn .aa { font-size: .85rem; } .sky-btn .aa.big { font-size: 1.25rem; }
.dayname { font-family: var(--font-display); font-variation-settings: "SOFT" 100, "opsz" 110; font-weight: 600; font-size: clamp(2.2rem, 11vw, 3rem); line-height: 1; letter-spacing: -.02em; margin: 10px 0 10px; text-wrap: balance; color: var(--sky-ink); }
.dayname #dayPart { display: block; font-weight: 400; }
.dateline { font-size: 1.05rem; font-weight: 500; color: var(--sky-ink-2); }
.sky-listen { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; margin-top: 12px; padding: 0 18px 0 14px; border: 0; border-radius: 999px; background: var(--sky-chip); color: var(--sky-ink); font: 700 .95rem var(--font); cursor: pointer; }
.sky-arc-wrap { margin: 6px -8px -8px; }
.sky-link { padding-bottom: 46px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; color: var(--sky-ink); }
.brand .logo { width: 40px; height: 40px; border-radius: 13px; background: var(--blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: var(--sky-chip); color: var(--sky-ink-2); }
.status .dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.status.on { color: var(--done); } .status.off { color: var(--help); }

/* ---------- Hoja ---------- */
.sheet { position: relative; margin-top: -30px; background: var(--sheet); border-radius: 32px 32px 0 0; padding: 26px 20px 8px; box-shadow: 0 -14px 30px -26px rgba(19,38,59,.6); }

/* Lo que toca ahora */
.now { display: grid; gap: 10px; }
.now-when { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; color: var(--blue); }
.now-when b { font-size: 1.05rem; font-weight: 800; font-variant-numeric: tabular-nums; background: var(--blue-soft); padding: 4px 12px; border-radius: 999px; }
.now-when b:empty { display: none; }
.now.due .now-when span::before { content: ""; display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--blue); margin-right: 9px; vertical-align: 1px; box-shadow: 0 0 0 0 rgba(37,99,168,.5); animation: beacon 2s infinite; }
@keyframes beacon { 70% { box-shadow: 0 0 0 9px rgba(37,99,168,0); } 100% { box-shadow: 0 0 0 0 rgba(37,99,168,0); } }
.now h2 { font-size: 1.75rem; line-height: 1.1; font-weight: 800; letter-spacing: -.01em; text-wrap: balance; }
.now-sub { font-size: 1.05rem; color: var(--ink-2); }
.now .btn { margin-top: 6px; }

/* Botones */
.btn { width: 100%; min-height: 68px; border: 0; border-radius: 20px; font: 700 1.15rem var(--font); display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 18px; cursor: pointer; text-align: center; }
.btn.inline { width: auto; display: inline-flex; padding: 0 28px; min-height: 60px; }
.btn.big { min-height: 76px; font-size: 1.2rem; }
.btn.pri { background: var(--blue); color: #fff; }
.btn.soft { background: var(--blue-soft); color: var(--blue-deep); }
.btn.red { background: var(--help); color: #fff; }
.btn.pulse { box-shadow: 0 12px 24px -14px rgba(37,99,168,.9); }
.btn-text { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border: 0; background: none; color: var(--blue); font: 700 1rem var(--font); cursor: pointer; }
.btn:active, .big-choice:active, .row-btn:active, .mood:active, .sky-btn:active, .sky-listen:active, .tbtn:active, .back:active { transform: scale(.98); }

/* Después */
.later { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.later h3, .feel h3 { font-size: 1rem; font-weight: 700; color: var(--ink-2); }
.later ol { list-style: none; margin: 6px 0 0; padding: 0; }
.later li { display: grid; grid-template-columns: 4em 1fr; gap: 10px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
.later li:last-child { border-bottom: 0; }
.later li b { font-weight: 800; font-variant-numeric: tabular-nums; }

/* Dos grandes opciones */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0 6px; }
.big-choice { min-height: 150px; border: 0; border-radius: 26px; background: var(--blue-soft); color: var(--ink); padding: 16px; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 4px; text-align: left; cursor: pointer; font: inherit; }
.big-choice .bc-ic { width: 58px; height: 58px; border-radius: 50%; background: #fff; color: var(--blue); display: inline-flex; align-items: center; justify-content: center; margin-bottom: auto; }
.big-choice b { font-size: 1.12rem; font-weight: 800; line-height: 1.15; }
.big-choice small { font-size: .85rem; color: var(--ink-2); font-weight: 500; }

/* Ánimo */
.feel { margin-top: 22px; }
.moods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.mood { min-height: 104px; border: 2px solid var(--line); border-radius: 22px; background: #fff; color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font: 700 .92rem var(--font); cursor: pointer; padding: 8px 4px; }
.mood.sel { border-color: var(--blue); background: var(--blue-soft); }

/* Filas */
.rows { margin-top: 20px; border-top: 1px solid var(--line); }
.row-btn { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); padding: 14px 2px; min-height: 80px; font: inherit; cursor: pointer; }
.row-btn b { display: block; font-size: 1.05rem; font-weight: 700; }
.row-btn small { display: block; font-size: .86rem; color: var(--ink-2); margin-top: 2px; }
.r-ic { width: 50px; height: 50px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.r-ic.red { background: var(--help-soft); color: var(--help); }
.chev { margin-left: auto; color: var(--ink-2); display: inline-flex; flex: none; }
.weather { display: flex; align-items: center; gap: 14px; padding: 16px 2px; border-bottom: 1px solid var(--line); }
.weather .temp { font-family: var(--font-display); font-size: 1.9rem; font-weight: 600; }
.weather .wicon { color: #B07A00; display: inline-flex; }
.weather .wsub { color: var(--ink-2); font-size: .9rem; }

/* Ajustes */
.prefs summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 60px; font-weight: 700; color: var(--blue); cursor: pointer; }
.prefs summary::-webkit-details-marker { display: none; }
.prefs summary::before { content: "▸"; transition: transform .2s; }
.prefs[open] summary::before { transform: rotate(90deg); }
.prefs-body { display: grid; gap: 14px; padding-bottom: 10px; }
.field { display: block; font-weight: 700; }
.field input, .field select { display: block; width: 100%; margin-top: 6px; font: inherit; font-weight: 500; padding: 14px; border: 2px solid var(--line); border-radius: 16px; background: #fff; color: var(--ink); }
.field input[type=range] { padding: 0; accent-color: var(--blue); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 50px; padding: 0 16px; border: 0; border-radius: 16px; background: var(--blue-soft); color: var(--blue-deep); font: 700 .92rem var(--font); cursor: pointer; }
.quota { text-align: center; color: var(--muted); font-size: .85rem; margin: 12px 0 0; }

/* Vincular */
.steps { margin: 0 0 18px; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 14px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: start; font-size: 1.05rem; }
.steps li::before { content: counter(s); width: 44px; height: 44px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font: 600 1.2rem var(--font-display); }
#viewLink .btn { margin-top: 16px; }
#linkMsg { margin-top: 10px; }

/* ---------- Pantallas internas ---------- */
.page { padding: calc(8px + env(safe-area-inset-top)) 20px 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0 12px; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 54px; padding: 0 18px 0 10px; border: 0; border-radius: 18px; background: #fff; color: var(--ink); font: 700 1rem var(--font); cursor: pointer; box-shadow: var(--shadow-sm); }
.title { font-family: var(--font-display); font-variation-settings: "SOFT" 100, "opsz" 90; font-weight: 600; font-size: 2.05rem; line-height: 1.06; letter-spacing: -.015em; margin: 8px 0 10px; text-wrap: balance; }
.lead { font-size: 1.05rem; color: var(--ink-2); margin-bottom: 16px; }
.people { display: grid; gap: 10px; }
.person { display: flex; align-items: center; gap: 14px; background: #fff; border-radius: 24px; padding: 14px; box-shadow: var(--shadow-sm); }
.person .av { width: 62px; height: 62px; border-radius: 50%; background: var(--blue-soft); color: var(--blue-deep); display: grid; place-items: center; font: 600 1.5rem var(--font-display); flex: none; }
.person > div { flex: 1; min-width: 0; }
.person b { display: block; font-size: 1.15rem; }
.person small { display: block; color: var(--ink-2); font-size: .9rem; }
.person a { width: 62px; height: 62px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; flex: none; }
.person.sos .av { background: var(--help-soft); color: var(--help); font: 800 1.05rem var(--font); }
.person.sos a { background: var(--help); }
.people .item { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #fff; border-radius: 20px; padding: 12px 12px 12px 18px; box-shadow: var(--shadow-sm); }
.people .item a { display: inline-flex; align-items: center; gap: 6px; min-height: 52px; padding: 0 16px; border-radius: 16px; background: var(--blue); color: #fff; text-decoration: none; font-weight: 700; flex: none; }

/* Conversación: el mismo cielo de la hora */
.talkview { min-height: 100vh; padding: calc(8px + env(safe-area-inset-top)) 18px 0; display: flex; flex-direction: column; }
.talkview .back { background: var(--sky-chip); color: var(--sky-ink); box-shadow: none; }
.talk-state { font-weight: 700; color: var(--sky-ink-2); text-align: right; font-size: .92rem; max-width: 58%; }
.bubbles { flex: 1; overflow-y: auto; padding: 4px 0; min-height: 150px; }
.bubble { max-width: 88%; padding: 14px 18px; border-radius: 24px; margin: 10px 0; font-size: 1.12rem; line-height: 1.35; animation: fadeUp .25s ease both; }
.bubble.bot { background: #fff; color: var(--ink); border-bottom-left-radius: 8px; box-shadow: var(--shadow-sm); }
.bubble.user { background: var(--blue); color: #fff; margin-left: auto; border-bottom-right-radius: 8px; }
.orb { width: 120px; height: 120px; border-radius: 50%; margin: 16px auto 10px; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 14px rgba(255,255,255,.35), 0 0 0 30px rgba(255,255,255,.16); transition: background .3s, transform .2s; }
.orb.listening { animation: breathe 1.6s ease-in-out infinite; }
.orb.speaking { background: var(--sun); color: var(--ink); box-shadow: 0 0 0 14px rgba(245,190,72,.3), 0 0 0 30px rgba(245,190,72,.14); animation: breathe 1.1s ease-in-out infinite; }
.orb.thinking { opacity: .65; }
@keyframes breathe { 50% { transform: scale(1.06); } }
.talk-hint { text-align: center; color: var(--sky-ink-2); font-size: .95rem; margin-bottom: 12px; }
.talk-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tbtn { min-height: 62px; border: 0; border-radius: 18px; background: var(--sky-chip); color: var(--sky-ink); font: 700 1rem var(--font); display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.tbtn.end { background: var(--ink); color: #fff; }
[data-sky="noche"] .tbtn.end { background: #fff; color: var(--ink); }
.typebox { display: flex; gap: 8px; margin-top: 10px; }
.typebox input { flex: 1; min-width: 0; font: inherit; padding: 14px 16px; border: 0; border-radius: 18px; background: #fff; color: var(--ink); }
.typebox .btn { width: auto; padding: 0 22px; min-height: 60px; }
.talkview .quota { color: var(--sky-ink-2); margin-bottom: 140px; }

/* Calma */
.breathe { border-radius: 30px; padding: 24px 20px; text-align: center; display: grid; justify-items: center; gap: 12px; margin-bottom: 16px; }
.breath { width: 170px; height: 170px; border-radius: 50%; background: radial-gradient(circle, #fff 0 55%, rgba(255,255,255,.55) 56% 100%); box-shadow: 0 0 0 16px rgba(255,255,255,.25); transform: scale(.74); transition: transform 4s ease-in-out; display: flex; align-items: center; justify-content: center; color: var(--ink); font: 600 1.2rem var(--font-display); }
.breath.in, .breath.hold { transform: scale(1.06); }
.breath.out { transform: scale(.74); }
#breathHint { color: var(--sky-ink-2); font-weight: 500; }
.quote { background: #fff; border-radius: 26px; padding: 22px; margin-top: 14px; box-shadow: var(--shadow-sm); }
.phrase { font-family: var(--font-display); font-variation-settings: "SOFT" 100; font-size: 1.35rem; line-height: 1.35; font-weight: 500; }
.musicbox { margin-top: 14px; display: grid; gap: 10px; }
.musicbox h3 { font-size: 1rem; color: var(--ink-2); }
.page .weather { border: 0; background: #fff; border-radius: 22px; padding: 16px 18px; margin-top: 14px; box-shadow: var(--shadow-sm); }

/* Ayuda */
.help .title { margin-top: 34px; }
.help-actions { display: grid; gap: 12px; margin: 8px 0 18px; }
.help-sent { margin-bottom: 14px; background: #fff; border-radius: 26px; padding: 22px; box-shadow: var(--shadow); display: grid; gap: 8px; font-size: 1.05rem; }
.help-sent .ok { width: 64px; height: 64px; border-radius: 50%; background: var(--done-soft); color: var(--done); display: grid; place-items: center; }
.help-sent b { font-size: 1.25rem; }
.sos-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; padding: 16px 2px; border-top: 1px solid var(--line); color: var(--ink-2); }
.sos-line b { color: var(--help); font-size: 1.1rem; white-space: nowrap; }

/* Botón de ayuda, siempre en el mismo lugar */
.helpbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 26px 16px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(to top, rgba(255,255,255,1) 64%, rgba(255,255,255,0)); pointer-events: none; }
.helpbar button { pointer-events: auto; display: flex; width: 100%; max-width: 528px; margin: 0 auto; min-height: 72px; border: 0; border-radius: 24px; background: var(--help); color: #fff; font: 800 1.2rem var(--font); align-items: center; justify-content: center; gap: 12px; cursor: pointer; box-shadow: 0 14px 26px -14px rgba(201,58,58,.85); }
body[data-view="viewTalk"] .helpbar { background: none; }
body[data-view="viewHelp"] .helpbar, body[data-view="viewLink"] .helpbar, body[data-view="viewEmergency"] .helpbar, body[data-view=""] .helpbar { display: none; }
