:root {
  --bg: #000;
  --card: #0e0e0f;
  --card-2: #161618;
  --line: #232326;
  --line-2: #2e2e32;
  --text: #f4f4f5;
  --muted: #8b8b92;
  --dim: #5c5c63;
  --red: #ef5a4c;
  --green: #4fc987;
  --amber: #f5b342;
  --blue: #6aa8ff;
  --radius: 18px;
  --nav: 64px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.4 "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overscroll-behavior: none; }
body { padding-bottom: calc(var(--nav) + 8px); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); background: var(--card-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; width: 100%; outline: none; }
input:focus, select:focus, textarea:focus { border-color: #55555c; }
textarea { min-height: 80px; resize: vertical; }
svg.i { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.s { width: 16px; height: 16px; }
svg.i.l { width: 24px; height: 24px; }

#app { max-width: 720px; margin: 0 auto; padding: 8px 16px 24px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 6px 0 14px; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: var(--card-2); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 600; }
.pill.small { padding: 3px 10px; font-size: 12px; font-weight: 500; color: var(--muted); }
.pill.red { color: var(--red); border-color: #4a2320; }
.pill.green { color: var(--green); border-color: #1f3d2c; }
.iconbar { display: flex; gap: 2px; background: var(--card-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.iconbar button, .iconbtn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 999px; color: var(--text); }
.iconbar button:active, .iconbtn:active { background: var(--line-2); }
h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; margin: 4px 0 6px; }
h2 { font-size: 20px; font-weight: 600; margin: 0 0 4px; letter-spacing: -0.01em; }
.lead { color: var(--muted); margin: 0 0 18px; }
.lead b { color: var(--text); font-weight: 600; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.red { color: var(--red); }
.green { color: var(--green); }
.amber { color: var(--amber); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.card.tight { padding: 6px 16px; }
.card h3 { margin: 0 0 2px; font-size: 16px; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

.section { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 22px 0 6px; }
.section.red { color: var(--red); }
.section .more { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); }

.item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); min-height: 56px; }
.item:last-child { border-bottom: 0; }
.item .t { font-weight: 500; }
.item .s { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.item .r { text-align: right; font-size: 13px; color: var(--muted); white-space: nowrap; }
.item.done .t { color: var(--dim); text-decoration: line-through; }
.check { width: 24px; height: 24px; border-radius: 7px; border: 1.6px solid #5a5a60; display: grid; place-items: center; flex: none; }
.check.on { background: var(--text); border-color: var(--text); color: #000; }
.check.round { border-radius: 999px; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line-2); font-size: 12px; color: var(--muted); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--card-2); color: var(--muted); font-size: 11.5px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 14px; background: var(--text); color: #000; font-weight: 600; }
.btn.ghost { background: var(--card-2); color: var(--text); border: 1px solid var(--line-2); }
.btn.danger { background: transparent; color: var(--red); border: 1px solid #4a2320; }
.btn.block { width: 100%; }
.btn.sm { min-height: 38px; padding: 0 12px; border-radius: 11px; font-size: 14px; }
.btn:disabled { opacity: 0.45; }
.quick { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.quick span.c { width: 52px; height: 52px; border-radius: 999px; display: grid; place-items: center; background: var(--card-2); border: 1px solid var(--line-2); color: var(--text); }

.seg { display: flex; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; margin-bottom: 14px; overflow-x: auto; }
.seg button { flex: 1; padding: 9px 10px; border-radius: 9px; color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; }
.seg button.on { background: var(--line-2); color: var(--text); }

.bar { height: 6px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--text); border-radius: 999px; }
.bar.over > i { background: var(--red); }
.bar.green > i { background: var(--green); }
.big { font-size: 34px; font-weight: 600; letter-spacing: -0.02em; }
.mid { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.stat .k { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 22px; font-weight: 600; margin-top: 6px; }

.hscroll { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 4px; }
.hscroll > * { scroll-snap-align: start; flex: none; }

nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; height: var(--nav); background: rgba(0,0,0,0.92); border-top: 1px solid var(--line); display: flex; justify-content: space-around; align-items: center; z-index: 20; backdrop-filter: blur(12px); }
nav.tabs button { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--dim); min-width: 60px; padding: 6px 0; }
nav.tabs button.on { color: var(--text); }

.fab { position: fixed; right: 18px; bottom: calc(var(--nav) + 16px); width: 56px; height: 56px; border-radius: 18px; background: var(--text); color: #000; display: grid; place-items: center; z-index: 15; box-shadow: 0 8px 24px rgba(0,0,0,0.5); }

.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 40; display: flex; align-items: flex-end; justify-content: center; animation: fade 0.15s; }
.sheet { width: 100%; max-width: 720px; max-height: 92vh; overflow-y: auto; background: #0b0b0c; border: 1px solid var(--line-2); border-bottom: 0; border-radius: 22px 22px 0 0; padding: 10px 16px 24px; animation: up 0.18s ease-out; }
.sheet .grab { width: 40px; height: 4px; border-radius: 9px; background: var(--line-2); margin: 0 auto 12px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin: 0 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); font-size: 13.5px; }
.chip.on { background: var(--text); color: #000; border-color: var(--text); }
.toggle { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; }
.sw { width: 46px; height: 28px; border-radius: 999px; background: var(--line-2); position: relative; flex: none; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 999px; background: #9a9aa1; transition: 0.15s; }
.sw.on { background: var(--text); }
.sw.on::after { left: 21px; background: #000; }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav) + 20px); transform: translateX(-50%); background: var(--text); color: #000; padding: 11px 16px; border-radius: 12px; font-weight: 500; font-size: 14px; z-index: 60; max-width: 90vw; animation: up 0.2s; }
.empty { text-align: center; color: var(--muted); padding: 26px 10px; }
.empty svg { width: 34px; height: 34px; color: var(--dim); margin-bottom: 6px; }

.matrix { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quad { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; min-height: 160px; }
.quad h4 { margin: 0 0 2px; font-size: 13px; }
.quad .q { font-size: 12px; padding: 7px 0; border-top: 1px solid var(--line); display: flex; gap: 6px; align-items: flex-start; }
.kanban { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.kcol { flex: 0 0 78%; max-width: 300px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.kcard { background: var(--card-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px; margin-top: 8px; }

.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; }
.heat i { width: 100%; aspect-ratio: 1; border-radius: 3px; background: #1b1b1e; display: block; }
.heat i.l1 { background: #3d3d42; } .heat i.l2 { background: #77777e; } .heat i.l3 { background: #c9c9ce; } .heat i.l4 { background: #fff; }
.days { display: flex; justify-content: space-between; gap: 4px; margin: 10px 0 4px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.day .c { width: 36px; height: 36px; border-radius: 999px; border: 1.5px solid var(--line-2); display: grid; place-items: center; font-size: 12px; color: var(--text); }
.day .c.full { background: var(--text); color: #000; border-color: var(--text); }
.day.today .c { border-color: var(--text); }

.goal { width: 220px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.goal .ph { height: 120px; background: #19191b center/cover no-repeat; display: grid; place-items: center; color: var(--dim); }
.goal .b { padding: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; min-height: 96px; text-align: left; }
.tile .d { font-size: 12px; color: var(--muted); }
.timer { font-size: 72px; font-weight: 300; text-align: center; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin: 18px 0 6px; }
.sets td, .sets th { padding: 4px; text-align: center; }
.sets input { padding: 9px 6px; text-align: center; }
.sets th { font-size: 12px; color: var(--muted); font-weight: 500; }
.note { background: var(--card-2); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; color: #d6d6da; white-space: pre-line; }
.dot { width: 8px; height: 8px; border-radius: 9px; display: inline-block; flex: none; }
.chart text { fill: var(--dim); font-size: 10px; }

@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 600px) { .kcol { flex-basis: 260px; } }

/* ---------- PC y pantallas grandes: menú a la izquierda ---------- */
@media (min-width: 1000px) {
  body { padding: 0 0 0 232px; }
  #app { max-width: 1080px; padding: 18px 32px 40px; }
  nav.tabs { top: 0; bottom: 0; right: auto; width: 232px; height: auto; flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 4px; padding: 26px 14px; border-top: 0; border-right: 1px solid var(--line); }
  nav.tabs::before { content: "Mi Agenda"; font-size: 20px; font-weight: 600; color: var(--text); padding: 0 12px 18px; letter-spacing: -0.01em; }
  nav.tabs button { flex-direction: row; gap: 12px; font-size: 15px; padding: 11px 12px; border-radius: 12px; min-width: 0; }
  nav.tabs button.on { background: var(--card-2); }
  .fab { bottom: 28px; right: 32px; }
  .toast { bottom: 28px; }
  .sheet-bg { align-items: center; }
  .sheet { max-width: 560px; border-radius: 22px; border-bottom: 1px solid var(--line-2); }
  .grid2 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .kcol { flex: 1 1 0; max-width: none; }
  .matrix .quad { min-height: 220px; }
}
