/* MANU OS identity (docs/product/EXPERIENCE.md) with Liquid Glass in the
   functional layer only (tab bar, floating button, sheets, scroll-edge bar).
   Contrast (QAL-009): --fill #246BFD only behind white text (4.57:1);
   --accent #4D8DFF for text/icons (6.34:1 on bg, 5.81:1 on surface). */
:root {
  --bg: #050608; --surface: #111318; --surface-2: #1A1D24; --line: rgba(255,255,255,.08);
  --text: #F7F8FA; --muted: #949AA6; --fill: #246BFD; --accent: #4D8DFF;
  --danger: #FF6B6B; --ok: #3DDC97; --warm: #FFB547;
  --glass: rgba(30,33,41,.55); --glass-strong: rgba(24,27,34,.78);
  --glass-edge: rgba(255,255,255,.14); --glass-hi: rgba(255,255,255,.18);
  --ambient-1: rgba(36,107,253,.28); --ambient-2: rgba(77,141,255,.10);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --tabbar-h: 64px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --bottom-space: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 28px);
  color-scheme: dark;
}
body[data-mode="MORNING"] { --ambient-1: rgba(255,181,71,.22); --ambient-2: rgba(36,107,253,.12); }
body[data-mode="WORK"] { --ambient-1: rgba(36,107,253,.30); --ambient-2: rgba(61,220,151,.08); }
body[data-mode="AFTERNOON"] { --ambient-1: rgba(160,110,255,.22); --ambient-2: rgba(36,107,253,.12); }
body[data-mode="NIGHT"] { --ambient-1: rgba(36,60,160,.22); --ambient-2: rgba(10,14,40,.3); }
body[data-mode="WEEKEND"] { --ambient-1: rgba(61,220,151,.18); --ambient-2: rgba(36,107,253,.14); }

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font: 17px/1.4 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
.ambient { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(120% 60% at 15% -10%, var(--ambient-1), transparent 60%), radial-gradient(90% 50% at 100% 20%, var(--ambient-2), transparent 60%), var(--bg); transition: background .6s; }
.app { max-width: 520px; margin: 0 auto; padding-inline: 16px; padding-block: calc(env(safe-area-inset-top, 0px) + 12px) var(--bottom-space); }
main:focus { outline: none; }
p { margin: 0; }
h1 { font: 700 34px/1.12 var(--display); letter-spacing: .005em; margin: 6px 0 2px; }
.subtitle { color: var(--muted); font-size: 15px; margin-bottom: 18px; }
h2 { font: 600 13px/1.2 var(--font); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0; }
.section-title { display: flex; justify-content: space-between; align-items: center; margin: 22px 4px 8px; }
.section-title h2 { margin: 0; }
.stack { display: grid; gap: 12px; }
.card { background: rgba(17,19,24,.66); border-radius: 22px; padding: 16px; display: grid; gap: 10px; border: 1px solid var(--line); }
.muted { color: var(--muted); font-size: 15px; }
.small { font-size: 13px; }
.row { display: flex; gap: 12px; align-items: center; justify-content: space-between; min-height: 44px; }
.row + .row { border-top: 1px solid var(--line); }
.grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: rgba(77,141,255,.14); color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.btn { display: inline-flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 0; background: var(--fill); color: #fff; font-weight: 600; font-size: 15px; cursor: pointer; }
.btn.ghost { background: rgba(255,255,255,.07); color: var(--accent); }
.btn.danger { background: rgba(255,107,107,.12); color: var(--danger); }
.btn.block { width: 100%; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.link { border: 0; background: none; color: var(--accent); padding: 0; min-height: 44px; cursor: pointer; font-size: 15px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type=text], input[type=search], input:not([type]), textarea, select { width: 100%; min-height: 44px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.05); padding: 10px 14px; font-size: 16px; }
select { width: auto; min-height: 34px; padding: 4px 10px; font-size: 13px; max-width: 150px; }
textarea { resize: vertical; }

/* Hero cards */
.hero { position: relative; overflow: hidden; background: linear-gradient(160deg, rgba(36,107,253,.35), rgba(17,19,24,.9) 70%); }
.weather-now { display: flex; align-items: center; gap: 14px; }
.weather-now svg { width: 52px; height: 52px; color: var(--warm); flex: none; }
.temp { font: 300 52px/1 var(--display); font-variant-numeric: tabular-nums; }
.big-money { font: 700 40px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--fill); }

/* Tasks */
.check { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--muted); background: none; flex: none; cursor: pointer; display: grid; place-items: center; color: #fff; }
.check svg { width: 16px; height: 16px; opacity: 0; }
.check[aria-pressed="true"] { background: var(--fill); border-color: var(--fill); }
.check[aria-pressed="true"] svg { opacity: 1; }
.done-text { color: var(--muted); text-decoration: line-through; }

/* Grouped list (iOS settings style) */
.list { background: var(--surface); border-radius: 22px; border: 1px solid var(--line); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 16px; width: 100%; border: 0; background: none; text-align: left; cursor: pointer; }
.item + .item, .item + details, details + .item, details + details { border-top: 1px solid var(--line); }
.item .ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; color: #fff; }
.item .ico svg { width: 18px; height: 18px; }
.item .chev { color: var(--muted); }
.list details > summary { list-style: none; }
.list details > summary::-webkit-details-marker { display: none; }
.list details .inner { padding: 0 16px 14px 58px; display: grid; gap: 10px; }
.ico.blue { background: #246BFD; } .ico.green { background: #1F9D63; } .ico.orange { background: #C7771A; } .ico.red { background: #C9423F; } .ico.purple { background: #7152D9; } .ico.gray { background: #4A505C; } .ico.teal { background: #16849B; }

/* Mood */
.mood { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mood button { min-height: 64px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.04); cursor: pointer; display: grid; place-items: center; gap: 2px; font-size: 13px; color: var(--muted); }
.mood button b { font-size: 22px; color: var(--text); font-weight: 600; }
.mood button[aria-pressed="true"] { background: var(--fill); border-color: var(--fill); color: #fff; }
.mood button[aria-pressed="true"] b { color: #fff; }
.dots { display: flex; gap: 6px; }
.dots i { width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.07); display: block; }
.dots i[data-v="1"] { background: #7A4B55; } .dots i[data-v="2"] { background: #6B6F7C; } .dots i[data-v="3"] { background: #2E6BD8; } .dots i[data-v="4"] { background: #3DDC97; }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(145deg, #4D8DFF, #246BFD); display: grid; place-items: center; font: 700 28px var(--display); color: #fff; flex: none; }

/* ---------- Liquid Glass: functional layer only ---------- */
.glass { background: var(--glass); -webkit-backdrop-filter: blur(28px) saturate(1.5); backdrop-filter: blur(28px) saturate(1.5); border: 1px solid var(--glass-edge); box-shadow: inset 0 1px 0 var(--glass-hi), 0 10px 30px rgba(0,0,0,.45); }
@media (prefers-reduced-transparency: reduce) { .glass { background: var(--glass-strong); -webkit-backdrop-filter: none; backdrop-filter: none; } }

.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 9; padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px; text-align: center; font-weight: 600; font-size: 17px; border-radius: 0; border-width: 0 0 1px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.topbar.show { opacity: 1; }

.tabbar { position: fixed; z-index: 10; left: max(12px, calc(50% - 260px)); bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); width: min(calc(100% - 24px - var(--tabbar-h) - 10px), 446px); height: var(--tabbar-h); border-radius: 999px; padding: 6px; display: grid; grid-template-columns: repeat(6, 1fr); }
.tab { border: 0; background: none; border-radius: 999px; display: grid; justify-items: center; align-content: center; gap: 2px; color: var(--muted); font-size: 10.5px; font-weight: 600; cursor: pointer; }
.tab svg { width: 24px; height: 24px; }
.tab[aria-selected="true"] { color: var(--accent); background: rgba(255,255,255,.09); }
.tab .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 800 15px var(--display); background: var(--fill); color: #fff; }

.fab { position: fixed; z-index: 11; right: max(12px, calc(50% - 260px)); bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); width: var(--tabbar-h); height: var(--tabbar-h); border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--text); }
.fab svg { width: 26px; height: 26px; }

.sheet-bg { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.45); display: grid; align-items: end; }
.sheet { width: min(100%, 520px); margin: 0 auto; border-radius: 30px 30px 0 0; padding: 10px 16px calc(env(safe-area-inset-bottom, 0px) + 18px); display: grid; gap: 14px; background: var(--glass-strong); max-height: 88vh; overflow-y: auto; }
.grabber { width: 38px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.3); margin: 0 auto 4px; }
.segmented { display: grid; grid-template-columns: repeat(4, 1fr); padding: 3px; border-radius: 12px; background: rgba(255,255,255,.07); }
.segmented button { min-height: 36px; border: 0; border-radius: 10px; background: none; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: rgba(255,255,255,.14); color: var(--text); }

