@font-face { font-family: 'Space Grotesk'; src: url('../fonts/space-grotesk-latin-wght-normal.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/inter-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('../fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2'); font-weight: 100 800; font-display: swap; }

:root {
  --bg: #000; --s1: #050505; --s2: #111; --l1: #1c1c1c; --l2: #2a2a2a; --l3: #444;
  --t1: #fff; --t2: #b4b4b4; --t3: #7c7c7c; --t4: #555;
  --head: 'Space Grotesk', system-ui, sans-serif; --body: 'Inter', system-ui, sans-serif; --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.3, 1.4, .5, 1);
  --sab: env(safe-area-inset-bottom, 0px); --sat: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--t1); font-family: var(--body); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden; min-height: 100vh; min-height: 100dvh; }
h1, h2, h3 { font-family: var(--head); font-weight: 500; margin: 0; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(30px, 4.2vw, 54px); line-height: 1.05; }
p { margin: 0; }
.outline { color: transparent; -webkit-text-stroke: 1.2px #fff; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
:focus-visible { outline: 1px solid #fff; outline-offset: 3px; border-radius: 6px; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.dimtxt { color: var(--t3); }
.small { font-size: 13px; }
.ico { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }

#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; pointer-events: none; }
#view { position: relative; z-index: 1; opacity: 0; transform: translateY(10px); transition: opacity .35s var(--ease), transform .5s var(--ease); }
#view.in { opacity: 1; transform: none; }

/* ---------- Pantalla de carga ---------- */
#loader { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding: 0 24px calc(12vh + var(--sab)); transition: background .5s var(--ease), opacity .4s var(--ease); }
#loader.see { background: transparent; }
.intro { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; pointer-events: none; }
.in-l { overflow: hidden; font-family: var(--head); font-weight: 500; font-size: clamp(52px, 11vw, 150px); line-height: 1.02; letter-spacing: -0.03em; padding: 0 .08em .06em; }
.in-l span { display: block; transform: translateY(112%); }
.in-line { width: min(520px, 62vw); height: 1px; background: #fff; transform: scaleX(0); margin-top: 22px; }
#loader.play .in-l span { animation: inUp .9s var(--ease) forwards; }
#loader.play .in-l + .in-l span { animation-delay: .14s; }
#loader.play .in-line { animation: inLine 1.25s .25s var(--ease) forwards; }
#loader.play .ld-n, #loader.play .ld-track, #loader.play #ld-txt { opacity: 0; transition: opacity .3s; }
#loader.out .intro { transform: scale(1.06); transition: transform .45s var(--ease); }
@keyframes inUp { to { transform: none; } }
@keyframes inLine { to { transform: scaleX(1); } }
body.intro-on #view, body.intro-on #dock { opacity: 0; }
#dock { transition: opacity .5s var(--ease); }
#loader.out { opacity: 0; pointer-events: none; }
.ld-n { font-family: var(--mono); font-size: 44px; font-weight: 300; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ld-track { width: min(280px, 70vw); height: 1px; background: var(--l2); margin: 14px 0 12px; }
#ld-bar { height: 1px; background: #fff; transform: scaleX(0); transform-origin: left; }

/* ---------- Cursor ---------- */
.has-cur, .has-cur button, .has-cur a, .has-cur label { cursor: none; }
#cur { position: fixed; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: #fff; z-index: 100; pointer-events: none; mix-blend-mode: difference; transition: width .25s var(--ease), height .25s var(--ease), left .25s var(--ease), top .25s var(--ease), opacity .2s; }
#cur.big { width: 34px; height: 34px; left: -17px; top: -17px; }
#cur.txt { opacity: 0; }
#cur.down { width: 5px; height: 5px; left: -2.5px; top: -2.5px; }

/* ---------- Dock flotante ---------- */
#dock { position: fixed; left: 50%; bottom: calc(16px + var(--sab)); transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 2px; padding: 6px 8px; border: 1px solid var(--l2); border-radius: 999px; background: rgba(0, 0, 0, .8); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.dk { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: var(--t3); position: relative; transition: color .25s, transform .3s var(--spring), background .25s; }
.dk:hover { color: #fff; transform: translateY(-3px); }
.dk:active { transform: scale(.9); }
.dk.on { color: #fff; }
.dk.on::after { content: ""; position: absolute; bottom: 3px; left: 50%; width: 3px; height: 3px; margin-left: -1.5px; border-radius: 50%; background: #fff; }
.dk-plus { border: 1px solid var(--l3); color: #fff; margin-left: 4px; }
.dk-plus:hover { background: #fff; color: #000; }
.dk-sep { width: 1px; height: 22px; background: var(--l2); margin: 0 6px; }
.dk[data-tip]::before { content: attr(data-tip); position: absolute; bottom: 54px; left: 50%; transform: translate(-50%, 6px); font-family: var(--mono); font-size: 11px; white-space: nowrap; padding: 4px 9px; border: 1px solid var(--l2); border-radius: 999px; background: #000; color: #fff; opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s var(--ease); }
@media (hover: hover) { .dk[data-tip]:hover::before { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Tarjetas ---------- */
.card { position: relative; border: 1px solid var(--l1); border-radius: 18px; background: rgba(0, 0, 0, .72); padding: 20px 22px; transition: transform .6s var(--ease), border-color .35s; will-change: transform; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, .055), transparent 60%); opacity: 0; transition: opacity .35s; pointer-events: none; }
.card.tilting { transition: transform .1s linear, border-color .35s; border-color: #343434; }
.card.tilting::before { opacity: 1; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card-h h2 { font-family: var(--mono); font-size: 12px; font-weight: 400; letter-spacing: .04em; color: var(--t3); text-transform: none; }
.rv { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .8s var(--ease), border-color .35s; }
.rv.in { opacity: 1; transform: none; }
.rv.in.tilting { transition: transform .1s linear, border-color .35s; }

.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--l1); }
.row:last-child { border-bottom: 0; }
.row-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 11px 0; min-height: 44px; }
.row-t { min-width: 0; overflow-wrap: anywhere; background: linear-gradient(var(--t3), var(--t3)) left 55% / 0 1px no-repeat; transition: background-size .4s var(--ease), color .3s; }
.row.done:not(.keep) .row-t { color: var(--t3); background-size: 100% 1px; }
.row-x { color: var(--t4); width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; opacity: 0; transition: opacity .2s, color .2s; }
.row:hover .row-x, .row-x:focus-visible { opacity: 1; }
.row-x:hover { color: #fff; }
@media (hover: none) { .row-x { opacity: 1; } }
.racha { color: var(--t2); }

.cb { width: 20px; height: 20px; flex: none; border: 1px solid var(--l3); border-radius: 50%; position: relative; transition: border-color .25s, transform .3s var(--spring); }
.cb svg { width: 100%; height: 100%; display: block; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 16; stroke-dashoffset: 16; }
.cb.on { border-color: #fff; }
.cb.on svg { stroke-dashoffset: 0; }
.cb.just svg { animation: draw .35s .05s var(--ease) backwards; }
.cb.just::after { content: ""; position: absolute; inset: -1px; border: 1px solid #fff; border-radius: 50%; animation: ring .65s ease-out forwards; }
.cb.just { animation: pop .4s var(--spring); }
.row-main:hover .cb { border-color: #fff; }
.row-main:active .cb { transform: scale(.85); }
@keyframes draw { from { stroke-dashoffset: 16; } to { stroke-dashoffset: 0; } }
@keyframes ring { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(2.6); } }
@keyframes pop { 40% { transform: scale(1.18); } }

.slot { display: flex; align-items: center; gap: 12px; padding: 11px 0; min-height: 44px; color: var(--t3); border-bottom: 1px dashed var(--l1); width: 100%; transition: color .25s, padding .3s var(--ease); }
.slot:last-child { border-bottom: 0; }
.slot:hover { color: #fff; padding-left: 6px; }
.ok-line { font-family: var(--head); font-size: 17px; }

.lnk { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 12px; color: var(--t3); align-self: flex-start; transition: color .25s, gap .3s var(--ease); padding: 4px 0; }
.lnk:hover { color: #fff; gap: 10px; }
.btn { display: inline-flex; justify-content: center; align-items: center; padding: 11px 20px; border: 1px solid var(--l3); border-radius: 999px; background: linear-gradient(#fff, #fff) left / 0 100% no-repeat; transition: background-size .4s var(--ease), color .3s, transform .15s, border-color .3s; }
.btn:hover { background-size: 100% 100%; color: #000; border-color: #fff; }
.btn:active { transform: scale(.96); }
.btn.ghost { border-color: var(--l2); color: var(--t2); }
.btn.wide { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.big-wrap { display: flex; align-items: baseline; gap: 8px; }
.big-n { font-family: var(--mono); font-size: 52px; font-weight: 300; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.blk { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--l1); }
.blk:last-child { border-bottom: 0; }
.blk-h { color: var(--t2); }
.blk.now .blk-h, .blk.now .mono:last-child { color: #fff; }
.frase { font-family: var(--head); font-size: clamp(19px, 2vw, 24px); line-height: 1.3; letter-spacing: -0.01em; text-wrap: balance; }
.goal { padding: 10px 0; display: flex; flex-direction: column; gap: 8px; }
.goal-h { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.bar { height: 1px; background: var(--l2); }
.bar i { display: block; height: 1px; background: #fff; transform: scaleX(0); transform-origin: left; transition: transform 1.1s var(--ease); }
.celebra { animation: celebra 1.1s var(--ease); }
@keyframes celebra { 20% { border-color: #fff; box-shadow: 0 0 0 1px #fff, 0 0 60px rgba(255, 255, 255, .18); } }

.aviso { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border: 1px dashed var(--l2); border-radius: 14px; padding: 10px 16px; font-size: 13px; color: var(--t2); background: rgba(0, 0, 0, .72); }
.aviso .lnk { color: #fff; align-self: auto; }
.aviso-wrap:empty { display: none; }
.empezar h2 { font-size: 22px; }

/* ---------- Pantalla Hoy ---------- */
.hoy { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; max-width: 1240px; margin: 0 auto; padding: 0 40px; }
.hoy-hero { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; padding: 48px 0 120px; pointer-events: none; }
.hero-space { flex: 1; min-height: 0; }
.hero-txt { display: flex; flex-direction: column; gap: 10px; }
.etapa { color: var(--t2); min-height: 18px; }
.etapa.sw { animation: sw .6s var(--ease); }
@keyframes sw { from { opacity: 0; transform: translateY(8px); letter-spacing: .3em; } }
.hoy-col { display: flex; flex-direction: column; gap: 16px; padding: 56px 0 150px; min-width: 0; }
.duo { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; }

.pend { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 14px; max-width: 560px; margin: 0 auto; padding: 40px 24px 140px; }
.lead { color: var(--t2); font-size: 17px; }

/* ---------- Ventanas flotantes ---------- */
.modal-back { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .62); display: flex; justify-content: center; align-items: flex-start; padding: 16vh 16px 16px; opacity: 0; transition: opacity .22s; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal-back.on { opacity: 1; }
.modal { width: min(560px, 100%); border: 1px solid var(--l2); border-radius: 20px; background: #000; padding: 20px; transform: translateY(14px) scale(.98); transition: transform .35s var(--spring); max-height: 70vh; overflow: auto; }
.modal-back.on .modal { transform: none; }
.cap { display: flex; flex-direction: column; gap: 12px; }
.big-input { width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--l3); padding: 10px 0; font-family: var(--head); font-size: 20px; outline: none; border-radius: 0; transition: border-color .3s; }
.big-input:focus { border-color: #fff; }
.big-input::placeholder { color: var(--t4); }
.sr-list { display: flex; flex-direction: column; }
.sr { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 10px; border-radius: 10px; transition: background .15s; }
.sr > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr:hover, .sr.on { background: #161616; }
.sr-empty { padding: 10px; font-size: 13px; }
.keys { display: flex; flex-direction: column; gap: 10px; }
.key-row { display: flex; align-items: center; gap: 14px; color: var(--t2); }
.kc { font-family: var(--mono); font-size: 12px; border: 1px solid var(--l3); border-radius: 6px; padding: 2px 8px; min-width: 64px; text-align: center; color: #fff; }
.more { display: flex; flex-direction: column; gap: 16px; }
.more-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.more-it { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 4px; border: 1px solid var(--l1); border-radius: 14px; font-size: 12px; color: var(--t2); transition: border-color .2s, color .2s, transform .15s; }
.more-it:active { transform: scale(.95); border-color: #fff; color: #fff; }
#toast { position: fixed; left: 50%; bottom: calc(84px + var(--sab)); transform: translate(-50%, 12px); z-index: 60; font-family: var(--mono); font-size: 12px; padding: 9px 16px; border: 1px solid var(--l3); border-radius: 999px; background: #000; opacity: 0; pointer-events: none; transition: opacity .25s, transform .35s var(--spring); max-width: calc(100vw - 32px); text-align: center; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Móvil ---------- */
@media (max-width: 819px) {
  body { font-size: 16px; }
  .hoy { display: block; padding: 0 16px; }
  .hoy-hero { position: relative; height: 54vh; height: 54svh; padding: calc(20px + var(--sat)) 4px 22px; }
  .hoy-col { padding: 0 0 130px; gap: 12px; }
  .duo { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .card { padding: 18px; border-radius: 16px; background: rgba(0, 0, 0, .88); }
  .modal-back { padding-top: 10vh; -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(0, 0, 0, .8); }
  #dock { gap: 6px; padding: 6px 10px; -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(8, 8, 8, .96); }
  .dk { width: 48px; height: 46px; }
  .big-input { font-size: 18px; }
}

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

/* ---------- Páginas de módulo ---------- */
.page { max-width: 820px; margin: 0 auto; padding: calc(56px + var(--sat)) 24px 150px; display: flex; flex-direction: column; gap: 20px; }
.page.wide { max-width: 1280px; }
.pg-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.pg-head h1 { font-size: clamp(32px, 5vw, 64px); }
.pg-body { display: flex; flex-direction: column; gap: 16px; }
.card.flat { padding: 8px 22px 12px; }
.card.flat .big-input { border-bottom: 0; }
input:not(.big-input), select { width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--l2); padding: 9px 0; outline: none; border-radius: 0; color: #fff; font-size: 15px; transition: border-color .3s; -webkit-appearance: none; appearance: none; color-scheme: dark; }
input:not(.big-input):focus, select:focus { border-color: #fff; }
input::placeholder { color: var(--t4); }
select option { background: #000; }

.seg { position: relative; display: flex; border-bottom: 1px solid var(--l1); }
.seg button { flex: 1; text-align: center; padding: 12px 0; color: var(--t3); transition: color .25s; }
.seg button.on { color: #fff; }
.seg-bar { position: absolute; left: 0; bottom: -1px; height: 1px; background: #fff; transition: transform .45s var(--spring); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 7px 14px; border: 1px solid var(--l2); border-radius: 999px; font-size: 13px; color: var(--t2); transition: all .25s var(--ease); }
.chip:hover { border-color: #fff; color: #fff; }
.chip.on { background: #fff; color: #000; border-color: #fff; }
.chip.dash { border-style: dashed; color: var(--t3); }

.trow { gap: 4px; }
.row-check { padding: 12px 10px 12px 0; display: grid; place-items: center; min-height: 44px; }
.row-check:hover .cb { border-color: #fff; }
.row-check:active .cb { transform: scale(.85); }
.row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 10px 0; }
.row-meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--t3); font-size: 11px; }
.row-meta .late { color: #fff; text-decoration: underline; }
.row-star { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--t4); transition: color .2s, transform .3s var(--spring); }
.row-star:hover { color: #fff; transform: rotate(40deg); }
.row-star.on { color: #fff; }
.row-x.show { opacity: 1; }
.lnk.danger:hover { text-decoration: underline; }

.edit { display: flex; flex-direction: column; gap: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 2px; }
.tog { padding: 8px 16px; border: 1px solid var(--l2); border-radius: 999px; color: var(--t3); transition: all .25s var(--ease); }
.tog.on { background: #fff; color: #000; border-color: #fff; }
.btn-row.end { justify-content: flex-end; align-items: center; gap: 18px; }
.btn-row.end .lnk { align-self: center; }
.sub { display: flex; align-items: center; gap: 4px; }
.sub .row-t { flex: 1; }

.matrix { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.quad { border: 1px solid var(--l1); border-radius: 16px; background: rgba(0, 0, 0, .72); padding: 14px; min-height: 190px; display: flex; flex-direction: column; gap: 12px; transition: border-color .2s, background .2s; }
.quad header { display: flex; flex-direction: column; gap: 2px; }
.quad-list { display: flex; flex-direction: column; gap: 6px; }
.drop-hot { border-color: #fff !important; background: rgba(255, 255, 255, .06) !important; }
.tchip { padding: 9px 12px; border: 1px solid var(--l2); border-radius: 10px; background: #000; font-size: 14px; width: 100%; overflow-wrap: anywhere; transition: border-color .2s, transform .25s var(--ease), opacity .2s; }
.tchip:hover { border-color: #666; transform: translateX(3px); }
.dragme { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.dragging { opacity: .25; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; border-color: #fff !important; background: #000 !important; box-shadow: 0 18px 50px rgba(255, 255, 255, .12); margin: 0; }
.drag-on { -webkit-user-select: none; user-select: none; }

.goal-card { gap: 12px; }
.goal-top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.goal-top h3 { font-size: clamp(20px, 2.4vw, 28px); }
.goal-n { font-size: 26px; font-weight: 300; }
.metas { display: flex; flex-direction: column; }
.meta { border-top: 1px solid var(--l1); padding: 4px 0 10px; display: flex; flex-direction: column; gap: 6px; }
.meta-h { display: flex; align-items: baseline; gap: 12px; padding: 10px 0 4px; width: 100%; }
.meta-h .row-t { flex: 1; }
.meta-b { display: flex; flex-direction: column; gap: 8px; padding: 4px 0 4px 14px; border-left: 1px solid var(--l1); margin-top: 6px; }

.wk-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.wk { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.wk-side { position: sticky; top: 20px; max-height: calc(100vh - 140px); overflow: auto; }
.wk-heads { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.wk-cols { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.wk-grid.one .wk-cols { grid-template-columns: minmax(0, 1fr); }
.day-h { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border-radius: 12px; border: 1px solid transparent; text-align: center; color: var(--t2); min-width: 0; }
.day-h .mono.dimtxt { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.day-n { font-family: var(--head); font-size: 22px; color: #fff; }
.day-h.today { border-color: var(--l3); }
.day-h.sel { background: #fff; }
.day-h.sel, .day-h.sel .day-n, .day-h.sel .mono { color: #000; }
.day-col { position: relative; border: 1px solid var(--l1); border-radius: 12px; background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, .05) 0 1px, transparent 1px 42px), rgba(0, 0, 0, .72); cursor: copy; transition: border-color .2s; overflow: hidden; }
.has-cur .day-col { cursor: none; }
.hr { position: absolute; left: 5px; font-size: 9px; color: var(--t4); pointer-events: none; transform: translateY(2px); }
.block { position: absolute; left: 3px; right: 3px; border: 1px solid var(--l3); border-radius: 8px; background: #0b0b0b; padding: 3px 7px; display: flex; flex-direction: column; gap: 1px; overflow: hidden; font-size: 12px; line-height: 1.25; transition: border-color .2s, background .2s; }
.block:hover { border-color: #fff; }
.block .mono { font-size: 10px; color: var(--t3); }
.block-t { overflow: hidden; text-overflow: ellipsis; }
.block.now { background: #fff; color: #000; border-color: #fff; }
.block.now .mono { color: #333; }
.now-line { position: absolute; left: 0; right: 0; height: 1px; background: #fff; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -1px; top: -3px; width: 7px; height: 7px; border-radius: 50%; background: #fff; }

@media (max-width: 819px) {
  .page { padding: calc(32px + var(--sat)) 16px 130px; gap: 16px; }
  .matrix { gap: 8px; }
  .quad { padding: 10px; min-height: 150px; }
  .quad header .mono { font-size: 11px; }
  .tchip { font-size: 13px; padding: 8px 9px; }
  .wk { grid-template-columns: minmax(0, 1fr); }
  .wk-side { position: static; max-height: none; }
  .wk-heads { gap: 2px; }
  .day-h .mono.dimtxt { display: none; }
  .day-n { font-size: 18px; }
  .grid2 { gap: 12px; }
  input:not(.big-input), select { font-size: 16px; }
}

/* ---------- Fase 3: hábitos, foco, rutinas ---------- */
.celebra-cv { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 80; pointer-events: none; }
.center { justify-content: center; text-align: center; }
.heat-wrap { overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.heat-wrap::-webkit-scrollbar { display: none; }
.heat { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: minmax(9px, 1fr); gap: 3px; min-width: 620px; }
.heat i { aspect-ratio: 1; border-radius: 2px; background: #0d0d0d; transition: transform .2s; }
.heat i.off { background: #070707; outline: 1px solid #111; outline-offset: -1px; }
.heat i.fut { background: transparent; }
.heat i:hover { transform: scale(1.6); }
.relief { width: 100%; min-width: 620px; display: block; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 14px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-n { font-family: var(--mono); font-size: 30px; font-weight: 300; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hab-top { display: flex; align-items: center; gap: 6px; }
.hab-name { font-family: var(--head); font-size: 19px; }
.hab-streak { display: flex; flex-direction: column; align-items: flex-end; }
.mono.big { font-size: 26px; font-weight: 300; }
.hab-more { display: flex; flex-direction: column; gap: 16px; border-top: 1px solid var(--l1); padding-top: 16px; }
.tog.sq { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; font-family: var(--mono); font-size: 13px; }

.foco { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.foco-stage { position: sticky; top: 24px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.foco-side { display: flex; flex-direction: column; gap: 16px; }
.ring { display: block; max-width: 100%; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
input[type=number] { -moz-appearance: textfield; font-family: var(--mono); }
input[type=number]::-webkit-inner-spin-button { display: none; }
.range { -webkit-appearance: none; appearance: none; height: 20px; border: 0 !important; padding: 0 !important; background: linear-gradient(var(--l3), var(--l3)) center / 100% 1px no-repeat !important; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; }
.range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; min-height: 130px; }
.bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; }
.bar-col i { width: 100%; max-width: 26px; min-height: 1px; background: #fff; transition: height .8s var(--ease); }
.bar-col .mono { font-size: 10px; }
.goal .bar i { transition: transform .8s var(--ease); }
body.focus-on #dock, body.focus-on .foco-side, body.focus-on .pg-head { opacity: 0; pointer-events: none; }
body.focus-on .foco { grid-template-columns: minmax(0, 1fr); }
body.focus-on .foco-stage { min-height: calc(100vh - 220px); min-height: calc(100dvh - 220px); justify-content: center; }
.foco-side, .pg-head { transition: opacity .5s var(--ease); }

.rut-name { font-size: 24px; }
.rut-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; }
.rut-steps li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--l1); color: var(--t2); font-size: 14px; }
.rut-steps li:last-child { border-bottom: 0; }
.runner { align-items: center; text-align: center; gap: 16px; padding: 28px 20px; }
.run-t { font-size: clamp(24px, 3.4vw, 36px); max-width: 560px; }
.run-dots { display: flex; gap: 6px; }
.run-dots i { width: 22px; height: 1px; background: var(--l3); transition: background .3s; }
.run-dots i.done { background: #fff; }
.run-dots i.cur { background: #fff; height: 3px; margin-top: -1px; }
.step { display: grid; grid-template-columns: 22px minmax(0, 1fr) 54px 26px 26px 26px; gap: 6px; align-items: center; }
.step .row-x { width: 26px; color: var(--t3); }

@media (max-width: 819px) {
  .foco { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .foco-stage { position: static; }
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step { grid-template-columns: 20px minmax(0, 1fr) 46px 24px 24px 24px; gap: 4px; }
}

/* ---------- Fase 4: notas, diario, revisiones, estadísticas, prompts, ajustes ---------- */
textarea { font: inherit; color: #fff; }
.note-ta { width: 100%; min-height: 120px; background: transparent; border: 1px solid var(--l1); border-radius: 12px; padding: 12px 14px; outline: none; resize: vertical; line-height: 1.6; font-size: 15px; transition: border-color .3s; }
.note-ta:focus { border-color: #fff; }
.note-ta.short { min-height: 76px; }
.note-ta::placeholder { color: var(--t4); }
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.note { text-align: left; gap: 8px; cursor: pointer; }
.note:hover { border-color: #444; transform: translateY(-3px); }
.note h3 { font-size: 18px; overflow-wrap: anywhere; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.note-view { display: flex; flex-direction: column; gap: 12px; }
.note-view:empty { display: none; }
.err { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.err:empty { display: none; }

.scale { display: flex; flex-direction: column; gap: 10px; padding: 6px 0; }
.scale-h { display: flex; justify-content: space-between; align-items: baseline; }
.scale-b { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.scale-b button { height: 52px; border: 1px solid var(--l2); border-radius: 12px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 9px; transition: all .25s var(--ease); }
.scale-b button i { width: 14px; background: var(--l3); border-radius: 2px; transition: background .25s; }
.scale-b button.on { border-color: #fff; }
.scale-b button.on i { background: #fff; }
.scale-b button:active { transform: scale(.94); }
.frase.q { font-size: clamp(18px, 2vw, 22px); margin-bottom: 8px; }
.q-t { font-family: var(--head); font-size: 17px; margin-bottom: 6px; }
.cmp { border-top: 1px solid var(--l1); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.cmp:first-of-type { border-top: 0; padding-top: 0; }
.cmp-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cmp-row p { grid-column: 1 / -1; }
.hist { padding: 10px 0; border-bottom: 1px solid var(--l1); display: flex; flex-direction: column; gap: 4px; }
.hist:last-child { border-bottom: 0; }
.hist p { white-space: pre-wrap; color: var(--t2); overflow-wrap: anywhere; }
.stat-n.sm { font-size: 20px; }

.chart-wrap { display: flex; flex-direction: column; gap: 6px; }
.chart { width: 100%; height: 150px; display: block; overflow: visible; }
.chart-max { font-size: 10px; }
.chart-labels { position: relative; height: 16px; }
.chart-labels span { position: absolute; transform: translateX(-50%); font-family: var(--mono); font-size: 10px; color: var(--t3); white-space: nowrap; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; color: var(--t2); }
.lg { display: inline-block; width: 14px; height: 2px; background: #fff; margin-right: 6px; vertical-align: middle; }
.lg.g1 { background: #8c8c8c; } .lg.g2 { background: #555; }

.prompt-prev { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: 12px; line-height: 1.6; color: var(--t2); border: 1px solid var(--l1); border-radius: 12px; padding: 12px 14px; max-height: 220px; overflow: auto; }
.flip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.flip { perspective: 1000px; height: 230px; text-align: left; }
.flip-in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .7s var(--ease); }
.flip.on .flip-in { transform: rotateY(180deg); }
.flip-f, .flip-b { position: absolute; inset: 0; border: 1px solid var(--l1); border-radius: 18px; background: #000; padding: 18px; display: flex; flex-direction: column; gap: 10px; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.flip-b { transform: rotateY(180deg); border-color: var(--l3); }
.flip-f h3 { font-size: 21px; }
.flip-b .lnk { margin-top: auto; color: #fff; }
.flip:hover .flip-f { border-color: #444; }

.pg-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.pg-n { font-size: 22px; font-weight: 300; }
.bar.thick, .bar.thick i { height: 2px; }
.bar.thick i { transition: none; }

@media (max-width: 819px) {
  .note-grid, .flip-grid { grid-template-columns: minmax(0, 1fr); }
  .flip { height: 210px; }
  .seg button { font-size: 14px; padding: 12px 2px; }
  .note-ta { font-size: 16px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .btn-row.end { flex-wrap: wrap; justify-content: flex-start; }
}
.card-h .lnk, .card-h .chips { flex: none; white-space: nowrap; }
.card-h h2 { min-width: 0; }
