/* Foco — estilo inspirado en Streaks:
   fondo de color a pantalla completa, todo en blanco, íconos de línea,
   círculos grandes y etiquetas condensadas en mayúsculas. */

/* ───────────── Temas ───────────── */
:root {
  --c1: #2A2A2E; --c2: #000000; --accent: #0B0B0D;   /* Grafito (por defecto) */
  --text: #FFFFFF;
  --muted: rgba(255, 255, 255, .78);
  --faint: rgba(255, 255, 255, .5);
  --surface: rgba(255, 255, 255, .16);
  --surface-2: rgba(255, 255, 255, .13);
  --surface-3: rgba(255, 255, 255, .28);
  --line: rgba(255, 255, 255, .18);
  --ink: #FFFFFF;
  --on-ink: var(--accent);
  --sheet: color-mix(in srgb, var(--c2) 82%, #000);
  --radius: 20px;
  --tabbar-h: 60px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --glass: linear-gradient(145deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .04));
  --glass-border: rgba(255, 255, 255, .14);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 10px 30px rgba(0, 0, 0, .28);
  --glow: radial-gradient(60% 38% at 12% 0%, rgba(255, 255, 255, .17), transparent 70%),
          radial-gradient(45% 35% at 100% 42%, rgba(255, 255, 255, .09), transparent 70%),
          radial-gradient(70% 45% at 25% 100%, rgba(255, 255, 255, .08), transparent 70%);
  --cond: "Barlow Condensed", "DIN Condensed", "Roboto Condensed", "Arial Narrow", sans-serif;
  --round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  color-scheme: dark;
}
[data-theme="coral"]  { --c1: #FF8A5B; --c2: #F2545B; --accent: #EC5450; }
[data-theme="oceano"] { --c1: #4F86F7; --c2: #A35BE8; --accent: #6E6AF0; }
[data-theme="menta"]  { --c1: #22C1A4; --c2: #3A86DE; --accent: #1D9E9A; }
[data-theme="uva"]    { --c1: #8E54E9; --c2: #D9539E; --accent: #A54FCF; }
[data-theme="sol"]    { --c1: #F9B233; --c2: #F5663A; --accent: #EE7A2C; }
[data-theme="bosque"] { --c1: #4CAF6E; --c2: #1E7B6B; --accent: #2C8F69; }
[data-theme="noche"]  { --c1: #2E2E40; --c2: #15151C; --accent: #24243A; --surface: rgba(255, 255, 255, .09); --surface-2: rgba(255, 255, 255, .07); --surface-3: rgba(255, 255, 255, .2); --line: rgba(255, 255, 255, .1); --sheet: #1B1B26; }

/* ───────────── Base ───────────── */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { background: var(--c2); }
body {
  color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
  min-height: 100dvh;
}
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--glow), linear-gradient(170deg, var(--c1) 0%, var(--c2) 100%); }
body.locked { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: inherit; }
button:disabled { cursor: default; opacity: .35; }
input, textarea, select { font: inherit; color: inherit; }
option { color: #111; }
::placeholder { color: var(--faint); }
::-webkit-calendar-picker-indicator { filter: invert(1); opacity: .8; }
svg { display: block; }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }

#app { max-width: 560px; margin: 0 auto; padding: calc(var(--safe-t) + 18px) 16px calc(var(--tabbar-h) + var(--safe-b) + 110px); }

h1, h2, .eyebrow, .lbl, .group-title, .hname, .cond { font-family: var(--cond); text-transform: uppercase; }
h1 { font-size: 42px; line-height: .95; font-weight: 700; letter-spacing: .005em; }
h2 { font-size: 21px; font-weight: 700; letter-spacing: .04em; }
h3 { font-weight: 700; }
.num { font-family: var(--round); }
.eyebrow { color: var(--muted); font-size: 15px; font-weight: 600; letter-spacing: .08em; margin-bottom: 4px; }
.lead { color: var(--muted); font-size: 15px; margin-top: 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.spacer { flex: 1; }
.row { display: flex; gap: 10px; align-items: center; }

.view-enter { animation: viewIn .26s cubic-bezier(.2, .8, .2, 1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }

/* ───────────── Barra de pestañas + botón + ───────────── */
#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(0, 0, 0, .14);
  -webkit-backdrop-filter: saturate(160%) blur(22px); backdrop-filter: saturate(160%) blur(22px);
  border-top: 1px solid var(--line);
}
#tabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--faint); font-family: var(--cond); text-transform: uppercase; letter-spacing: .06em; font-size: 12px; font-weight: 600; transition: color .2s; }
#tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#tabs button.on { color: #fff; }
#tabs button.on svg { stroke-width: 2.3; }

#fab {
  position: fixed; z-index: 21;
  right: max(18px, calc(50% - 280px + 18px));
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px);
  width: 60px; height: 60px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; color: var(--accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
  transition: transform .15s;
}
#fab svg path { stroke-width: 2.8; }
#fab:active { transform: scale(.92); }

/* ───────────── Bloques ───────────── */
.section { margin-top: 30px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 2px 12px; min-height: 24px; }
.link { color: #fff; font-size: 14px; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.link.icon { text-decoration: none; color: var(--muted); width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; flex: none; }
.card { background: var(--surface); border-radius: var(--radius); }
.pad { padding: 16px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pill {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 13px; border-radius: 99px; background: var(--surface);
  font-weight: 700; font-size: 14px; font-family: var(--round);
}
.pill.hot { background: #fff; color: var(--accent); }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.tag.late { color: #fff; font-weight: 800; }
.tag.late::before { content: "!"; display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: #fff; color: var(--accent); font-size: 10px; font-weight: 900; }
.tag.soon { color: #fff; }
.empty { text-align: center; color: var(--muted); padding: 26px 18px; font-size: 15px; border: 1.5px dashed var(--surface-3); border-radius: var(--radius); }
.empty.small { padding: 16px; font-size: 14px; }
.empty .big { font-size: 28px; display: block; margin-bottom: 6px; color: #fff; }
.hint { font-size: 12px; color: var(--faint); margin-top: 10px; text-align: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 20px; border-radius: 99px;
  font-family: var(--cond); text-transform: uppercase; letter-spacing: .06em;
  font-weight: 700; font-size: 18px; background: var(--surface); color: #fff;
  transition: transform .12s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: #fff; color: var(--accent); }
.btn.danger { background: transparent; color: var(--muted); font-size: 15px; }
.btn.block { width: 100%; }
.btn.sm { height: 38px; padding: 0 16px; font-size: 15px; }

/* ───────────── Hoy ───────────── */
.hero { margin-top: 20px; padding: 18px; display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.ring-wrap { position: relative; width: 104px; height: 104px; }
.ring-wrap .center { position: absolute; inset: 0; display: grid; place-items: center; }
.ring-wrap .center b { font-family: var(--round); font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.ring-wrap .center small { font-size: 14px; font-weight: 700; color: var(--muted); }
svg .track { fill: none; stroke: rgba(255, 255, 255, .26); }
svg .prog { fill: none; stroke: #fff; stroke-linecap: round; animation: ringfill .7s cubic-bezier(.2, .8, .2, 1) both; }
svg .prog.zero { stroke-linecap: butt; }
@keyframes ringfill { from { stroke-dashoffset: var(--from); } to { stroke-dashoffset: var(--to); } }
.hero-text { min-width: 0; }
.hero-text .big { font-family: var(--cond); text-transform: uppercase; letter-spacing: .03em; font-size: 24px; font-weight: 700; display: block; line-height: 1.05; }
.hero-text p { color: var(--muted); font-size: 14.5px; margin-top: 4px; }
.need { margin-top: 10px; display: inline-flex; white-space: nowrap; font-family: var(--cond); text-transform: uppercase; letter-spacing: .03em; font-size: 13.5px; font-weight: 700; padding: 4px 12px; border-radius: 99px; border: 1.5px solid #fff; }
.need.won { background: #fff; color: var(--accent); }
.lvl { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; font-weight: 650; color: var(--muted); }
.lvl i { flex: 1; max-width: 90px; height: 4px; border-radius: 9px; background: linear-gradient(90deg, #fff calc(var(--p) * 100%), rgba(255, 255, 255, .25) 0); }

.ritual { margin-top: 12px; width: 100%; padding: 14px 16px; display: flex; align-items: center; gap: 14px; }
.ritual .ico { font-size: 22px; width: 28px; text-align: center; }
.ritual > span:nth-child(2) { flex: 1; }
.ritual b { display: block; font-family: var(--cond); text-transform: uppercase; letter-spacing: .05em; font-size: 19px; font-weight: 700; }
.ritual small { color: var(--muted); font-size: 13px; }
.ritual .chev { color: var(--faint); }
.close-day { margin-top: 30px; }
.close-day.evening:not(.closed) { background: #fff; color: var(--accent); }
.close-day.evening:not(.closed) small, .close-day.evening:not(.closed) .chev { color: var(--accent); opacity: .7; }

.intention { margin-top: 12px; display: flex; gap: 12px; align-items: center; padding: 12px 16px; min-height: 56px; }
.intention .ico { font-size: 18px; width: 28px; text-align: center; color: var(--muted); }
.intention input { flex: 1; border: 0; background: transparent; outline: none; font-size: 15.5px; min-width: 0; }
.intention .txt { flex: 1; font-weight: 650; font-size: 15.5px; }
.lbl { display: block; font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .08em; margin-bottom: 2px; }

/* Hábitos: círculos grandes */
.hgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 2px; }
@media (min-width: 460px) { .hgrid { grid-template-columns: repeat(5, 1fr); } }
.htile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 4px 2px; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.htile .ring { position: relative; width: 74px; height: 74px; transition: transform .15s; }
.htile:active .ring { transform: scale(.92); }
.htile .emo { position: absolute; inset: 7px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: #fff; transition: background .25s, color .25s; }
.htile .emo small { font-size: 10px; font-weight: 800; line-height: 1; min-height: 11px; }
.htile.done .emo { background: #fff; color: var(--accent); }
.htile .hname { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-align: center; line-height: 1.05; max-width: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.htile .hmeta { font-size: 11px; font-weight: 700; color: var(--muted); margin-top: -4px; }
.htile.pop .ring { animation: pop .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { 40% { transform: scale(1.1); } }

/* Jalones */
.puff { display: flex; gap: 12px; padding: 16px; align-items: stretch; }
.puff-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.puff-info .num { font-size: 44px; font-weight: 800; line-height: 1.05; letter-spacing: -.03em; margin: 2px 0 4px; }
.puff-info small { color: var(--muted); font-size: 12.5px; }
.puff-side { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; gap: 12px; }
.minibars { display: flex; align-items: flex-end; gap: 4px; height: 38px; }
.minibars i { width: 8px; border-radius: 3px; background: rgba(255, 255, 255, .3); }
.minibars i.now { background: #fff; }
.puff-btns { display: flex; gap: 8px; align-items: center; }
.round { width: 44px; height: 44px; border-radius: 50%; background: var(--surface); font-size: 22px; font-weight: 500; display: grid; place-items: center; }
.puff-add { height: 54px; min-width: 88px; padding: 0 18px; border-radius: 99px; background: #fff; color: var(--accent); font-family: var(--round); font-weight: 800; font-size: 21px; transition: transform .1s; }
.puff-add:active { transform: scale(.92); }

/* Tareas */
.energy-filter { display: flex; align-items: center; gap: 6px; margin: -2px 0 12px; overflow-x: auto; scrollbar-width: none; }
.energy-filter::-webkit-scrollbar { display: none; }
.energy-filter > span { margin-right: 4px; }
.energy-filter button { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: var(--surface); font-size: 13px; font-weight: 650; }
.energy-filter button.on { background: #fff; color: var(--accent); }
.energy { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; flex: none; }
.energy i { width: 3px; border-radius: 1px; background: rgba(255, 255, 255, .3); }
.energy i:nth-child(1) { height: 5px; } .energy i:nth-child(2) { height: 8px; } .energy i:nth-child(3) { height: 12px; }
.energy i.on { background: currentColor; }
.energy-filter button.on .energy i:not(.on) { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.task > .energy { color: #fff; margin: 0 6px; }

.group + .group { margin-top: 18px; }
.group-title { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; color: var(--muted); margin: 0 4px 8px; letter-spacing: .08em; }
.n { color: var(--faint); font-family: var(--round); font-weight: 700; }
.list { background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.task { display: flex; align-items: center; padding: 3px 6px 3px 2px; min-height: 54px; position: relative; transition: opacity .3s; }
.task + .task::before, .list > .pick + .pick .task::before { content: ""; position: absolute; top: 0; left: 50px; right: 0; height: 1px; background: var(--line); }
.check { flex: none; width: 46px; height: 46px; display: grid; place-items: center; }
.check i { width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .85); display: grid; place-items: center; transition: all .2s; }
.check svg { width: 14px; height: 14px; stroke: var(--accent); stroke-width: 3.2; fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(.5); transition: all .2s; }
.task.done .check i, .task.checking .check i { background: #fff; border-color: #fff; }
.task.done .check svg, .task.checking .check svg { opacity: 1; transform: scale(1); }
.task.checking .check i { animation: pop .4s cubic-bezier(.3, 1.6, .5, 1); }
.task.checking { opacity: .6; }
.task.checking .ttitle, .task.done .ttitle { text-decoration: line-through; color: var(--muted); }
.tbody { flex: 1; min-width: 0; padding: 8px 4px; display: flex; flex-direction: column; gap: 2px; }
.ttitle { font-size: 15.5px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.tmeta { display: flex; flex-wrap: wrap; gap: 3px 10px; }
.tmeta:empty { display: none; }
.side { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--faint); }
.side.on { color: var(--accent); background: #fff; }

.more { margin-top: 10px; }
.collapse + .collapse { border-top: 1px solid var(--line); }
.collapse-btn { display: flex; align-items: center; gap: 8px; width: 100%; padding: 13px 4px; font-family: var(--cond); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--muted); font-size: 16px; }
.collapse-btn .chev { margin-left: auto; transition: transform .2s; color: var(--faint); }
.collapse-btn.open .chev { transform: rotate(90deg); }
.collapse > .list { margin-bottom: 10px; }
.date-label { font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 12px 4px 6px; }
.collapse .list + .date-label { margin-top: 14px; }
.quote { margin: 30px auto 0; max-width: 340px; text-align: center; color: var(--muted); font-size: 14px; font-style: italic; }

/* ───────────── Hábitos (lista) ───────────── */
.hcard { padding: 14px 14px 12px; }
.hcard + .hcard { margin-top: 10px; }
.hhead { display: flex; align-items: center; gap: 12px; width: 100%; }
.hemo { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 2px solid rgba(255, 255, 255, .85); color: #fff; }
.hemo.big { width: 50px; height: 50px; }
.hemo.sm { width: 30px; height: 30px; border-width: 1.5px; }
.hinfo { flex: 1; min-width: 0; }
.hinfo b { display: block; font-family: var(--cond); text-transform: uppercase; letter-spacing: .04em; font-size: 20px; font-weight: 700; line-height: 1.1; }
.hinfo small { color: var(--muted); font-size: 12.5px; }
.hstreak { flex: none; display: flex; flex-direction: column; align-items: flex-end; line-height: 1; color: var(--faint); }
.hstreak .num { font-size: 26px; font-weight: 800; }
.hstreak small { font-family: var(--cond); text-transform: uppercase; letter-spacing: .06em; font-size: 12px; font-weight: 700; margin-top: 3px; }
.hstreak.on { color: #fff; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 12px; }
.dot { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 2px 0; }
.dot span { font-family: var(--cond); font-size: 12px; font-weight: 700; color: var(--faint); }
.dot i { font-style: normal; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; color: var(--muted); border: 1.5px solid rgba(255, 255, 255, .35); font-family: var(--round); transition: all .2s; }
.dot.off i { border-style: dashed; border-color: rgba(255, 255, 255, .22); color: var(--faint); }
.dot.part i { background: rgba(255, 255, 255, .3); color: #fff; }
.dot.done i { background: #fff; border-color: #fff; color: var(--accent); font-size: 15px; font-weight: 900; }
.dot.today span { color: #fff; }
.dot.future { cursor: default; }
.dot.today:not(.done) i { border-color: #fff; border-width: 2px; color: #fff; }
.nomiss { margin-top: 10px; font-size: 13px; padding: 8px 11px; border-radius: 12px; background: rgba(0, 0, 0, .12); }
.row-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; font-weight: 600; }
.row-btn + .row-btn { border-top: 1px solid var(--line); }
.row-btn .chev { margin-left: auto; color: var(--faint); }

/* Mapa de calor */
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); grid-auto-columns: 1fr; gap: 3px; }
.heat i { aspect-ratio: 1; border-radius: 3px; background: rgba(255, 255, 255, .1); }
.heat i.due { background: rgba(255, 255, 255, .2); }
.heat i.part { background: rgba(255, 255, 255, .5); }
.heat i.done { background: #fff; }
.heat i.none { background: transparent; }
.heat i.today { outline: 1.5px solid #fff; outline-offset: 1px; }
.heat-wrap { display: grid; grid-template-columns: 16px 1fr; grid-template-rows: auto 1fr; gap: 4px 6px; }
.heat-months { grid-column: 2; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; font-size: 10px; color: var(--muted); font-weight: 600; height: 13px; white-space: nowrap; }
.heat-days { display: grid; grid-template-rows: repeat(7, 1fr); gap: 3px; font-size: 9.5px; color: var(--faint); font-weight: 700; }
.heat-wrap .heat { grid-column: 2; }

/* ───────────── Proyectos ───────────── */
.seg { display: flex; padding: 3px; gap: 2px; background: rgba(0, 0, 0, .14); border-radius: 99px; margin-top: 18px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1; text-align: center; padding: 7px 10px; border-radius: 99px; font-family: var(--cond); text-transform: uppercase; letter-spacing: .05em; font-size: 15px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.seg button.on { background: #fff; color: var(--accent); }
.seg button.on .muted { color: var(--accent); opacity: .6; }
.seg + .empty { margin-top: 16px; }

.pcard { display: block; width: 100%; padding: 16px; }
.pcard + .pcard { margin-top: 10px; }
.phead { display: flex; gap: 12px; align-items: center; }
.pemo { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: rgba(255, 255, 255, .22); }
.pemo.big { width: 58px; height: 58px; font-size: 28px; }
.pinfo { flex: 1; min-width: 0; }
.pinfo h3 { font-family: var(--cond); text-transform: uppercase; letter-spacing: .04em; font-size: 21px; line-height: 1.1; }
.pinfo h1 { font-size: 32px; }
.sub { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.bar { height: 7px; border-radius: 99px; background: rgba(255, 255, 255, .25); overflow: hidden; margin-top: 14px; }
.bar i { display: block; height: 100%; border-radius: inherit; background: #fff; transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.next { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, .12); font-size: 14px; display: flex; gap: 8px; align-items: baseline; }
.next b { font-family: var(--cond); text-transform: uppercase; font-size: 13px; letter-spacing: .08em; flex: none; }

.back { display: inline-flex; align-items: center; gap: 2px; font-family: var(--cond); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; font-size: 18px; padding: 4px 0; margin-left: -6px; }
.phero { margin-top: 10px; padding: 18px; }
.why { margin-top: 14px; font-size: 15px; color: var(--muted); border-left: 2px solid #fff; padding-left: 10px; }
.why b { color: #fff; }
.nextcard { margin-top: 12px; padding: 12px 6px 4px; background: rgba(255, 255, 255, .24); }
.nextcard .lbl { padding: 0 12px; color: #fff; }

.timeline { position: relative; }
.ms { position: relative; padding-left: 40px; }
.ms + .ms { margin-top: 6px; }
.ms::before { content: ""; position: absolute; left: 14px; top: 36px; bottom: -10px; width: 2px; background: rgba(255, 255, 255, .25); }
.ms.add::before { display: none; }
.ms.done::before { background: #fff; }
.node { position: absolute; left: 2px; top: 13px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .45); display: grid; place-items: center; font-size: 12px; font-weight: 800; font-family: var(--round); color: var(--muted); background: transparent; }
.ms.current .node { border-color: #fff; color: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .2); }
.ms.done .node { background: #fff; border-color: #fff; color: var(--accent); }
.ms.add .node { border-style: dashed; color: var(--faint); top: 15px; }
.ms-head { display: flex; align-items: center; gap: 4px; }
.ms-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 12px 2px; }
.ms-title h3 { flex: 1; font-family: var(--cond); text-transform: uppercase; letter-spacing: .04em; font-size: 19px; }
.ms.done .ms-title h3 { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.ms-meta { display: flex; align-items: center; gap: 8px; flex: none; }
.badge { font-family: var(--cond); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 2px 8px; border-radius: 99px; background: #fff; color: var(--accent); }
.cnt { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.ms .list { margin-bottom: 8px; }
.addline { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 14px; min-height: 50px; }
.list .addline { border-top: 1px solid var(--line); }
.list .addline:first-child { border-top: 0; }
.addline span { color: var(--faint); font-size: 20px; width: 24px; text-align: center; }
.addline input { flex: 1; border: 0; background: transparent; outline: none; font-size: 15px; min-width: 0; padding: 8px 0; }
.addline.solo { border: 1.5px dashed var(--surface-3); border-radius: 16px; margin-top: 6px; }

/* ───────────── Progreso ───────────── */
.level { margin-top: 20px; padding: 18px; background: #fff; color: var(--accent); }
.level b { font-family: var(--cond); text-transform: uppercase; letter-spacing: .03em; font-size: 30px; font-weight: 700; }
.lvname { font-family: var(--cond); text-transform: uppercase; letter-spacing: .06em; font-size: 18px; font-weight: 700; opacity: .75; }
.level .bar { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.level .bar i { background: var(--accent); }
.level small { display: block; margin-top: 8px; font-size: 12.5px; opacity: .75; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { padding: 14px; }
.stat b { font-size: 30px; font-weight: 800; display: block; letter-spacing: -.02em; line-height: 1.1; }
.stat small { font-family: var(--cond); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-size: 14px; font-weight: 700; }
.stats.four { grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 6px; }
.stats.four .stat { padding: 12px 4px; text-align: center; background: var(--surface); border-radius: 16px; }
.stats.four .stat b { font-size: 22px; }
.stats.four .stat small { font-size: 12px; }
.chart { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; align-items: end; height: 150px; padding: 16px 16px 12px; }
.chart.dense { gap: 3px; height: 120px; padding: 14px 12px 10px; }
.col { display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; min-width: 0; }
.col .b { width: 100%; max-width: 30px; border-radius: 99px; background: rgba(255, 255, 255, .28); min-height: 3px; }
.chart.dense .b { border-radius: 3px; }
.col .b.won { background: #fff; }
.col .b.today { outline: 2px solid #fff; outline-offset: 2px; }
.col span { font-family: var(--cond); text-transform: uppercase; font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; height: 13px; }
.col em { font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--muted); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); padding: 0 16px 14px; }
.legend.inline { padding: 12px 0 0; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; background: rgba(255, 255, 255, .28); }
.legend i.won, .legend i.done { background: #fff; }
.legend i.part { background: rgba(255, 255, 255, .5); }
.legend i.due { background: rgba(255, 255, 255, .2); }
.wins { list-style: none; }
.wins li { padding: 12px 16px; display: flex; gap: 12px; font-size: 15px; }
.wins li + li { border-top: 1px solid var(--line); }
.wins .d { flex: none; font-size: 12px; font-weight: 700; color: var(--muted); width: 54px; padding-top: 2px; }
.settings .item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; min-height: 54px; }
.settings .item + .item { border-top: 1px solid var(--line); }
.settings .item > span:first-child { flex: 1; font-weight: 600; }
.settings .item .chev { color: var(--faint); }
.settings .item.danger span { color: var(--muted); }
.settings input[type="text"], .settings input[type="time"] { border: 0; background: transparent; text-align: right; outline: none; min-width: 0; color: var(--muted); }
.settings input[type="text"] { flex: 1; }
.settings .themes { flex-wrap: wrap; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.sw { width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .5); }
.sw.on { box-shadow: 0 0 0 2.5px #fff; transform: scale(.88); }

/* ───────────── Hoja inferior ───────────── */
#sheet-root { position: fixed; inset: 0; z-index: 50; display: none; }
#sheet-root.open { display: block; }
.backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .35); opacity: 0; transition: opacity .25s; }
#sheet-root.show .backdrop { opacity: 1; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px;
  max-height: calc(100dvh - var(--safe-t) - 20px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--glow), linear-gradient(170deg, var(--c1), var(--c2)); border-radius: 26px 26px 0 0; border-top: 1px solid var(--glass-border);
  padding: 4px 18px calc(var(--safe-b) + 22px);
  transform: translateY(100%); transition: transform .32s cubic-bezier(.2, .9, .25, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .25);
}
#sheet-root.show .sheet { transform: translateY(0); }
.sheet.dragging { transition: none; }
.grabber { display: block; width: 100%; height: 22px; position: relative; }
.grabber::after { content: ""; position: absolute; left: 50%; top: 8px; width: 38px; height: 5px; margin-left: -19px; border-radius: 9px; background: rgba(255, 255, 255, .4); }
.sheet h2 { margin: 2px 0 14px; font-size: 28px; }
.sheet .head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.sheet .head h2 { margin: 0; }
.sheet .seg { margin-top: 0; }
.field { margin-top: 18px; }
.field > .lbl { margin: 0 2px 8px; }
.input { width: 100%; border: 0; outline: none; background: rgba(255, 255, 255, .15); border-radius: 14px; padding: 13px 14px; font-size: 16px; color: #fff; }
.input:focus { background: rgba(255, 255, 255, .22); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .6); }
.input.big { font-size: 19px; font-weight: 650; padding: 15px; }
textarea.input { resize: none; min-height: 84px; line-height: 1.4; }
select.input { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, #fff 50%), linear-gradient(135deg, #fff 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span, .chip.btnchip { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 99px; background: rgba(255, 255, 255, .15); font-size: 14.5px; font-weight: 600; color: #fff; transition: all .15s; }
.chip input:checked + span { background: #fff; color: var(--accent); }
.chip input[type="date"] { position: static; opacity: 1; pointer-events: auto; border: 0; outline: none; background: rgba(255, 255, 255, .15); border-radius: 99px; padding: 8px 12px; font-size: 14px; color: #fff; min-height: 40px; }
.chip input[type="date"].set { background: #fff; color: var(--accent); }
.chip input[type="date"].set::-webkit-calendar-picker-indicator { filter: none; }
.chips.days .chip span { width: 42px; justify-content: center; padding: 9px 0; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 8px; }
.icon-opt { cursor: pointer; }
.icon-opt input { display: none; }
.icon-opt span { display: grid; place-items: center; aspect-ratio: 1; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .35); color: #fff; transition: all .15s; }
.icon-opt input:checked + span { background: #fff; color: var(--accent); border-color: #fff; }
.emoji-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.emoji-row button { width: 40px; height: 40px; border-radius: 50%; font-size: 20px; background: rgba(255, 255, 255, .15); }
.emoji-input { width: 64px !important; flex: none; text-align: center; font-size: 26px !important; padding: 10px !important; }
.parsed { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.parsed span { font-size: 12.5px; font-weight: 700; background: #fff; color: var(--accent); padding: 4px 10px; border-radius: 99px; }
.tip { font-size: 12.5px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.tip code { font-family: inherit; font-weight: 700; color: #fff; background: rgba(255, 255, 255, .15); padding: 1px 6px; border-radius: 6px; }
.actions { display: flex; gap: 10px; margin-top: 24px; }
.actions .btn { flex: 1; }
.moods { display: flex; gap: 6px; }
.moods label { flex: 1; }
.moods input { display: none; }
.moods span { display: grid; place-items: center; height: 56px; border-radius: 16px; background: rgba(255, 255, 255, .13); font-size: 26px; opacity: .6; transition: all .15s; cursor: pointer; }
.moods input:checked + span { opacity: 1; background: #fff; transform: scale(1.04); }
.review-list .task { padding-left: 14px; }
.review-list .task::before { left: 14px !important; }
.mini { display: flex; gap: 3px; flex: none; }
.mini button { font-size: 12px; font-weight: 700; padding: 6px 9px; border-radius: 99px; color: #fff; background: rgba(255, 255, 255, .15); }
.mini button.on { background: #fff; color: var(--accent); }
.summary-big { text-align: center; padding: 6px 0 2px; }
.summary-big b { font-size: 60px; font-weight: 800; display: block; letter-spacing: -.04em; line-height: 1; margin-bottom: 6px; }
.identity { margin-top: 16px; padding: 14px 16px; border-radius: 16px; background: rgba(255, 255, 255, .13); }
.identity q { font-weight: 700; font-size: 16px; quotes: "“" "”"; }
.identity p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.place-row { display: flex; gap: 8px; align-items: center; padding: 4px 8px 4px 16px; }
.place-row + .place-row { border-top: 1px solid var(--line); }
.place-row input { border: 0; background: transparent; outline: none; padding: 12px 0; min-width: 0; flex: 1; font-weight: 600; }
.place-row button { color: var(--faint); width: 36px; height: 36px; }
.welcome { text-align: center; padding: 12px 4px 0; }
.welcome .logo { width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 50%; background: #fff; color: var(--accent); display: grid; place-items: center; font-size: 44px; }
.welcome h1 { font-size: 56px; }
.welcome > p { margin: 8px auto 0; max-width: 320px; color: var(--muted); }
.features { list-style: none; text-align: left; margin: 22px 0; background: rgba(255, 255, 255, .12); border-radius: 18px; }
.features li { padding: 12px 16px; font-size: 14.5px; color: var(--muted); }
.features li + li { border-top: 1px solid var(--line); }
.features b { color: #fff; font-family: var(--cond); text-transform: uppercase; letter-spacing: .05em; font-size: 16px; }
.welcome .tip { text-align: left; }
.steps { padding-left: 22px; display: grid; gap: 10px; font-size: 15.5px; }

/* ───────────── Aviso + confeti ───────────── */
#toast {
  position: fixed; left: 50%; z-index: 60;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 90px);
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 16px;
  max-width: calc(100% - 32px); width: max-content;
  background: #fff; color: var(--accent); padding: 12px 18px; border-radius: 99px;
  font-weight: 700; font-size: 14.5px; box-shadow: 0 8px 30px rgba(0, 0, 0, .2);
  transition: all .3s cubic-bezier(.2, .9, .25, 1);
}
#toast.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
#toast button { color: var(--accent); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 70; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ───────────── Cristal ───────────── */
/* Tarjetas, círculos y controles como vidrio esmerilado translúcido. */
.card, .list, .pill, .round, .seg, .energy-filter button, .hemo, .pemo, .stats.four .stat,
.identity, .features, .nextcard, .level, .dot i, .icon-opt span, .chip span, .chip.btnchip,
.chip input[type="date"], .input, .moods span, .mini button, .emoji-row button, .tip code {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}
.list .task, .dot i, .chip span, .mini button, .tip code, .icon-opt span { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); }
.level { color: #fff; }
.level .bar { background: rgba(255, 255, 255, .18); }
.level .bar i { background: #fff; }
.input:focus { border-color: rgba(255, 255, 255, .5); }

/* Círculos de hábito: vidrio por dentro, anillo blanco */
.htile .emo {
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .2), rgba(255, 255, 255, .04) 70%);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
svg .track { stroke: rgba(255, 255, 255, .16); }

/* "Hecho" = blanco sólido con brillo, ícono negro */
.htile.done .emo, .dot.done i, .chip input:checked + span, .icon-opt input:checked + span, .mini button.on,
.seg button.on, .energy-filter button.on, .pill.hot, .need.won, .side.on, .badge, .ms.done .node, .moods input:checked + span,
.btn.primary, #fab, .puff-add, .parsed span, .close-day.evening:not(.closed) {
  background: linear-gradient(160deg, #FFFFFF 0%, #E4E4E6 100%);
  color: var(--accent);
  border-color: #fff;
}
.task.done .check i, .task.checking .check i { background: linear-gradient(160deg, #FFFFFF, #E4E4E6); }

/* ───────────── Cuenta ───────────── */
body.auth-mode #tabs, body.auth-mode #fab { display: none; }
.auth { min-height: calc(100dvh - var(--safe-t) - 60px); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 20px 4px 40px; }
.auth .logo { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 16px; background: linear-gradient(160deg, #fff, #e4e4e6); color: var(--accent); box-shadow: 0 10px 40px rgba(255, 255, 255, .12); }
.auth h1 { font-size: 56px; }
.auth > p { margin: 8px auto 26px; max-width: 300px; }
.auth-form { width: 100%; max-width: 360px; display: grid; gap: 10px; }
.auth-form .btn { margin-top: 6px; }
.auth-msg { font-size: 14px; color: #fff; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .1); text-align: left; }
.auth-links { display: flex; gap: 18px; justify-content: center; margin-top: 18px; }
.auth-links button { color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.loading { min-height: 60dvh; display: grid; place-items: center; font-family: var(--cond); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-size: 18px; }
