:root {
  --bg: #14161f; --bg2: #1c1f2b; --bg3: #262a3a; --text: #ecebf3; --muted: #9a9cb0;
  --accent: #e9a86b; --accent2: #c98a54; --me: #2f3550; --danger: #e06666;
  --safe-b: env(safe-area-inset-bottom); --safe-t: env(safe-area-inset-top);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
[hidden] { display: none !important; }
.screen { height: 100%; display: flex; flex-direction: column; }
h2 { margin: 8px 0 4px; font-size: 22px; } h3 { margin: 0 0 6px; font-size: 16px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .error { color: var(--danger); min-height: 1.2em; }
input, textarea { width: 100%; background: var(--bg3); color: var(--text); border: 1px solid #333850;
  border-radius: 14px; padding: 12px 14px; font: inherit; outline: none; }
input:focus, textarea:focus { border-color: var(--accent2); }
.btn { display: block; text-align: center; text-decoration: none; background: var(--bg3); color: var(--text);
  border: 0; border-radius: 14px; padding: 12px 16px; font: inherit; font-weight: 600; cursor: pointer; }
.btn.primary { background: var(--accent); color: #241a10; } .btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; font: inherit; cursor: pointer; }
.chip { background: transparent; border: 1px solid #44486a; color: var(--muted); border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.row { display: flex; align-items: flex-end; gap: 8px; } .gap > * { flex: 1; }

/* Bloqueo */
#lock { align-items: center; justify-content: center; padding: 24px; }
.lock-box { width: 100%; max-width: 340px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.brand { margin: 6px 0 0; font-weight: 600; letter-spacing: .5px; }
.orb { width: 84px; height: 84px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffd9b0, var(--accent) 45%, #6b3f2a 100%);
  box-shadow: 0 0 50px #e9a86b55; animation: breathe 5s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.08); box-shadow: 0 0 70px #e9a86b88; } }
#privacy-cover { position: fixed; inset: 0; background: var(--bg); z-index: 99; }

/* App */
.top { display: flex; justify-content: space-between; align-items: center; padding: calc(10px + var(--safe-t)) 16px 10px; border-bottom: 1px solid #23263a; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); margin-right: 4px; }
.view { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
#v-hoy { padding: 0; }
.feed { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 85%; padding: 10px 14px; border-radius: 18px; white-space: pre-wrap; word-wrap: break-word; }
.msg.assistant { background: var(--bg2); align-self: flex-start; border-bottom-left-radius: 6px; }
.msg.user { background: var(--me); align-self: flex-end; border-bottom-right-radius: 6px; }
.msg .meta { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
.day { align-self: center; font-size: 12px; color: var(--muted); margin: 6px 0; }
.typing { opacity: .7; font-style: italic; }
.composer { padding: 10px 16px calc(10px + 0px); border-top: 1px solid #23263a; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.composer textarea { resize: none; max-height: 120px; }
.icon-btn { background: var(--bg3); color: var(--accent); border: 0; border-radius: 14px; width: 48px; height: 48px; font-size: 18px; flex: none; }
.mic { display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--bg2); color: var(--text);
  border: 1px solid #333850; border-radius: 18px; padding: 16px; font: inherit; font-weight: 600; }
.mic.rec { background: #3a1f1f; border-color: var(--danger); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px #e0666622; } }
.mic-icon { font-size: 22px; }
.mood { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.mood-btns { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.mood-btns button { background: var(--bg3); color: var(--text); border: 0; border-radius: 8px; padding: 8px 0; font: inherit; }

.list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.list li { background: var(--bg2); border-radius: 14px; padding: 10px 12px; display: flex; gap: 10px; align-items: flex-start; }
.list li div { flex: 1; } .list .tag { font-size: 11px; color: var(--accent); text-transform: uppercase; letter-spacing: .5px; }
.list .del { background: none; border: 0; color: var(--muted); font-size: 18px; }
.profile { min-height: 50vh; font-size: 15px; }
.card { background: var(--bg2); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.time-chip { display: inline-flex; gap: 6px; align-items: center; background: var(--bg3); border-radius: 999px; padding: 6px 12px; margin: 0 6px 6px 0; }
.time-chip button { background: none; border: 0; color: var(--muted); }
#mood-chart { width: 100%; background: var(--bg2); border-radius: 14px; }

.tabs { display: flex; border-top: 1px solid #23263a; padding-bottom: var(--safe-b); background: var(--bg); }
.tabs button { flex: 1; background: none; border: 0; color: var(--muted); padding: 12px 0; font: inherit; font-size: 14px; }
.tabs button.active { color: var(--accent); font-weight: 600; }

dialog { background: var(--bg2); color: var(--text); border: 0; border-radius: 20px; padding: 20px; max-width: 340px; }
dialog::backdrop { background: #000a; }
dialog .btn { margin: 8px 0; }
