[hidden] { display: none !important; }
:root {
  --bg: #0b1412;
  --bg-2: #101c19;
  --elev: #162420;
  --card: #18302a;
  --line: rgba(180, 220, 210, .12);
  --text: #e8f3ef;
  --muted: #93b0a8;
  --faint: #6b8a82;
  --accent: #3ee0c2;
  --accent-dim: rgba(62, 224, 194, .16);
  --accent-2: #9bb3ff;
  --warn: #e8c45a;
  --danger: #ff8a80;
  --ok: #6ee7b7;
  --shadow: 0 10px 30px rgba(0,0,0,.28);
  --radius: 18px;
  --tabbar: 64px;
  --font: "Figtree", "Segoe UI", system-ui, sans-serif;
  --serif: "Fraunces", Georgia, serif;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f3f6f4;
  --bg-2: #e8eeeb;
  --elev: #ffffff;
  --card: #ffffff;
  --line: rgba(15, 40, 34, .1);
  --text: #12221e;
  --muted: #4d675f;
  --faint: #7a918a;
  --accent: #0f766e;
  --accent-dim: rgba(15, 118, 110, .12);
  --accent-2: #3f5bd6;
  --warn: #9a6b00;
  --danger: #b42318;
  --ok: #0f7a4a;
  --shadow: 0 8px 24px rgba(16, 36, 30, .08);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); }
body { padding: 0; }
button, textarea, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--serif); font-weight: 560; letter-spacing: -.02em; margin: 0; }
p { margin: 0 0 .7em; line-height: 1.5; }
a { color: var(--accent); }

.gate, .auth-body { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background:
  radial-gradient(1200px 600px at 10% -10%, rgba(62,224,194,.12), transparent 50%),
  radial-gradient(800px 500px at 110% 10%, rgba(155,179,255,.1), transparent 40%),
  var(--bg); }
.auth-card, .gate-card { width: min(440px, 100%); background: var(--elev); border: 1px solid var(--line); border-radius: 28px; padding: 32px 28px; box-shadow: var(--shadow); }
.mark { font-family: var(--serif); color: var(--accent); font-style: italic; margin-bottom: 8px; }
.auth-card h1, .gate-card h1 { font-size: 1.7rem; margin-bottom: 12px; }
.muted { color: var(--muted); }
.btn, .btn-ghost, .btn-danger { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 12px 18px; font-weight: 600; text-decoration: none; }
.btn { background: var(--accent); color: #06221c; }
[data-theme="light"] .btn { color: #fff; }
.btn-ghost { background: var(--accent-dim); color: var(--text); border: 1px solid var(--line); }
.btn-danger { background: rgba(255,138,128,.12); color: var(--danger); }
.btn-block { width: 100%; }

#app { min-height: 100dvh; padding-bottom: calc(var(--tabbar) + 18px + env(safe-area-inset-bottom)); }
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px); padding: 14px 18px 10px; border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; max-width: 720px; margin: 0 auto; }
.eyebrow { color: var(--muted); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 2px; font-weight: 600; }
.brand { font-size: 1.35rem; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--elev); }
.rings { display: flex; gap: 8px; align-items: center; font-size: .7rem; color: var(--muted); }
.ring { width: 36px; height: 36px; }

.main { max-width: 720px; margin: 0 auto; padding: 16px 16px 28px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5, 1fr); background: color-mix(in srgb, var(--elev) 92%, transparent); backdrop-filter: blur(16px); border-top: 1px solid var(--line); z-index: 6; }
.tab { border: 0; background: none; color: var(--faint); font-weight: 600; font-size: .78rem; }
.tab.on { color: var(--accent); }

.mentor { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 16%, var(--card)), var(--card)); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.mentor .quote { font-family: var(--serif); font-style: italic; font-size: 1.18rem; line-height: 1.4; margin: 0; }
.mentor .meta { margin-top: 10px; color: var(--muted); font-size: .86rem; }