/* Chat */
.chat { display: grid; gap: 8px; }
.bubble { max-width: 84%; padding: 10px 14px; border-radius: 20px; font-size: 16px; overflow-wrap: anywhere; white-space: pre-wrap; }
.bubble.me { justify-self: end; background: var(--fill); color: #fff; border-bottom-right-radius: 6px; }
.bubble.manu { justify-self: start; background: var(--surface-2); border-bottom-left-radius: 6px; }
.bubble.safety { border: 2px solid var(--danger); }
.composer { position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 20px); display: flex; gap: 8px; margin-top: 14px; padding: 6px; border-radius: 999px; }
.composer input { flex: 1; min-width: 0; border: 0; background: none; min-height: 44px; padding: 0 12px; }
.composer .btn { padding: 0 16px; }
.suggest { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.suggest button { flex: none; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--accent); border-radius: 999px; min-height: 36px; padding: 0 14px; font-size: 14px; cursor: pointer; }
.refuge-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-radius: 16px; padding: 4px 14px; margin-bottom: 10px; font-size: 15px; background: rgba(113,82,217,.18); }

.toast { position: fixed; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top, 0px) + 12px); padding: 10px 18px; border-radius: 999px; z-index: 30; font-size: 15px; max-width: calc(100% - 32px); }
.banner { background: var(--surface-2); border-radius: 14px; padding: 10px 14px; font-size: 15px; margin-block: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
details > summary { cursor: pointer; }
ol { margin: 4px 0 0; padding-left: 20px; display: grid; gap: 4px; }
code { font-size: 12px; overflow-wrap: anywhere; color: var(--text); }

h2 svg { width: 15px; height: 15px; vertical-align: -2px; margin-right: 4px; }
.link svg { width: 18px; height: 18px; vertical-align: -4px; }
.link { display: inline-flex; align-items: center; gap: 2px; }
button.chip { border: 1px solid transparent; cursor: pointer; min-height: 36px; padding: 0 14px; background: rgba(255,255,255,.07); }
button.chip[aria-pressed="true"] { background: rgba(77,141,255,.18); border-color: rgba(77,141,255,.45); }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.hero-tap { position: absolute; inset: 0; border: 0; background: none; cursor: pointer; border-radius: inherit; z-index: 0; }
.hero > *:not(.hero-tap) { position: relative; z-index: 1; pointer-events: none; }
.hero .btns, .hero .btns * { pointer-events: auto; }
.hero .cal-head, .hero .cal-head * { pointer-events: auto; }
.hours { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(48px, 1fr); gap: 4px; overflow-x: auto; scrollbar-width: none; }
.hours > div { display: grid; justify-items: center; gap: 4px; padding: 4px 0; }
.hours svg { width: 24px; height: 24px; color: var(--warm); }
.hours.scroll { grid-auto-columns: 52px; }
.rain { color: #7FB8FF; font-weight: 600; }
.weather-head { text-align: center; margin: 8px 0 18px; display: grid; gap: 2px; }
.temp.xl { font-size: 88px; font-weight: 200; }
.row.day { display: grid; grid-template-columns: 44px 44px 34px 1fr 34px; gap: 10px; }
.wd { font-weight: 600; }
.dicon { display: grid; justify-items: center; }
.dicon svg { width: 24px; height: 24px; color: var(--warm); }
.range { position: relative; height: 6px; border-radius: 99px; background: rgba(255,255,255,.08); }
.range > i { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: linear-gradient(90deg, #4D8DFF, #FFB547); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.tile-v { font: 400 32px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.segmented.one { grid-template-columns: 1fr; }
input[type=time] { width: auto; min-height: 36px; }
.ai-tag { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .06em; padding: 1px 6px; margin-right: 6px; border-radius: 6px; background: rgba(113,82,217,.35); color: #D9CCFF; vertical-align: 1px; }
ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.payload { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,.35); font: 11px/1.35 ui-monospace, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 180px; overflow: auto; color: var(--text); }
.ai-call { margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); }
.ai-call p { margin: 4px 0 0; }
.ai-call .btns { margin-top: 8px; }
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; }
.app-link { display: grid; justify-items: center; gap: 4px; text-decoration: none; color: var(--text); min-height: 64px; }
.app-link .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 18px; }
.review { color: var(--warm); font-weight: 600; }
details.card > summary { list-style: none; }

/* ---------- Motion ---------- */
.tabbar { position: fixed; }
.tab { position: relative; z-index: 1; }
.tab[aria-selected="true"] { background: none; }
.tab-pill { position: absolute; z-index: 0; top: 6px; bottom: 6px; left: 6px; width: calc((100% - 12px) / 6); border-radius: 999px; background: rgba(255,255,255,.10); box-shadow: inset 0 1px 0 rgba(255,255,255,.12); transform: translateX(calc(var(--tab-index, 0) * 100%)); transition: transform 320ms var(--ease-drawer); }
.toast { opacity: 0; transform: translate(-50%, -8px) scale(.97); transition: opacity 200ms var(--ease-out), transform 250ms var(--ease-out); }
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.sheet-bg { transition: background-color 250ms var(--ease-out); }
.sheet-bg[data-state="opening"], .sheet-bg[data-state="closing"] { background-color: rgba(0,0,0,0); }
.sheet { transition: transform 420ms var(--ease-drawer); }
.sheet-bg[data-state="opening"] .sheet, .sheet-bg[data-state="closing"] .sheet { transform: translateY(100%); }
.sheet-bg[data-state="closing"] .sheet { transition-duration: 260ms; }
.check svg { stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset 220ms var(--ease-out), opacity 0s; }
.check[aria-pressed="true"] svg { stroke-dashoffset: 0; }
.check { transition: background-color 180ms var(--ease-out), border-color 180ms var(--ease-out), transform 160ms var(--ease-out); }
.btn, .tab, .fab, .mood button, .app-link, .item, .chip { transition: transform 140ms var(--ease-out), background-color 180ms var(--ease-out); }
@media (hover: none) { .btn:active, .fab:active, .mood button:active, .check:active, .app-link:active, .item:active, button.chip:active { transform: scale(.97); } }
@media (hover: hover) { .btn:active, .fab:active, .mood button:active, .check:active, .app-link:active, button.chip:active { transform: scale(.97); } }
#screen.enter-tab > * { animation: fade-up 220ms var(--ease-out) both; }
#screen.enter-page .card, #screen.enter-page .list, #screen.enter-page .section-title, #screen.enter-page h1, #screen.enter-page .subtitle, #screen.enter-page .weather-head { animation: fade-up 320ms var(--ease-out) both; }
#screen.enter-page .stack > :nth-child(2), #screen.enter-page > :nth-child(2) { animation-delay: 40ms; }
#screen.enter-page .stack > :nth-child(3), #screen.enter-page > :nth-child(3) { animation-delay: 80ms; }
#screen.enter-page .stack > :nth-child(4), #screen.enter-page > :nth-child(4) { animation-delay: 120ms; }
#screen.enter-page .stack > :nth-child(5), #screen.enter-page > :nth-child(5) { animation-delay: 160ms; }
#screen.enter-page .stack > :nth-child(n+6), #screen.enter-page > :nth-child(n+6) { animation-delay: 200ms; }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } }
.bubble.pop { animation: bubble-in 240ms var(--ease-out) both; transform-origin: bottom left; }
.bubble.me.pop { transform-origin: bottom right; }
@keyframes bubble-in { from { opacity: 0; transform: translateY(6px) scale(.97); } }
.bar > i, .range > i { transition: width 500ms var(--ease-out); }
/* Weather icons: slow ambient motion, never distracting */
.wx { overflow: visible; }
.wx-sun .rays { transform-origin: 12px 12px; animation: spin 24s linear infinite; }
.wx-cloud .cloud, .wx-rain .cloud { animation: drift 5s var(--ease-in-out) infinite alternate; }
.wx-rain .drops { animation: rain 1.2s linear infinite; }
.wx-moon { animation: glow 4s ease-in-out infinite alternate; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drift { from { transform: translateX(-1px); } to { transform: translateX(1.5px); } }
@keyframes rain { 0% { transform: translateY(-2px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(3px); opacity: 0; } }
@keyframes glow { from { filter: drop-shadow(0 0 0 rgba(255,181,71,0)); } to { filter: drop-shadow(0 0 4px rgba(255,181,71,.55)); } }
@media (prefers-reduced-motion: reduce) {
  .tab-pill, .sheet, .sheet-bg, .toast, .check, .check svg, .btn, .bar > i, .range > i { transition-duration: 0s !important; }
  #screen.enter-tab > *, #screen.enter-page *, .bubble.pop { animation: none !important; }
  .wx *, .wx { animation: none !important; }
  .toast { transition: opacity 150ms ease !important; transform: translate(-50%, 0); }
}

/* Month calendar */
.cal { gap: 6px; }
.cal-head .link { min-width: 44px; justify-content: center; }
.cal-title { font: 600 20px var(--display); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; text-align: center; margin-inline: -8px; }
.cal-grid.slide { animation: cal-slide 260ms var(--ease-out); }
@keyframes cal-slide { from { opacity: 0; transform: translateX(calc(var(--dir, 1) * 24px)); } }
.cal-dow { font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 0; }
.cal-day { border: 0; border-top: 1px solid var(--line); background: none; min-height: 74px; display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 3px 0 4px; cursor: pointer; font-variant-numeric: tabular-nums; min-width: 0; }
.cal-day .num-d { align-self: center; width: 26px; height: 26px; line-height: 26px; border-radius: 50%; font-size: 14px; }
.cal-day.out .num-d { color: var(--muted); opacity: .45; }
.cal-day.today .num-d { color: var(--accent); font-weight: 700; }
.cal-day.sel .num-d { background: var(--fill); color: #fff; font-weight: 700; }
.cal-day.today.sel .num-d { background: #FF453A; }
.cal-day.sel { background: rgba(255,255,255,.04); }
.chips { display: grid; gap: 2px; min-width: 0; }
.chips .ev { --ev: var(--fill); display: block; background: color-mix(in srgb, var(--ev) 80%, #000); color: #fff; font-size: 9.5px; font-weight: 600; font-style: normal; line-height: 15px; height: 15px; padding: 0 3px; margin: 0 2px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.chips .ev.cont { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.chips .ev.open { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.chips .more { font-size: 9.5px; font-style: normal; color: var(--muted); }
.cal-day.out .chips { opacity: .5; }
.event .ev-bar { --ev: var(--fill); width: 4px; align-self: stretch; border-radius: 2px; background: var(--ev); flex: none; }
.week-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 110px; align-items: end; }
.week-bars > div { display: grid; grid-template-rows: 1fr auto; justify-items: center; height: 100%; align-items: end; }
.week-bars i { width: 70%; max-width: 26px; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--accent), var(--fill)); display: block; transition: height 500ms var(--ease-out); }
@media (prefers-reduced-motion: reduce) { .cal-grid.slide { animation: none; } .week-bars i { transition: none; } }
.small-btn { min-height: 36px; padding: 6px 14px; font-size: 15px; flex: none; }
.guide-step .step-n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--fill); color: #fff; font-weight: 700; flex: none; }
.guide-step .step-n svg { width: 16px; height: 16px; }
.guide-step.done { opacity: .6; }
.guide-step h2 { margin: 0; }
.guide-step.done .step-n { background: var(--ok); color: #050608; }

/* ---------- WEB-16: escenas vivas ---------- */
body[data-wx="sun"] { --ambient-1: rgba(255,181,71,.26); --ambient-2: rgba(255,120,60,.10); }
body[data-wx="cloud"] { --ambient-1: rgba(140,160,190,.20); --ambient-2: rgba(36,107,253,.10); }
body[data-wx="rain"] { --ambient-1: rgba(70,110,170,.28); --ambient-2: rgba(30,50,90,.25); }
body[data-wx="storm"] { --ambient-1: rgba(90,70,160,.28); --ambient-2: rgba(20,24,50,.35); }
body[data-wx="snow"] { --ambient-1: rgba(200,220,255,.20); --ambient-2: rgba(120,160,220,.12); }
body[data-wx="fog"] { --ambient-1: rgba(170,175,185,.18); --ambient-2: rgba(90,95,110,.14); }
body[data-wx="night"] { --ambient-1: rgba(40,60,160,.26); --ambient-2: rgba(120,90,220,.12); }
body[data-mood="1"] { --ambient-3: rgba(120,120,160,.16); } body[data-mood="2"] { --ambient-3: rgba(160,140,220,.14); } body[data-mood="3"] { --ambient-3: rgba(61,220,151,.12); } body[data-mood="4"] { --ambient-3: rgba(255,200,80,.16); }
.ambient { background: radial-gradient(120% 60% at 15% -10%, var(--ambient-1), transparent 60%), radial-gradient(90% 50% at 100% 20%, var(--ambient-2), transparent 60%), radial-gradient(100% 50% at 50% 110%, var(--ambient-3, transparent), transparent 60%), var(--bg); }
.wx-emoji { display: inline-block; font-size: 22px; line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.wx-emoji.big { font-size: 64px; filter: drop-shadow(0 6px 18px rgba(0,0,0,.35)); animation: float 5s ease-in-out infinite alternate; }
.wx-emoji.xl { display: block; font-size: 80px; margin: 6px auto 0; filter: drop-shadow(0 8px 24px rgba(0,0,0,.35)); animation: float 5s ease-in-out infinite alternate; }
@keyframes float { from { transform: translateY(-2px); } to { transform: translateY(4px); } }
.weather-now { align-items: center; }
.scene-card { position: relative; overflow: hidden; isolation: isolate; }
.weather-head.scene-card { border-radius: 26px; padding: 18px 16px 22px; margin-bottom: 12px; text-align: center; }
.weather-head.scene-card > *:not(.scene) { position: relative; z-index: 1; }
.hero > .scene.scene, .scene { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.sc-sun { background: linear-gradient(160deg, rgba(255,170,60,.45), rgba(255,110,60,.18) 45%, rgba(17,19,24,.92) 85%); }
.sc-cloud { background: linear-gradient(160deg, rgba(120,140,175,.45), rgba(40,55,85,.5) 55%, rgba(17,19,24,.92)); }
.sc-rain { background: linear-gradient(170deg, rgba(60,85,130,.6), rgba(22,30,48,.9) 70%); }
.sc-storm { background: linear-gradient(170deg, rgba(70,55,120,.65), rgba(18,20,36,.95) 70%); }
.sc-snow { background: linear-gradient(170deg, rgba(150,175,215,.45), rgba(40,55,85,.6) 60%, rgba(17,19,24,.92)); }
.sc-fog { background: linear-gradient(170deg, rgba(140,145,155,.4), rgba(40,44,52,.8) 70%); }
.sc-night { background: linear-gradient(170deg, rgba(20,30,80,.85), rgba(8,10,28,.95) 75%); }
.scene-sun::before { content: ""; position: absolute; width: 220px; height: 220px; right: -60px; top: -80px; border-radius: 50%; background: radial-gradient(circle, rgba(255,210,120,.55), rgba(255,170,60,0) 70%); animation: sun-pulse 6s ease-in-out infinite alternate; }
@keyframes sun-pulse { from { transform: scale(.92); opacity: .75; } to { transform: scale(1.08); opacity: 1; } }
.scene-rain i, .scene-storm i { position: absolute; top: -20%; width: 1.5px; height: 18px; border-radius: 2px; background: linear-gradient(transparent, rgba(190,215,255,.7)); animation: drop linear infinite; }
@keyframes drop { to { transform: translate(-14px, 360px); } }
.scene-storm::after { content: ""; position: absolute; inset: 0; background: rgba(220,220,255,.0); animation: flash 7s infinite; }
@keyframes flash { 0%, 91%, 95%, 100% { background: rgba(220,220,255,0); } 92%, 94% { background: rgba(220,220,255,.18); } }
.scene-snow i { position: absolute; top: -10%; width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.85); animation: flake linear infinite; }
@keyframes flake { to { transform: translate(18px, 340px); } }
.scene-night i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; animation: twinkle ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: .15; } to { opacity: .9; } }
.scene-cloud i, .scene-fog i { position: absolute; border-radius: 999px; background: rgba(255,255,255,.12); filter: blur(10px); animation: cloud-drift ease-in-out infinite alternate; }
.scene-fog i { background: rgba(220,225,235,.16); height: 38px !important; width: 140% !important; left: -20% !important; filter: blur(14px); }
@keyframes cloud-drift { from { transform: translateX(-24px); } to { transform: translateX(28px); } }
.scene-rain i:nth-child(1), .scene-storm i:nth-child(1) { left: 43%; animation-duration: 1.17s; animation-delay: -0.47s; opacity: 0.42; }
.scene-rain i:nth-child(2), .scene-storm i:nth-child(2) { left: 70%; animation-duration: 0.75s; animation-delay: -0.70s; opacity: 0.85; }
.scene-rain i:nth-child(3), .scene-storm i:nth-child(3) { left: 29%; animation-duration: 0.72s; animation-delay: -0.52s; opacity: 0.43; }
.scene-rain i:nth-child(4), .scene-storm i:nth-child(4) { left: 13%; animation-duration: 0.98s; animation-delay: -0.07s; opacity: 0.68; }
.scene-rain i:nth-child(5), .scene-storm i:nth-child(5) { left: 30%; animation-duration: 1.02s; animation-delay: -0.70s; opacity: 0.43; }
.scene-rain i:nth-child(6), .scene-storm i:nth-child(6) { left: 76%; animation-duration: 0.90s; animation-delay: -1.17s; opacity: 0.42; }
.scene-rain i:nth-child(7), .scene-storm i:nth-child(7) { left: 19%; animation-duration: 0.84s; animation-delay: -0.17s; opacity: 0.46; }
.scene-rain i:nth-child(8), .scene-storm i:nth-child(8) { left: 41%; animation-duration: 0.98s; animation-delay: -0.82s; opacity: 0.45; }
.scene-rain i:nth-child(9), .scene-storm i:nth-child(9) { left: 75%; animation-duration: 1.02s; animation-delay: -0.45s; opacity: 0.67; }
.scene-rain i:nth-child(10), .scene-storm i:nth-child(10) { left: 10%; animation-duration: 0.98s; animation-delay: -0.74s; opacity: 0.65; }
.scene-rain i:nth-child(11), .scene-storm i:nth-child(11) { left: 70%; animation-duration: 0.91s; animation-delay: -0.38s; opacity: 0.69; }
.scene-rain i:nth-child(12), .scene-storm i:nth-child(12) { left: 60%; animation-duration: 0.88s; animation-delay: -0.30s; opacity: 0.49; }
.scene-rain i:nth-child(13), .scene-storm i:nth-child(13) { left: 33%; animation-duration: 0.74s; animation-delay: -0.36s; opacity: 0.65; }
.scene-rain i:nth-child(14), .scene-storm i:nth-child(14) { left: 45%; animation-duration: 1.06s; animation-delay: -0.35s; opacity: 0.89; }
.scene-snow i:nth-child(1) { left: 17%; animation-duration: 7.0s; animation-delay: -1.3s; }
.scene-night i:nth-child(1) { left: 46%; top: 23%; animation-duration: 3.5s; animation-delay: -1.3s; }
.scene-snow i:nth-child(2) { left: 87%; animation-duration: 5.3s; animation-delay: -4.5s; }
.scene-night i:nth-child(2) { left: 43%; top: 47%; animation-duration: 3.0s; animation-delay: -1.8s; }
.scene-snow i:nth-child(3) { left: 76%; animation-duration: 8.2s; animation-delay: -0.6s; }
.scene-night i:nth-child(3) { left: 14%; top: 38%; animation-duration: 2.5s; animation-delay: -2.0s; }
.scene-snow i:nth-child(4) { left: 9%; animation-duration: 7.9s; animation-delay: -2.5s; }
.scene-night i:nth-child(4) { left: 76%; top: 61%; animation-duration: 2.2s; animation-delay: -1.2s; }
.scene-snow i:nth-child(5) { left: 87%; animation-duration: 6.4s; animation-delay: -7.5s; }
.scene-night i:nth-child(5) { left: 48%; top: 25%; animation-duration: 2.8s; animation-delay: -1.5s; }
.scene-snow i:nth-child(6) { left: 29%; animation-duration: 8.1s; animation-delay: -1.0s; }
.scene-night i:nth-child(6) { left: 34%; top: 54%; animation-duration: 2.4s; animation-delay: -2.6s; }
.scene-snow i:nth-child(7) { left: 12%; animation-duration: 5.7s; animation-delay: -3.2s; }
.scene-night i:nth-child(7) { left: 38%; top: 21%; animation-duration: 3.2s; animation-delay: -2.6s; }
.scene-snow i:nth-child(8) { left: 37%; animation-duration: 7.8s; animation-delay: -7.9s; }
.scene-night i:nth-child(8) { left: 90%; top: 52%; animation-duration: 3.5s; animation-delay: -0.5s; }
.scene-snow i:nth-child(9) { left: 24%; animation-duration: 5.6s; animation-delay: -5.3s; }
.scene-night i:nth-child(9) { left: 4%; top: 66%; animation-duration: 3.3s; animation-delay: -0.5s; }
.scene-snow i:nth-child(10) { left: 38%; animation-duration: 5.0s; animation-delay: -3.4s; }
.scene-night i:nth-child(10) { left: 50%; top: 44%; animation-duration: 3.5s; animation-delay: -2.1s; }
.scene-snow i:nth-child(11) { left: 67%; animation-duration: 8.8s; animation-delay: -5.2s; }
.scene-night i:nth-child(11) { left: 97%; top: 10%; animation-duration: 2.5s; animation-delay: -2.6s; }
.scene-snow i:nth-child(12) { left: 89%; animation-duration: 8.2s; animation-delay: -3.1s; }
.scene-night i:nth-child(12) { left: 54%; top: 54%; animation-duration: 1.8s; animation-delay: -1.9s; }
.scene-cloud i:nth-child(1), .scene-fog i:nth-child(1) { left: -10%; top: 8%; width: 160px; height: 46px; animation-duration: 11s; }
.scene-cloud i:nth-child(2), .scene-fog i:nth-child(2) { left: 40%; top: 30%; width: 190px; height: 54px; animation-duration: 14s; }
.scene-cloud i:nth-child(3), .scene-fog i:nth-child(3) { left: 10%; top: 58%; width: 150px; height: 40px; animation-duration: 12s; }
.money-hero { overflow: hidden; }
.money-rain { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.money-rain i { position: absolute; top: -40px; font-size: 24px; font-style: normal; opacity: 0; filter: blur(.6px); animation: money-fall 2.8s cubic-bezier(.4,0,.8,.6) 1 both; }
@keyframes money-fall { 0% { transform: translateY(0) rotate(-12deg); opacity: 0; } 15% { opacity: .45; } 80% { opacity: .35; } 100% { transform: translateY(320px) rotate(18deg); opacity: 0; } }
.money-rain i:nth-child(1) { left: 10%; animation-delay: 0.21s; font-size: 22px; }
.money-rain i:nth-child(2) { left: 59%; animation-delay: 0.18s; font-size: 26px; }
.money-rain i:nth-child(3) { left: 79%; animation-delay: 0.06s; font-size: 18px; }
.money-rain i:nth-child(4) { left: 75%; animation-delay: 0.17s; font-size: 18px; }
.money-rain i:nth-child(5) { left: 49%; animation-delay: 0.68s; font-size: 18px; }
.money-rain i:nth-child(6) { left: 29%; animation-delay: 0.68s; font-size: 22px; }
.money-rain i:nth-child(7) { left: 84%; animation-delay: 0.28s; font-size: 26px; }
.money-rain i:nth-child(8) { left: 80%; animation-delay: 0.40s; font-size: 18px; }
.money-rain i:nth-child(9) { left: 17%; animation-delay: 0.93s; font-size: 30px; }
.money-rain i:nth-child(10) { left: 64%; animation-delay: 0.53s; font-size: 18px; }
.money-rain i:nth-child(11) { left: 21%; animation-delay: 0.11s; font-size: 26px; }
.money-rain i:nth-child(12) { left: 36%; animation-delay: 0.53s; font-size: 22px; }
.cat-emoji { font-size: 22px; width: 30px; text-align: center; flex: none; }
.mood-e { font-size: 30px !important; line-height: 1.1; }
.mood-e.bounce { display: inline-block; animation: mood-bounce 420ms var(--ease-out); }
@keyframes mood-bounce { 0% { transform: scale(1); } 40% { transform: scale(1.35) rotate(-6deg); } 70% { transform: scale(.94); } 100% { transform: scale(1); } }
.mood button[aria-pressed="true"] { background: rgba(77,141,255,.22); border-color: var(--accent); color: var(--text); }
.manu-head { display: flex; align-items: center; gap: 14px; }
.manu-head h1 { margin: 0; }
.manu-head.big { flex-direction: column; text-align: center; padding: 12px 0 6px; }
.orb { position: relative; width: 52px; height: 52px; flex: none; border-radius: 50%; display: grid; place-items: center; font: 700 22px var(--display); color: #fff; background: radial-gradient(circle at 30% 25%, #8fb6ff, #246BFD 55%, #1438a8); box-shadow: 0 0 0 0 rgba(77,141,255,.5), 0 10px 30px rgba(36,107,253,.35); animation: breathe 3.6s ease-in-out infinite; }
.manu-head.big .orb { width: 108px; height: 108px; font-size: 44px; }
.orb.listening { animation: breathe 1.1s ease-in-out infinite; box-shadow: 0 0 0 6px rgba(77,141,255,.18), 0 10px 34px rgba(36,107,253,.5); }
.orb.thinking::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; background: conic-gradient(from 0deg, transparent, rgba(143,182,255,.9), transparent 40%); -webkit-mask: radial-gradient(circle, transparent 62%, #000 64%); mask: radial-gradient(circle, transparent 62%, #000 64%); animation: spin 1.2s linear infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.quick-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.qcard { display: grid; place-items: center; gap: 4px; min-height: 76px; padding: 8px 4px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--text); font: 13px var(--font); cursor: pointer; transition: transform 140ms var(--ease-out), background-color 180ms var(--ease-out); }
.qcard:active { transform: scale(.97); }
.qcard .qe { font-size: 26px; line-height: 1; }
.timeline { list-style: none; margin: 0; padding: 0; }
.tl-item { position: relative; display: flex; gap: 12px; padding: 8px 0 8px 2px; }
.tl-item:not(:last-child)::before { content: ""; position: absolute; left: 6px; top: 24px; bottom: -8px; width: 2px; background: var(--line); }
.tl-dot { width: 12px; height: 12px; margin-top: 5px; border-radius: 50%; flex: none; background: var(--ev, var(--accent)); box-shadow: 0 0 0 3px rgba(77,141,255,.15); }
.tl-item.rem .tl-dot { background: var(--warm); }
@media (prefers-reduced-motion: reduce) {
  .scene i, .scene::before, .scene::after, .wx-emoji, .orb, .orb::after, .mood-e.bounce, .qcard { animation: none !important; }
  .money-rain { display: none; }
}
.cal.compact .cal-day { min-height: 44px; }
.cal.compact .cal-day .chips { display: none; }

/* ---------- WEB-20: fondos vivos en todas las pantallas ---------- */
.ambient { overflow: hidden; }
.blob { position: absolute; width: 95vmax; height: 95vmax; border-radius: 50%; background: radial-gradient(circle, var(--c) 0%, transparent 62%); opacity: .75; will-change: transform; animation: blob-drift ease-in-out infinite alternate; }
.b1 { --c: var(--blob-1, var(--ambient-1)); left: -45vmax; top: -50vmax; animation-duration: 26s; }
.b2 { --c: var(--blob-2, var(--ambient-2)); right: -50vmax; top: 5vh; animation-duration: 33s; animation-delay: -8s; }
.b3 { --c: var(--blob-3, var(--ambient-3, rgba(36,107,253,.12))); left: -20vmax; bottom: -60vmax; animation-duration: 41s; animation-delay: -15s; }
@keyframes blob-drift { 0% { transform: translate(0,0) scale(1); } 50% { transform: translate(8vw, 6vh) scale(1.12); } 100% { transform: translate(-6vw, 10vh) scale(.94); } }
body[data-screen="dinero"] { --blob-1: rgba(61,220,151,.26); --blob-2: rgba(255,196,64,.18); --blob-3: rgba(36,107,253,.16); }
body[data-screen="agenda"] { --blob-1: rgba(77,141,255,.30); --blob-2: rgba(160,110,255,.22); --blob-3: rgba(61,200,220,.14); }
body[data-screen="manu"] { --blob-1: rgba(36,107,253,.34); --blob-2: rgba(80,210,255,.18); --blob-3: rgba(140,100,255,.18); }
body[data-screen="tu"] { --blob-1: rgba(160,110,255,.24); --blob-2: var(--ambient-3, rgba(61,220,151,.16)); --blob-3: rgba(255,120,160,.14); }
.sky { position: absolute; inset: 0; }
.sky .scene { position: absolute; inset: 0; }
.sky .scene-rain i, .sky .scene-storm i { top: -10vh; height: 28px; width: 1.5px; animation-name: drop-full; }
@keyframes drop-full { to { transform: translate(-40px, 115vh); } }
.sky .scene-snow i { top: -5vh; width: 6px; height: 6px; animation-name: flake-full; }
@keyframes flake-full { to { transform: translate(40px, 110vh); } }
.sky .scene-cloud i, .sky .scene-fog i { filter: none; background: radial-gradient(ellipse at center, rgba(255,255,255,.16), rgba(255,255,255,0) 68%); border-radius: 50%; animation-name: cloud-full; }
@keyframes cloud-full { from { transform: translateX(-22vw); } to { transform: translateX(22vw); } }
.sky .scene-fog i { background: radial-gradient(ellipse at center, rgba(220,225,235,.2), rgba(220,225,235,0) 70%); }
.sky .scene-sun::before { width: 90vmax; height: 90vmax; right: -40vmax; top: -45vmax; background: radial-gradient(circle, rgba(255,214,130,.38), rgba(255,170,60,0) 60%); }
.sky .scene-night i { width: 2px; height: 2px; }
.sky .scene-cloud i:nth-child(1), .sky .scene-fog i:nth-child(1) { left: -30vw; top: 4vh; width: 110vw !important; height: 34vh !important; animation-duration: 48s; animation-delay: -20s; }
.sky .scene-cloud i:nth-child(2), .sky .scene-fog i:nth-child(2) { left: 10vw; top: 24vh; width: 120vw !important; height: 40vh !important; animation-duration: 62s; animation-delay: -41s; }
.sky .scene-cloud i:nth-child(3), .sky .scene-fog i:nth-child(3) { left: -20vw; top: 52vh; width: 100vw !important; height: 30vh !important; animation-duration: 55s; animation-delay: -12s; }
.sky .scene-rain i:nth-child(1), .sky .scene-storm i:nth-child(1) { animation-duration: 1.17s; }
.sky .scene-rain i:nth-child(2), .sky .scene-storm i:nth-child(2) { animation-duration: 1.24s; }
.sky .scene-rain i:nth-child(3), .sky .scene-storm i:nth-child(3) { animation-duration: 1.45s; }
.sky .scene-rain i:nth-child(4), .sky .scene-storm i:nth-child(4) { animation-duration: 1.18s; }
.sky .scene-rain i:nth-child(5), .sky .scene-storm i:nth-child(5) { animation-duration: 1.20s; }
.sky .scene-rain i:nth-child(6), .sky .scene-storm i:nth-child(6) { animation-duration: 1.25s; }
.sky .scene-rain i:nth-child(7), .sky .scene-storm i:nth-child(7) { animation-duration: 1.01s; }
.sky .scene-rain i:nth-child(8), .sky .scene-storm i:nth-child(8) { animation-duration: 1.21s; }
.sky .scene-rain i:nth-child(9), .sky .scene-storm i:nth-child(9) { animation-duration: 1.28s; }
.sky .scene-rain i:nth-child(10), .sky .scene-storm i:nth-child(10) { animation-duration: 1.38s; }
.sky .scene-rain i:nth-child(11), .sky .scene-storm i:nth-child(11) { animation-duration: 0.96s; }
.sky .scene-rain i:nth-child(12), .sky .scene-storm i:nth-child(12) { animation-duration: 1.08s; }
.sky .scene-rain i:nth-child(13), .sky .scene-storm i:nth-child(13) { animation-duration: 0.95s; }
.sky .scene-rain i:nth-child(14), .sky .scene-storm i:nth-child(14) { animation-duration: 1.39s; }
body[data-screen="weather"] .blob { opacity: .35; }
body[data-screen="weather"][data-wx="cloud"] .ambient { background: linear-gradient(180deg, #5d6b82 0%, #36405a 45%, #1c222e 100%); }
body[data-screen="weather"][data-wx="rain"] .ambient { background: linear-gradient(180deg, #45546c 0%, #2a3448 50%, #151b26 100%); }
body[data-screen="weather"][data-wx="storm"] .ambient { background: linear-gradient(180deg, #3a3558 0%, #221f38 50%, #0e0d18 100%); }
body[data-screen="weather"][data-wx="sun"] .ambient { background: linear-gradient(180deg, #3f86d6 0%, #2a62b0 45%, #173a6e 100%); }
body[data-screen="weather"][data-wx="night"] .ambient { background: linear-gradient(180deg, #101c4a 0%, #0a1030 50%, #04060f 100%); }
body[data-screen="weather"][data-wx="snow"] .ambient { background: linear-gradient(180deg, #8193b0 0%, #4c5c78 50%, #232c3c 100%); }
body[data-screen="weather"][data-wx="fog"] .ambient { background: linear-gradient(180deg, #737982 0%, #4a4f58 50%, #24272c 100%); }
body[data-screen="weather"] .card { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.14); }
body[data-screen="weather"] .muted, body[data-screen="weather"] .section-title { color: rgba(255,255,255,.72); }
body[data-screen="weather"] .weather-head { text-align: center; padding: 8px 0 14px; }
body[data-screen="weather"] .weather-head .wx-emoji.xl { margin: 4px auto 0; }
@media (prefers-reduced-motion: reduce) { .blob, .sky *, .sky .scene::before, .sky .scene::after { animation: none !important; } }
body[data-screen="hoy"][data-wx="cloud"] .ambient { background: linear-gradient(180deg, #3b465a 0%, #1f2532 38%, #0a0c11 78%); }
body[data-screen="hoy"][data-wx="rain"] .ambient { background: linear-gradient(180deg, #2f3b50 0%, #1a2130 40%, #090b10 78%); }
body[data-screen="hoy"][data-wx="storm"] .ambient { background: linear-gradient(180deg, #2b2742 0%, #17152a 40%, #08070e 78%); }
body[data-screen="hoy"][data-wx="sun"] .ambient { background: linear-gradient(180deg, #2c5a96 0%, #1a355f 38%, #090d16 78%); }
body[data-screen="hoy"][data-wx="night"] .ambient { background: linear-gradient(180deg, #0e1840 0%, #080d26 40%, #030409 78%); }
body[data-screen="hoy"][data-wx="snow"] .ambient { background: linear-gradient(180deg, #56657f 0%, #2d3749 40%, #0c0f14 78%); }
body[data-screen="hoy"][data-wx="fog"] .ambient { background: linear-gradient(180deg, #4b4f57 0%, #2a2d33 40%, #0c0d10 78%); }
/* ---------- WEB-21: estadísticas de dinero ---------- */
:root { --inc: #24A86F; --exp: #4D8DFF; } /* validated pair (dataviz validator, dark surface) */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-tile { padding: 12px; border-radius: 16px; background: rgba(255,255,255,.05); border: 1px solid var(--line); display: grid; gap: 2px; min-width: 0; }
.stat-v { font: 700 22px/1.15 var(--display); color: var(--text); overflow-wrap: anywhere; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot.inc { background: var(--inc); } .dot.exp { background: var(--exp); }
.legend { display: flex; gap: 14px; color: var(--muted); }
.ie-chart { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; align-items: end; height: 150px; border-bottom: 1px solid var(--line); }
.ie-col { display: grid; grid-template-rows: 1fr auto; height: 100%; gap: 4px; border: 0; background: none; padding: 0 0 4px; cursor: pointer; border-radius: 10px; color: inherit; }
.ie-col.sel { background: rgba(255,255,255,.06); }
.ie-bars { display: flex; align-items: flex-end; justify-content: center; gap: 2px; height: 100%; }
.ie-bars i { width: 12px; border-radius: 4px 4px 0 0; transition: height 500ms var(--ease-out); }
.ie-bars i.inc { background: var(--inc); } .ie-bars i.exp { background: var(--exp); }
.stat-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.stat-table th, .stat-table td { text-align: right; padding: 4px 2px; border-bottom: 1px solid var(--line); }
.stat-table th:first-child, .stat-table td:first-child { text-align: left; }
.rank { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.08); font-size: 13px; flex: none; }
@media (prefers-reduced-motion: reduce) { .ie-bars i { transition: none; } }
/* ---------- WEB-22: hoja «+» rediseñada ---------- */
.qa { gap: 12px; }
.qa-head { display: flex; align-items: center; justify-content: space-between; }
.qa-head h2 { margin: 0; font: 700 22px var(--display); color: var(--text); letter-spacing: 0; text-transform: none; }
.qa-close { width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(255,255,255,.1); color: var(--muted); font-size: 15px; cursor: pointer; }
.qa textarea#qText { font-size: 20px; line-height: 1.3; min-height: 64px; resize: none; border-radius: 18px; padding: 14px 16px; }
.qa-hint { margin: -4px 4px 0; min-height: 1.3em; }
.qa-kinds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.qa-kind { display: grid; place-items: center; gap: 4px; min-height: 72px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--muted); font: 600 13px var(--font); cursor: pointer; transition: transform 160ms var(--ease-out), background-color 200ms var(--ease-out), border-color 200ms var(--ease-out), color 200ms; }
.qa-kind .qa-e { font-size: 26px; line-height: 1; transition: transform 200ms var(--ease-out); }
.qa-kind.on { background: rgba(77,141,255,.2); border-color: var(--accent); color: var(--text); }
.qa-kind.on .qa-e { transform: scale(1.12); }
.qa-kind:active { transform: scale(.96); }
.qa-kind.pop .qa-e { animation: mood-bounce 420ms var(--ease-out); }
.qa-row { display: grid; gap: 6px; }
.qa-amount { display: flex; align-items: center; gap: 8px; }
.qa-amount input { font: 700 28px var(--display); flex: 1; min-width: 0; }
.qa-amount span { font: 700 24px var(--display); color: var(--muted); }
.qa-save { min-height: 52px; font-size: 17px; }
@media (prefers-reduced-motion: reduce) { .qa-kind, .qa-kind .qa-e, .qa-kind.pop .qa-e { transition: none; animation: none; } }
/* ---------- WEB-23: capturas y enlaces ---------- */
.qa-shared { display: grid; gap: 8px; }
.qa-attach-row { display: flex; gap: 8px; }
.qa-attach { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--accent); font: 600 15px var(--font); cursor: pointer; }
.qa-thumb { position: relative; width: 100%; max-height: 220px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.qa-thumb img { display: block; width: 100%; max-height: 220px; object-fit: cover; }
.qa-thumb button { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; }
.qa-ai { display: grid; gap: 4px; }
.qa-note { margin: 0; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.05); color: var(--muted); }
.thumb { flex: none; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: rgba(255,255,255,.05); cursor: pointer; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-img { display: block; max-width: 220px; max-height: 260px; border-radius: 14px; margin-bottom: 6px; object-fit: cover; }
.viewer { display: block; width: 100%; height: auto; border-radius: 18px; margin-top: 12px; }
/* ---------- WEB-24: la hoja cabe con el teclado ---------- */
.sheet { max-height: min(88vh, calc(100% - 8px)); }
.qa-head { position: sticky; top: -10px; z-index: 2; padding-top: 4px; background: var(--glass-strong); }
/* ---------- WEB-25: proyectos (tipo NotebookLM) y capturas en el chat ---------- */
.tab { font-size: 9.5px; letter-spacing: -0.1px; }
.tab svg { width: 22px; height: 22px; }
.proj-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.proj-card { display: grid; gap: 4px; justify-items: start; text-align: left; padding: 14px; min-height: 110px; border-radius: 20px; border: 1px solid var(--line); background: rgba(17,19,24,.66); color: var(--text); font: 16px var(--font); cursor: pointer; transition: transform 140ms var(--ease-out); }
.proj-card:active { transform: scale(.97); }
.proj-e { font-size: 30px; line-height: 1; }
.proj-e.big { font-size: 44px; }
.proj-head { display: flex; align-items: center; gap: 12px; margin: 6px 0 12px; }
.proj-head h1 { margin: 0; }
.proj-new { display: grid; grid-template-columns: 56px 1fr auto; gap: 8px; }
.proj-new #projEmoji { text-align: center; font-size: 22px; padding: 0; }
.composer-inline { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.proj-chat { display: grid; gap: 8px; margin-top: 6px; }
.proj-chat .bubble { max-width: 100%; }
.cites { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cites .chip { font-size: 12px; }
.src-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.08); font-size: 12px; flex: none; }
.segmented.three { grid-template-columns: repeat(3, 1fr); }
.danger-link { color: var(--danger); justify-self: center; }
.composer-attach { display: grid; place-items: center; width: 40px; min-height: 40px; border-radius: 50%; background: rgba(255,255,255,.07); font-size: 18px; cursor: pointer; flex: none; }
.chat-attach { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 18px; margin-bottom: 8px; }
.chat-attach img { width: 52px; height: 52px; object-fit: cover; border-radius: 10px; }
.chat-attach { position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 78px); z-index: 2; }
/* ---------- WEB-26: con el teclado abierto ---------- */
body.kb .tabbar, body.kb #fab { opacity: 0; pointer-events: none; transform: translateY(20px); transition: opacity 150ms ease, transform 150ms ease; }
body.kb .composer { position: fixed; left: max(12px, calc(50% - 248px)); right: max(12px, calc(50% - 248px)); top: calc(var(--kb-bottom, 100dvh) - 68px); bottom: auto; margin: 0; z-index: 40; }
body.kb .chat-attach { position: fixed; left: max(12px, calc(50% - 248px)); right: max(12px, calc(50% - 248px)); top: calc(var(--kb-bottom, 100dvh) - 146px); bottom: auto; margin: 0; z-index: 40; }
body.kb .chat { padding-bottom: 84px; }
body.kb .chat > * { scroll-margin-bottom: 84px; }
.proposal-what { margin: 8px 0 4px; }
.ai-call.done { border-color: rgba(61,220,151,.35); } .ai-offer { gap: 6px; margin-bottom: 8px; }
/* ---------- WEB-30: zona inferior limpia ---------- */
/* A fade under the floating bars so the scrolling content never reads through them. */
body::after { content: ""; position: fixed; left: 0; right: 0; bottom: 0; z-index: 7; pointer-events: none; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 56px); background: linear-gradient(to bottom, rgba(5,6,8,0), var(--bg) 55%); }
body[data-screen="manu"]::after { height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 112px); background: linear-gradient(to bottom, rgba(5,6,8,0), var(--bg) 38%); }
body.kb::after { top: auto; bottom: calc(100% - var(--kb-bottom, 100%)); height: 96px; background: linear-gradient(to bottom, rgba(5,6,8,0), var(--bg) 45%); }
.composer, .chat-attach { z-index: 8; }
/* The newest message is always scrolled clear of the composer and the tab bar. */
.chat > * { scroll-margin-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 100px); }
/* The «M» is a little larger than the icons; keep every label on the same line. */
.tab .dot { width: 26px; height: 26px; margin-block: -2px; font-size: 14px; }
/* ---------- WEB-31: páginas cortas en la app instalada de iOS ---------- */
/* With «black-translucent», iOS lays out a document shorter than the screen as
   if it were one status bar shorter: the tab bar rises and a black band shows
   below. Every page is at least the full screen tall, like the long ones. */
html { min-height: calc(100% + env(safe-area-inset-top, 0px)); } /* no background here: the body colour must reach the canvas so the .ambient layer (z-index -1) shows */
.app { min-height: 100dvh; box-sizing: border-box; }
/* ---------- WEB-32: sin «+»; la barra ocupa todo el ancho ---------- */
.tabbar { left: max(12px, calc(50% - 260px)); right: max(12px, calc(50% - 260px)); width: auto; }
/* ---------- WEB-33: correo ---------- */
.card a.row { color: inherit; text-decoration: none; }
.mail-sender + .mail-sender { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
/* ---------- WEB-34: tu archivo ---------- */
.arch-hit { border-top: 1px solid var(--line); padding: 10px 0; }
.arch-hit summary { cursor: pointer; list-style: none; }
.arch-hit .stack { margin-top: 10px; max-height: 60vh; overflow-y: auto; }
/* ---------- WEB-35: perfil ---------- */
.profile-text { white-space: pre-wrap; font-size: 15px; line-height: 1.5; }
#profileText { width: 100%; min-height: 280px; font: inherit; font-size: 15px; }
/* ---------- WEB-36: seis escenas del tiempo (sol mucho, sol, sol con nubes, nubes, lluvia, tormenta) ---------- */
/* Only transform and opacity move; no blur. Shapes are real elements so a
   redraw can resume them (syncAnimations) instead of restarting. */
.scene { contain: strict; }
.scene-sun::before, .scene-hot::before { content: none; }
.scene b { position: absolute; display: block; will-change: transform, opacity; backface-visibility: hidden; }
.wx-emoji.big, .wx-emoji.xl { will-change: transform; }
/* sol */
.scene .sun { width: 120px; height: 120px; right: -18px; top: -34px; border-radius: 50%; background: radial-gradient(circle, #fff7da 0 20%, #ffd45e 30%, rgba(255,190,80,.5) 45%, rgba(255,170,60,0) 70%); animation: sun-breathe 5s ease-in-out infinite alternate; }
.scene .sun.hot { width: 180px; height: 180px; right: -48px; top: -60px; background: radial-gradient(circle, #fffbe9 0 18%, #ffc23a 28%, rgba(255,140,40,.62) 46%, rgba(255,100,40,0) 72%); animation-duration: 3.5s; }
.scene .rays { width: 260px; height: 260px; right: -88px; top: -104px; border-radius: 50%; background: repeating-conic-gradient(rgba(255,226,150,.22) 0deg 7deg, rgba(255,226,150,0) 7deg 20deg); -webkit-mask: radial-gradient(circle, #000 18%, transparent 68%); mask: radial-gradient(circle, #000 18%, transparent 68%); animation: rays-spin 70s linear infinite; }
.scene .rays.fast { width: 340px; height: 340px; right: -128px; top: -140px; animation-duration: 40s; background: repeating-conic-gradient(rgba(255,200,110,.28) 0deg 8deg, rgba(255,200,110,0) 8deg 18deg); }
.scene .haze { left: 0; right: 0; bottom: 0; height: 45%; background: linear-gradient(rgba(255,140,60,0), rgba(255,140,60,.2)); animation: haze 4s ease-in-out infinite alternate; }
@keyframes sun-breathe { from { transform: scale(.94); opacity: .85; } to { transform: scale(1.06); opacity: 1; } }
@keyframes rays-spin { to { transform: rotate(360deg); } }
@keyframes haze { from { opacity: .35; } to { opacity: .9; } }
/* nubes */
.scene .cloud { --cc: 255, 255, 255; width: 190px; height: 80px; opacity: .15;
  background: radial-gradient(circle at 30% 60%, rgba(var(--cc), 1) 0 18px, rgba(var(--cc), 0) 27px),
    radial-gradient(circle at 50% 40%, rgba(var(--cc), 1) 0 26px, rgba(var(--cc), 0) 36px),
    radial-gradient(circle at 70% 58%, rgba(var(--cc), 1) 0 20px, rgba(var(--cc), 0) 29px),
    radial-gradient(ellipse 42% 22% at 50% 72%, rgba(var(--cc), 1) 55%, rgba(var(--cc), 0) 100%);
  animation: cloud-move ease-in-out infinite alternate; }
.scene .cloud.c1 { left: -4%; top: 10%; animation-duration: 24s; }
.scene .cloud.c2 { left: 52%; top: 30%; animation-duration: 31s; animation-delay: -11s; }
.scene .cloud.c3 { left: 6%; top: 60%; animation-duration: 27s; animation-delay: -5s; }
.scene-sun-cloud .cloud.c1 { left: 34%; top: 4%; opacity: .2; }
.scene-sun-cloud .cloud.c2 { left: 58%; top: 40%; opacity: .12; }
.scene .cloud.dark { --cc: 170, 178, 200; opacity: .24; }
.scene-storm .cloud.dark { --cc: 140, 140, 170; opacity: .3; }
@keyframes cloud-move { from { transform: translate3d(-10%, 0, 0); } to { transform: translate3d(10%, 0, 0); } }
/* tormenta: fogonazo + rayo, a la vez */
.scene .flash { inset: 0; background: rgb(225, 225, 255); opacity: 0; animation: flash-o 7s linear infinite; }
.scene .bolt { left: 58%; top: 18%; width: 30px; height: 74px; background: #fff3a8; clip-path: polygon(45% 0, 100% 0, 62% 42%, 90% 42%, 20% 100%, 40% 55%, 8% 55%); opacity: 0; filter: drop-shadow(0 0 6px rgba(255,240,150,.9)); animation: bolt 7s linear infinite; }
@keyframes flash-o { 0%, 90%, 94.5%, 100% { opacity: 0; } 91%, 93% { opacity: .2; } }
@keyframes bolt { 0%, 90%, 94%, 100% { opacity: 0; } 90.6%, 92.5% { opacity: 1; } 91.6% { opacity: .35; } }
.scene-storm::after { content: none; }
/* fondo completo (Hoy y la página del tiempo) */
.sky .scene .sun { width: 46vmax; height: 46vmax; right: -14vmax; top: -18vmax; opacity: .55; }
.sky .scene .sun.hot { width: 62vmax; height: 62vmax; right: -24vmax; top: -28vmax; opacity: .45; }
.sky .scene .rays { width: 90vmax; height: 90vmax; right: -36vmax; top: -40vmax; opacity: .6; }
.sky .scene .rays.fast { width: 110vmax; height: 110vmax; right: -44vmax; top: -48vmax; }
.sky .scene .cloud { width: 80vw; height: 34vw; opacity: .16; }
.sky .scene .cloud.c1 { left: -12vw; top: 8vh; }
.sky .scene .cloud.c2 { left: 38vw; top: 26vh; }
.sky .scene .cloud.c3 { left: 4vw; top: 48vh; }
.sky .scene .cloud.dark { opacity: .2; }
.sky .scene .bolt { width: 60px; height: 150px; top: 14vh; }
.sky .scene .flash { background: rgb(200, 200, 255); }
/* colores de fondo de las escenas nuevas */
.sc-hot { background: linear-gradient(160deg, rgba(255,150,40,.55), rgba(255,90,40,.22) 45%, rgba(17,19,24,.92) 85%); }
.sc-sun-cloud { background: linear-gradient(160deg, rgba(255,190,90,.34), rgba(90,120,170,.35) 50%, rgba(17,19,24,.92)); }
body[data-wx="hot"] { --ambient-1: rgba(255,150,50,.32); --ambient-2: rgba(255,90,40,.14); }
body[data-wx="sun-cloud"] { --ambient-1: rgba(255,190,90,.20); --ambient-2: rgba(90,130,200,.14); }
body[data-screen="weather"][data-wx="hot"] .ambient { background: linear-gradient(180deg, #e0842f 0%, #b85a2a 40%, #3a2016 100%); }
body[data-screen="weather"][data-wx="sun-cloud"] .ambient { background: linear-gradient(180deg, #4f86c4 0%, #3a5f94 45%, #1c2c48 100%); }
body[data-screen="hoy"][data-wx="hot"] .ambient { background: linear-gradient(180deg, #7a4418 0%, #3f2412 38%, #0c0806 78%); }
body[data-screen="hoy"][data-wx="sun-cloud"] .ambient { background: linear-gradient(180deg, #2f5078 0%, #1c3050 38%, #0a0d14 78%); }
@media (prefers-reduced-motion: reduce) { .scene b { animation: none !important; } .scene .bolt, .scene .flash { display: none; } }

/* ---------- WEB-37: nueva conversación ---------- */
.chat-tools { display: flex; justify-content: flex-end; margin: 4px 0 6px; }

/* ---------- WEB-38: personas ---------- */
.bday { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }
.bday select { min-height: 44px; }
.check-row { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check-row input { width: 22px; height: 22px; }

/* ---------- WEB-40: la luz del día según el amanecer y el atardecer reales ---------- */
/* «Sol mucho» de día ya no es naranja: azul intenso y cálido. */
.sc-hot { background: linear-gradient(160deg, rgba(90,160,255,.5), rgba(255,200,90,.18) 55%, rgba(17,19,24,.92) 88%); }
body[data-wx="hot"] { --ambient-1: rgba(70,150,255,.28); --ambient-2: rgba(255,200,90,.12); }
body[data-screen="weather"][data-wx="hot"] .ambient { background: linear-gradient(180deg, #2f86e0 0%, #2266bd 45%, #123e78 100%); }
body[data-screen="hoy"][data-wx="hot"] .ambient { background: linear-gradient(180deg, #245e9e 0%, #173963 38%, #080c14 78%); }
/* Amanecer y atardecer: naranja, rojo y dorado (salvo con lluvia, tormenta, nieve o niebla). */
body[data-sky="dawn"]:not([data-wx="rain"]):not([data-wx="storm"]):not([data-wx="snow"]):not([data-wx="fog"]),
body[data-sky="dusk"]:not([data-wx="rain"]):not([data-wx="storm"]):not([data-wx="snow"]):not([data-wx="fog"]) { --ambient-1: rgba(255,140,60,.32); --ambient-2: rgba(230,70,90,.18); }
body[data-screen="weather"][data-sky="dawn"]:not([data-wx="rain"]):not([data-wx="storm"]):not([data-wx="snow"]):not([data-wx="fog"]) .ambient { background: linear-gradient(180deg, #f2b35e 0%, #e0764a 38%, #7a3552 70%, #26183a 100%); }
body[data-screen="weather"][data-sky="dusk"]:not([data-wx="rain"]):not([data-wx="storm"]):not([data-wx="snow"]):not([data-wx="fog"]) .ambient { background: linear-gradient(180deg, #e8964a 0%, #d0503f 36%, #6a2848 68%, #1c1230 100%); }
body[data-screen="hoy"][data-sky="dawn"]:not([data-wx="rain"]):not([data-wx="storm"]):not([data-wx="snow"]):not([data-wx="fog"]) .ambient { background: linear-gradient(180deg, #8a5a2c 0%, #5e2c34 38%, #0c0a10 78%); }
body[data-screen="hoy"][data-sky="dusk"]:not([data-wx="rain"]):not([data-wx="storm"]):not([data-wx="snow"]):not([data-wx="fog"]) .ambient { background: linear-gradient(180deg, #8a4526 0%, #5a2032 38%, #0c0810 78%); }
.hero.scene-card.ph-dawn:not(.sc-rain):not(.sc-storm):not(.sc-snow):not(.sc-fog) { background: linear-gradient(160deg, rgba(255,190,90,.5), rgba(230,90,70,.28) 50%, rgba(17,19,24,.92) 88%); }
.hero.scene-card.ph-dusk:not(.sc-rain):not(.sc-storm):not(.sc-snow):not(.sc-fog) { background: linear-gradient(160deg, rgba(255,150,60,.5), rgba(210,60,80,.3) 50%, rgba(17,19,24,.92) 88%); }
/* Noche: siempre oscuro, aunque el código diga «nublado». */
body[data-sky="night"] { --ambient-1: rgba(40,60,160,.22); --ambient-2: rgba(120,90,220,.10); }
body[data-screen="weather"][data-sky="night"] .ambient { background: linear-gradient(180deg, #101c4a 0%, #0a1030 50%, #04060f 100%); }
body[data-screen="hoy"][data-sky="night"] .ambient { background: linear-gradient(180deg, #0e1840 0%, #080d26 40%, #03040a 78%); }
.hero.scene-card.ph-night { background: linear-gradient(170deg, rgba(20,30,80,.85), rgba(8,10,28,.95) 75%); }
body[data-sky="night"] .scene .sun, body[data-sky="night"] .scene .rays, body[data-sky="night"] .scene .haze { display: none; }

/* ---------- WEB-40: error de Gmail ---------- */
.mail-error { border-color: rgba(255,180,80,.45); }
.mail-error ol { margin: 6px 0 4px; padding-left: 20px; display: grid; gap: 4px; }

/* ---------- WEB-45: «bajar» en el chat ---------- */
.chat-down { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 92px); width: 40px; height: 40px; margin-left: -20px; border-radius: 50%; border: 1px solid rgba(255,255,255,.14); color: var(--text); font-size: 18px; line-height: 1; z-index: 30; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.35); animation: chatDownIn .18s ease-out; }
.chat-down[hidden] { display: none; }
.chat-down.unseen::after { content: ""; position: absolute; top: 2px; right: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--blue, #246BFD); box-shadow: 0 0 0 2px var(--bg); }
body.kb .chat-down { bottom: auto; top: calc(var(--kb-bottom, 100dvh) - 124px); z-index: 41; }
@keyframes chatDownIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .chat-down { animation: none; } }

/* ---------- WEB-46: zonas táctiles de 44 px (HIG) sin cambiar el aspecto ---------- */
.check { position: relative; }
.check::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; }

/* ---------- WEB-46: tu día de un vistazo ---------- */
.brief-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.brief-list li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; line-height: 1.35; }
.brief-list li span:first-child { font-size: 18px; line-height: 1.2; }

/* ---------- WEB-47: presupuestos ---------- */
.bar.warn i { background: #f0a23b; }
.bar.over i { background: #ff5a5f; }
.budget-row { align-items: center; gap: 10px; }
.budget-form { display: grid; grid-template-columns: 1fr 96px auto; gap: 8px; margin-top: 10px; }
.budget-form select, .budget-form input { min-height: 44px; min-width: 0; }

/* ---------- WEB-48: buscar en todo ---------- */
.find-row { width: 100%; text-align: left; background: none; border: 0; color: inherit; padding: 10px 0; gap: 10px; min-height: 44px; font: inherit; cursor: pointer; border-top: 1px solid rgba(255,255,255,.06); }
.find-row:first-of-type { border-top: 0; }
.find-row .grow { min-width: 0; overflow-wrap: anywhere; }

/* ---------- WEB-49: categoría como botón (el desplegable solo al tocar) ---------- */
.cat-chip { min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.05); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; position: relative; }
.cat-chip::after { content: ""; position: absolute; inset: -4px 0; }

/* ---------- WEB-53: un texto largo sin espacios (una URL) no ensancha la página ---------- */
#screen, .toast, .sheet { overflow-wrap: anywhere; }
.brief-list li { grid-template-columns: 24px minmax(0, 1fr); }
.proj-grid > *, .proj-head > *, .row > .grow, .stack > * { min-width: 0; }
.proj-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- WEB-54: deslizar entre ciudades en el tiempo ---------- */
.city-dots { display: flex; justify-content: center; gap: 2px; margin: 4px 0 -4px; }
.city-dots button { width: 28px; height: 28px; border: 0; background: none; padding: 0; cursor: pointer; display: grid; place-items: center; }
.city-dots button::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.35); transition: background-color .2s var(--ease-out), transform .2s var(--ease-out); }
.city-dots button[aria-selected="true"]::before { background: #fff; transform: scale(1.15); }
.weather-head.slide-next, .weather-city.slide-next { animation: cityInNext .28s var(--ease-out); }
.weather-head.slide-prev, .weather-city.slide-prev { animation: cityInPrev .28s var(--ease-out); }
@keyframes cityInNext { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes cityInPrev { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .weather-head.slide-next, .weather-head.slide-prev, .weather-city.slide-next, .weather-city.slide-prev { animation: none; } }

/* WEB-58: «Ahora» — the one next thing */
.now-card { border-color: color-mix(in srgb, var(--accent, #246bfd) 45%, transparent); }
.now-card .now-main { font-size: 1.08rem; margin: .2rem 0 .1rem; overflow-wrap: anywhere; }
.now-card .btn { margin-top: .5rem; }
.now-card .now-more { margin-top: .6rem; opacity: .85; }

/* WEB-59: capture tray */
.cap-item { display: flex; gap: .7rem; align-items: flex-start; padding: .55rem 0; border-top: 1px solid var(--line, rgba(255,255,255,.08)); }
.cap-group h2 + .cap-item { border-top: 0; }
.cap-item .thumb { flex: 0 0 auto; }
.cap-item .btns { margin-top: .35rem; }
.cap-item p { overflow-wrap: anywhere; margin: 0; }

/* WEB-61: contact search results */
.contact-matches { display: grid; gap: .25rem; margin: .35rem 0 .2rem; max-height: 22rem; overflow-y: auto; }
.contact-row { display: flex; align-items: center; gap: .6rem; width: 100%; min-height: 44px; padding: .4rem .5rem; border-radius: 12px; background: var(--surface-2, rgba(255,255,255,.05)); color: inherit; text-align: left; border: 0; font: inherit; }
.contact-row .grow { min-width: 0; overflow-wrap: anywhere; }

/* WEB-62: hidden always wins over display rules (.check-row is flex) */
[hidden] { display: none !important; }

/* WEB-64: the SQL for «Tu nube» */
pre.code { white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; background: var(--surface-2, rgba(255,255,255,.06)); padding: 10px 12px; border-radius: 10px; max-width: 100%; overflow-x: auto; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.card.gentle { border-color: rgba(77,141,255,.35); }
/* Audit 2026-10: icon-only buttons get a 44×44 target (Apple HIG). */
.icon-btn { min-width: 44px; justify-content: center; }
.meter > i[data-level="warn"] { background: var(--orange, #ff9f0a); }
.meter > i[data-level="full"] { background: var(--red, #ff453a); }

/* WEB-74: fichaje */
.clock-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 8px; }
.clock-stats > div { display: grid; gap: 2px; }
.clock-stats b { font-size: 18px; }
.card.clock .chips { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.card.clock .chip { min-height: 44px; }
.balance-line { font-size: 22px; text-transform: none; letter-spacing: 0; color: var(--text); }
.balance-line.pos { color: var(--green, #30d158); }
.balance-line.neg { color: var(--orange, #ff9f0a); }
.clock-row { width: 100%; border: 0; background: none; color: inherit; text-align: left; min-height: 44px; gap: 10px; cursor: pointer; }
.clock-row .diff { min-width: 72px; text-align: right; }
.clock-row .diff.pos { color: var(--green, #30d158); }
.clock-row .diff.neg { color: var(--orange, #ff9f0a); }
.open-day .clock-row .diff { color: var(--orange, #ff9f0a); }
.clock-events { padding: 4px 0 8px 8px; border-left: 2px solid rgba(255,255,255,.08); }
.clock-events input[type="time"] { width: 7.5em; }
.month-nav { margin: 8px 0; }
.center { text-align: center; text-transform: capitalize; }

/* WEB-77: Tú → Avisos, one row per notice */
.nudge-row { align-items: center; gap: 12px; }
.nudge-row input[type="time"] { width: auto; flex: none; max-width: 7.5rem; }
.nudge-row input[type="time"]:disabled { opacity: .45; }

/* WEB-78: barra de comandos */
.cmdk-pill { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 10px 16px; border-radius: 16px; border: 1px solid var(--line, rgba(255,255,255,.08)); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.cmdk-pill .muted { font-size: .85em; }
.cmdk-bg { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: flex; justify-content: center; align-items: flex-start; padding: max(10vh, env(safe-area-inset-top)) 16px 16px; }
.cmdk-bg[hidden] { display: none; }
.cmdk { width: min(560px, 100%); border-radius: 20px; padding: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.5); background: var(--surface); border: 1px solid var(--glass-edge); }
.cmdk input { width: 100%; font-size: 17px; min-height: 48px; }
.cmdk-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 50vh; overflow-y: auto; }
.cmdk-item { min-height: 44px; display: flex; align-items: center; padding: 8px 12px; border-radius: 12px; cursor: pointer; }
.cmdk-item.on, .cmdk-item:hover { background: rgba(36,107,253,.22); }
.cmdk-help { margin: 8px 4px 0; }
@media (hover: none) { .cmdk-help { display: none; } }

/* WEB-83..85: repaso, documentos, biblioteca */
.review-h { margin: 10px 0 2px; text-transform: uppercase; letter-spacing: .04em; }
.doc summary, .lib summary { list-style: none; cursor: pointer; }
.doc summary::-webkit-details-marker, .lib summary::-webkit-details-marker { display: none; }
.doc .warn { color: var(--warm); font-weight: 600; }
.doc-form .row input, .doc-form .row select { flex: 1; min-width: 0; }

/* WEB-86 */
pre.code { white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto; background: var(--surface-2); border-radius: 12px; padding: 10px; }
.fixed-income .row { gap: 8px; }