.day-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.day-nav h2 { font-size: 1.05rem; }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 10px; font-size: .75rem; font-weight: 600; background: var(--accent-dim); color: var(--accent); }
.chip.warn { background: rgba(232,196,90,.15); color: var(--warn); }
.chip.libre { background: rgba(155,179,255,.15); color: var(--accent-2); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.kicker { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.focus-title { font-size: 1.35rem; line-height: 1.25; margin-bottom: 8px; }
.dl { display: grid; gap: 10px; }
.dl div b { display: block; font-size: .78rem; color: var(--muted); font-weight: 600; margin-bottom: 2px; }

.progress-line { display: flex; align-items: center; gap: 12px; margin: 8px 0 14px; }
.bar { flex: 1; height: 8px; background: var(--bg-2); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #7cf0d6); border-radius: 99px; transition: width .45s ease; }
.progress-line strong { font-variant-numeric: tabular-nums; }

.blocks { display: grid; gap: 8px; }
.block { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 10px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); }
.block .mins { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.block .who { color: var(--muted); font-size: .75rem; }

.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.check { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); }
.check.done .desc { text-decoration: line-through; color: var(--muted); }
.box { appearance: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 7px; border: 2px solid color-mix(in srgb, var(--accent) 70%, var(--line)); background: transparent; display: grid; place-items: center; transition: transform .18s ease, background .18s ease; }
.box:checked { background: var(--accent); transform: scale(1.08); }
.box:checked::after { content: ""; width: 11px; height: 6px; border-left: 2px solid #06221c; border-bottom: 2px solid #06221c; transform: rotate(-45deg) translate(1px, -1px); }
[data-theme="light"] .box:checked::after { border-color: #fff; }
.tag { font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }
.desc { font-size: .95rem; line-height: 1.45; }
.task-actions { display: flex; gap: 4px; }
.tiny { border: 0; background: none; color: var(--muted); padding: 2px 4px; font-size: .8rem; }

.notes { width: 100%; min-height: 110px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-2); padding: 12px; resize: vertical; }
.prompt { background: var(--bg-2); border-radius: 14px; padding: 12px; border: 1px dashed color-mix(in srgb, var(--accent) 35%, var(--line)); font-size: .92rem; }
.row-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

.routines { display: grid; gap: 6px; }
.routine { display: flex; justify-content: space-between; gap: 8px; font-size: .9rem; padding: 8px 0; border-bottom: 1px solid var(--line); }
.routine:last-child { border-bottom: 0; }

.cal-month { margin-bottom: 18px; }
.cal-month h3 { margin-bottom: 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: .68rem; color: var(--faint); font-weight: 700; }
.cell { aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--line); background: var(--elev); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .78rem; font-weight: 600; color: var(--muted); }
.cell.hoy { outline: 2px solid var(--accent); }
.cell.done { background: color-mix(in srgb, var(--ok) 28%, var(--elev)); color: var(--text); }
.cell.partial { background: color-mix(in srgb, var(--warn) 22%, var(--elev)); color: var(--text); }
.cell.miss { background: color-mix(in srgb, var(--danger) 16%, var(--elev)); }
.cell.libre { opacity: .85; }
.cell .n { font-variant-numeric: tabular-nums; }
.cell .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; margin-top: 2px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.stat b { display: block; font-family: var(--serif); font-size: 1.4rem; }
.stat span { color: var(--muted); font-size: .8rem; }

.obj { margin-bottom: 14px; }
.obj-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.sub { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.sub .prog { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.frentes { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.frentes button, .choice { border: 1px solid var(--line); background: var(--bg-2); border-radius: 999px; padding: 6px 10px; font-size: .8rem; }
.frentes button.on, .choice.on { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.field { width: 100%; border: 1px solid var(--line); background: var(--bg-2); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.metric { display: grid; gap: 6px; }
.metric input { max-width: 160px; }
.hist { font-size: .8rem; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--elev); border: 1px solid var(--line); padding: 10px 16px; border-radius: 999px; box-shadow: var(--shadow); z-index: 9; font-size: .9rem; }
.hidden { display: none !important; }
.drag { cursor: grab; color: var(--faint); }
.empty { color: var(--muted); padding: 8px 0; }

@media (min-width: 800px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .main { padding-top: 20px; }
}
