/* Lock-in · oscuro minimalista. Azul = foco, verde = logro, ámbar = urgencia.
   Tipografía: Sora (titulares, números) + DM Sans (texto), servidas desde /fonts. */
@font-face { font-family: "Sora"; src: url("/fonts/sora-latin.woff2") format("woff2"); font-weight: 500 800; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("/fonts/dmsans-latin.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
:root {
  --bg: #07090D;
  --bg-2: #0B0E14;
  --surface: #0F131A;
  --surface-2: #151B24;
  --surface-3: #1B2330;
  --line: #1E2733;
  --line-2: #2A3646;
  --text: #E8EEF6;
  --muted: #8A97A8;
  --focus: #4C8DFF;
  --focus-ink: #06101F;
  --focus-glow: rgba(76, 141, 255, .28);
  --good: #3DDC97;
  --warn: #FFB547;
  --bad: #FF5C6C;
  --radius: 16px;
  --radius-sm: 12px;
  --nav-h: 64px;
  --font: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Sora", "DM Sans", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased;
  }
body.in-focus { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, .brand, .clock, .stat strong, .num { font-family: var(--font-display); }
h1 { font-size: clamp(1.6rem, 4.2vw, 2.1rem); line-height: 1.15; letter-spacing: -.02em; font-weight: 700; }
h2 { font-size: 1.05rem; font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--focus); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.grow { flex: 1; }
.ic { display: inline-flex; flex: none; }

/* ---------- Estructura ---------- */
.shell { min-height: 100vh; }
.side { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; background: rgba(11,14,20,.92);  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.side .brand { display: none; }
.nav { display: flex; height: var(--nav-h); }
.nav-link { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: .72rem; position: relative; }
.nav-link.on { color: var(--focus); }
.nav-ic { position: relative; display: inline-flex; }
.nav-badge { position: absolute; top: -6px; right: -12px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--warn); color: #241600; font-size: .7rem; font-weight: 800; display: grid; place-items: center; font-style: normal; }
.content { max-width: 940px; margin: 0 auto; padding: 0 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); }
.view { padding-top: 6px; outline: none; display: grid; gap: 22px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .16em; font-size: .9rem; }
.brand.big { font-size: 1.15rem; justify-content: center; }
.brand-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--focus); }

@media (min-width: 900px) {
  .side { display: flex; flex-direction: column; }
  .nav { flex: 1; }
  .nav-settings { display: flex !important; margin-top: auto; }
  .side { top: 0; bottom: auto; right: auto; width: 224px; height: 100vh; border-top: 0; border-right: 1px solid var(--line); padding: 22px 12px; }
  .side .brand { display: flex; margin: 4px 10px 26px; }
  .nav { flex-direction: column; height: auto; gap: 4px; }
  .nav-link { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 12px; border-radius: 10px; font-size: .95rem; }
  .nav-link:hover { background: var(--surface-2); color: var(--text); }
  .nav-link.on { background: var(--surface-2); }
  .nav-link.on::before { content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--focus); }
  .content { margin-left: 224px; padding: 0 36px 60px; max-width: 1060px; }
}

/* ---------- Captura rápida ---------- */
.capture-wrap { position: sticky; top: 0; z-index: 10; background: var(--bg); padding: 12px 0 8px; margin-bottom: 4px; }
.capture { display: flex; gap: 8px; }
.capture input { flex: 1; min-width: 0; background: var(--surface); border: 1.5px solid var(--line-2); border-radius: 14px; padding: 15px 18px; font-size: 1.02rem; }
.capture input:focus { border-color: var(--focus); outline: 2px solid var(--focus); outline-offset: 0; }
.capture .btn { padding: 0 18px; border-radius: 14px; min-height: 52px; }
.capture .btn .lbl { display: none; }
@media (min-width: 560px) { .capture .btn .lbl { display: inline; } }
.capture-hint { color: var(--muted); font-size: .82rem; padding: 0 4px 6px; margin-top: -6px; }

/* ---------- Controles ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px solid var(--line-2); background: transparent; color: var(--text); padding: 10px 18px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; min-height: 46px; }
.btn:hover { background: var(--surface-2); border-color: #4A5C75; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--focus); border-color: var(--focus); color: var(--focus-ink); font-weight: 700; box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 1px 0 rgba(0,0,0,.4); }
.btn.primary:hover { background: #6AA0FF; border-color: #6AA0FF; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--surface-2); }
.btn.danger { color: var(--bad); }
.btn.sm { min-height: 38px; padding: 6px 14px; font-size: .9rem; }
.btn.lg { min-height: 56px; padding: 12px 28px; font-size: 1.08rem; border-radius: 14px; }
.btn.block { width: 100%; }
.btn.nudge { color: var(--warn); border-color: rgba(255,181,71,.45); background: rgba(255,181,71,.08); }
.btn.nudge:hover { background: rgba(255,181,71,.16); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.on { color: var(--focus); background: rgba(76,141,255,.14); border-color: rgba(76,141,255,.4); }
.icon-btn.sm { width: 32px; height: 32px; }

input[type=text], input[type=email], input[type=password], input[type=date], select, textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 11px 13px; min-height: 44px;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
input[type=date] { color-scheme: dark; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--focus); flex: none; }
.field { display: grid; gap: 6px; }
.field > span { font-size: .8rem; color: var(--muted); font-weight: 600; }
.grid2 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.row { display: flex; align-items: center; }
.row.end { justify-content: flex-end; }
.row.wrap { flex-wrap: wrap; }
.row.gap, .gap { gap: 10px; }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }

/* ---------- Cabecera de vista ---------- */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding-top: 6px; }
.stats { display: flex; gap: 8px; flex-wrap: wrap; }
.stat { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); padding: 8px 12px; border-radius: 12px; color: var(--muted); font-size: .85rem; }
.stat strong { color: var(--text); font-size: 1.05rem; }
.stat.hot { color: var(--warn); border-color: rgba(255,181,71,.4); }
.stat.hot strong { color: var(--warn); }

/* ---------- Secciones ---------- */
.section { display: grid; gap: 12px; align-content: start; }
.section-head { display: flex; justify-content: space-between; align-items: center; }
.section-head h2 { font-size: 1.05rem; font-weight: 600; color: var(--text); }
.count { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; font-size: .8rem; color: var(--muted); font-weight: 700; }
.count.good { color: var(--good); }
.count.over { color: var(--warn); border-color: rgba(255,181,71,.4); }
.link { font-size: .85rem; text-decoration: none; }
.empty { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 26px 16px; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.empty strong { color: var(--text); margin-top: 4px; }
.empty span:last-child { font-size: .9rem; max-width: 40ch; }

/* ---------- Tareas ---------- */
.list { display: grid; gap: 8px; }
.task { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.task:hover { border-color: var(--line-2); background: var(--surface-2); }
.task.big { padding: 16px; border-color: rgba(76,141,255,.35); background: var(--surface); }
.task.big .task-title { font-size: 1.12rem; font-weight: 600; font-family: var(--font-display); letter-spacing: -.01em; }
.task.is-doing { border-left: 3px solid var(--focus); }
.task.is-done .task-title { color: var(--muted); text-decoration: line-through; }
.list.compact .task { padding: 8px 10px; }
.check { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-2); background: transparent; color: transparent; cursor: pointer; display: grid; place-items: center; }
.check:hover { border-color: var(--good); color: var(--good); }
.check[aria-pressed=true] { background: var(--good); border-color: var(--good); color: #052316; }
.task-main { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 4px 0; cursor: pointer; display: grid; gap: 4px; }
.task-title { overflow-wrap: anywhere; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: .8rem; color: var(--muted); }
.task-actions { display: flex; align-items: center; gap: 6px; flex: none; }
@media (max-width: 559px) {
  .task { flex-wrap: wrap; }
  .task-actions { width: 100%; justify-content: flex-end; padding-left: 38px; }
}
.chip { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; display: inline-block; }
.badge { padding: 1px 8px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--surface-3); color: var(--muted); }
.badge.late { background: rgba(255,92,108,.14); color: var(--bad); }
.badge.today { background: rgba(255,181,71,.16); color: var(--warn); }
.badge.soon { background: rgba(255,181,71,.10); color: var(--warn); }
.badge.doing { background: rgba(76,141,255,.16); color: var(--focus); }
.who { display: inline-flex; align-items: center; gap: 5px; }
.avatar { width: var(--s, 24px); height: var(--s, 24px); border-radius: 50%; background: var(--c); color: #07090D; display: inline-grid; place-items: center; font-weight: 800; font-size: calc(var(--s, 24px) * .5); flex: none; }

/* ---------- Avisos ---------- */
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line-2); }
.banner.nudge-in { border-color: rgba(61,220,151,.45); background: rgba(61,220,151,.08); }
.banner.nudge-in > .ic { color: var(--good); }
.banner.soft { color: var(--muted); font-size: .92rem; }
.banner.soft strong { color: var(--text); }
.banner.warn { border-color: rgba(255,181,71,.4); background: rgba(255,181,71,.07); color: var(--warn); font-size: .9rem; }
.quote { border-left: 3px solid var(--focus); padding: 8px 12px; background: var(--surface); border-radius: 6px; margin: 4px 0; }

/* ---------- Bandeja ---------- */
.inbox-list { display: grid; gap: 10px; }
.inbox-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 12px; }
.inbox-title { font-weight: 600; overflow-wrap: anywhere; }
.inbox-controls { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .inbox-controls { grid-template-columns: 1.2fr 1fr 1fr; } }

/* ---------- Equipo ---------- */
.cols { display: grid; gap: 22px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1000px) { .cols { grid-template-columns: repeat(3, 1fr); } }
.col { display: grid; gap: 10px; align-content: start; min-width: 0; }
.col-head { display: flex; align-items: center; gap: 8px; font-size: .95rem; }
.col-head .count { margin-left: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: .88rem; min-height: 36px; }
.chip-btn.on { border-color: var(--focus); background: rgba(76,141,255,.14); color: var(--focus); }

/* ---------- Proyectos ---------- */
.proj-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.proj { text-align: left; display: grid; gap: 8px; padding: 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); cursor: pointer; border-top: 3px solid var(--c); }
.proj:hover { background: var(--surface-2); }
.proj-name { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.bar i { display: block; height: 100%; width: var(--w); background: var(--c); border-radius: 3px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; border-radius: 50%; background: var(--c); border: 3px solid transparent; cursor: pointer; }
.swatch.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg) inset; }

/* ---------- Ficha de tarea / modales ---------- */
dialog.modal { border: 1px solid var(--line-2); border-radius: 18px; background: var(--bg-2); color: var(--text); padding: 0; width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 24px); }
dialog.modal.wide { width: min(640px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(2,4,8,.7);  }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px 20px; }
.modal-head h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.modal-body { display: grid; gap: 14px; padding: 8px 20px 22px; }
.title-input { resize: none; overflow: hidden; line-height: 1.3; font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; background: transparent !important; border-color: transparent !important; padding-left: 0; }
.title-input:hover, .title-input:focus { background: var(--surface) !important; padding-left: 13px; border-color: var(--line-2) !important; }
.sub { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.seg { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.seg-btn { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 600; }
.seg-btn.on { background: var(--surface-3); color: var(--text); }
.steps, .focus-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.steps li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px; border-radius: 8px; }
.steps li:hover { background: var(--surface); }
.steps label, .focus-steps label { display: flex; align-items: center; gap: 10px; cursor: pointer; flex: 1; }
.steps li.is-done span { color: var(--muted); text-decoration: line-through; }

/* ---------- Modo foco ---------- */
.focus-overlay { position: fixed; inset: 0; z-index: 100; background: #05070B; display: grid; place-items: center; padding: 24px; overflow: auto; }
.focus-inner { display: grid; gap: 22px; justify-items: center; text-align: center; width: min(560px, 100%); }
.focus-label { letter-spacing: .3em; font-size: .78rem; font-weight: 800; color: var(--focus); }
.focus-title { font-size: clamp(1.3rem, 5vw, 2rem); display: flex; align-items: center; justify-content: center; gap: 12px; overflow-wrap: anywhere; }
.ring-wrap { position: relative; width: min(280px, 72vw); aspect-ratio: 1; }
.ring { width: 100%; height: 100%; }
.ring-bg { stroke: var(--surface-3); }
.ring-fg { stroke: var(--focus); }
.ring-text { position: absolute; inset: 0; display: grid; place-content: center; }
.clock { font-size: clamp(2.6rem, 11vw, 3.6rem); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.clock-sub { color: var(--muted); font-size: .85rem; }
.focus-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.focus-steps { text-align: left; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.park { background: transparent !important; border-style: dashed !important; text-align: center; }
.focus-overlay.time-up .ring-fg { stroke: var(--good); }
.focus-overlay.time-up .clock { color: var(--good); }
.focus-overlay.time-up .clock-sub { color: var(--good); font-weight: 700; }

/* ---------- Acceso ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(400px, 100%); display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 20px; padding: 28px; text-align: center; }
.form-error { color: var(--bad); font-size: .9rem; min-height: 1.3em; }

/* ---------- Avisos flotantes ---------- */
.toast { position: fixed; z-index: 200; left: 50%; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); transform: translateX(-50%); opacity: 0; pointer-events: none; background: var(--surface-3); border: 1px solid var(--line-2); padding: 12px 18px; border-radius: 12px; max-width: min(92vw, 460px); text-align: center; }
.toast.show { opacity: 1; }
.toast.error { border-color: rgba(255,92,108,.6); color: #FFC9CF; }
.toast.warn { border-color: rgba(255,181,71,.55); }
@media (min-width: 900px) { .toast { bottom: 28px; } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- Plan (calendario) ---------- */
.grid3 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr 1fr; }
.grid4 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (min-width: 720px) { .grid4 { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 420px) { .grid3 { grid-template-columns: 1fr 1fr; } .grid3 .field:first-child { grid-column: 1 / -1; } }
input[type=time], input[type=number] { width: 100%; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 11px 13px; min-height: 44px; color-scheme: dark; }
.plan-layout { display: grid; gap: 22px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1000px) { .plan-layout { grid-template-columns: minmax(380px, 1.1fr) 1fr; } }
.cal { display: grid; gap: 10px; }
.cal-head { display: flex; align-items: center; gap: 6px; }
.cal-head h2 { flex: 1; text-align: center; text-transform: capitalize; font-size: 1.1rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wd span { text-align: center; font-size: .75rem; color: var(--muted); font-weight: 700; padding: 4px 0; }
.day { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; min-height: 56px; padding: 6px 7px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; }
@media (min-width: 720px) { .day { min-height: 72px; } }
.day:hover { background: var(--surface-2); }
.day.out { opacity: .4; }
.day.today .num { background: var(--focus); color: var(--focus-ink); border-radius: 6px; padding: 0 6px; font-weight: 800; }
.day.sel { border-color: var(--focus); outline: 2px solid var(--focus); outline-offset: -2px; }
.num { font-size: .9rem; font-weight: 600; }
.marks { display: flex; gap: 4px; }
.mk { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 5px; }
.marks .mk { margin: 0; }
.mk.ev { background: var(--focus); }
.mk.due { background: var(--warn); }
.mk.due.late { background: var(--bad); }
.mk.hito { background: var(--good); border-radius: 2px; transform: rotate(45deg); }
.legend { display: flex; gap: 16px; }
.day-panel { display: grid; gap: 12px; align-content: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.day-title::first-letter { text-transform: uppercase; }
.day-title { font-size: 1.05rem !important; letter-spacing: 0 !important; color: var(--text) !important; }
.load-high { color: var(--warn); }
.ev-list { display: grid; gap: 6px; }
.ev-row, .goal-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); cursor: pointer; }
.ev-row:hover, .goal-row:hover { background: var(--surface-2); }
.ev-row.shared { border-left: 3px solid var(--good); }
.ev-row.past { opacity: .55; }
.ev-time { font-variant-numeric: tabular-nums; color: var(--focus); font-weight: 700; font-size: .88rem; min-width: 88px; }
.ev-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.ev-title { overflow-wrap: anywhere; }
.stack { display: grid; gap: 8px; }
.goal-row .grow, .goal-row span:nth-child(2) { flex: 1; }

/* ---------- Negocio ---------- */
.goal-groups { display: grid; gap: 18px; }
.goal-group { display: grid; gap: 8px; }
.goal-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.goal { display: grid; gap: 8px; text-align: left; padding: 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.goal:hover { background: var(--surface-2); }
.goal.done strong { color: var(--muted); text-decoration: line-through; }
.goal-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.plan-docs { display: grid; gap: 8px; }
.plan-sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 14px; }
.plan-sec[open] { padding-bottom: 14px; display: grid; gap: 10px; }
.plan-sec summary { cursor: pointer; padding: 14px 0; font-weight: 600; display: flex; gap: 10px; align-items: center; }
.num-out { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.num-out .stat { flex-direction: column; align-items: flex-start; gap: 2px; }
.num-out .stat strong { font-size: 1.3rem; }
.num-out .stat.neg strong { color: var(--bad); }
.nav-label { white-space: nowrap; }
@media (max-width: 420px) { .nav-link { font-size: .66rem; } }


/* ---------- Tutorial de bienvenida y botón de ayuda ---------- */
.help-fab { position: fixed; z-index: 90; right: 16px; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 18px 0 14px; border-radius: 26px; border: 1.5px solid var(--focus); background: var(--surface); color: var(--text); font-weight: 700; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.5); }
.help-fab:hover { background: var(--surface-2); }
.help-fab .q { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--focus); color: var(--focus-ink); font-family: var(--font-display); font-weight: 800; }
@media (min-width: 900px) { .help-fab { bottom: 24px; right: 24px; } }
body.in-focus .help-fab { display: none; }

.tour-blocker { position: fixed; inset: 0; z-index: 300; background: rgba(3,5,8,.78); }
.tour-blocker.clear { background: transparent; }
body.tour-on .side, body.tour-on .capture-wrap { z-index: 301; }
body.tour-on .capture-opts { display: flex !important; }
.tour-hl:not(.help-fab):not(.capture-wrap) { position: relative; }
.tour-hl { z-index: 301; border-radius: var(--radius); outline: 3px solid var(--focus); outline-offset: 4px; box-shadow: 0 0 0 9999px rgba(3,5,8,.78); }
.tour-card { position: fixed; z-index: 400; left: 50%; transform: translateX(-50%); width: min(440px, calc(100vw - 24px)); background: var(--bg-2); border: 1.5px solid var(--line-2); border-radius: 20px; padding: 22px; display: grid; gap: 12px; }
.tour-card.bottom { bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); }
.tour-card.top { top: calc(16px + env(safe-area-inset-top)); }
.tour-card.center { top: 50%; transform: translate(-50%, -50%); }
@media (min-width: 900px) { .tour-card.bottom { bottom: 28px; } }
.tour-step { font-size: .78rem; font-weight: 700; letter-spacing: .12em; color: var(--focus); text-transform: uppercase; }
.tour-card h2 { font-size: 1.35rem; line-height: 1.2; }
.tour-card p { color: var(--muted); }
.tour-card p strong { color: var(--text); }
.tour-dots { display: flex; gap: 6px; }
.tour-dots i { width: 22px; height: 4px; border-radius: 2px; background: var(--surface-3); }
.tour-dots i.on { background: var(--focus); }
.tour-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.tour-actions .grow { flex: 1; }

.btn.on { border-color: var(--focus); color: var(--focus); background: rgba(76,141,255,.12); }


/* ---------- Captura: Quién / Dónde / Cuándo y sugerencias ---------- */
.nav-settings { display: none; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding-top: calc(10px + env(safe-area-inset-top)); }
@media (min-width: 900px) { .topbar { display: none; } }
.capture-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 10px; }
@media (max-width: 699px) { .capture-wrap:not(:focus-within):not(.has-pending) .capture-opts { display: none; } }
.opt { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 6px 0 12px; border: 1.5px solid var(--line-2); border-radius: 999px; color: var(--muted); background: var(--surface); }
.opt:focus-within { outline: 2px solid var(--focus); }
.opt.set { border-color: var(--focus); background: rgba(76,141,255,.12); color: var(--text); }
.pill-sel { width: auto; min-height: 34px; padding: 0 22px 0 0; border: 0; background-color: transparent; color: inherit; font-weight: 600; background-position: calc(100% - 8px) 50%, calc(100% - 3px) 50%; }
.pill-sel:focus { outline: none; box-shadow: none; }
.pill-reset { display: inline-flex; align-items: center; gap: 4px; height: 38px; padding: 0 12px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-weight: 600; }
.pill-reset:hover { color: var(--text); }
.sugg { position: absolute; left: 0; right: 0; top: 68px; z-index: 30; list-style: none; margin: 0; padding: 6px; background: var(--surface-2); border: 1.5px solid var(--line-2); border-radius: 14px; max-height: 280px; overflow: auto; }
.sugg li { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 8px 12px; border-radius: 10px; cursor: pointer; }
.sugg li.on { background: rgba(76,141,255,.16); outline: 1.5px solid var(--focus); }
.sugg li.none { color: var(--muted); cursor: default; }
.capture-hint { margin-top: 2px; }

/* ---------- Inicio: resumen y secciones plegables ---------- */
.summary { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.sum-card { display: grid; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--text); min-width: 0; }
.sum-card:hover { background: var(--surface-2); border-color: var(--line-2); }
.sum-top { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: .88rem; }
.sum-big { font-family: var(--font-display); font-size: 1.9rem; line-height: 1.1; letter-spacing: -.02em; }
.sum-text { color: var(--muted); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sum-cta { display: flex; align-items: center; gap: 2px; color: var(--focus); font-weight: 700; font-size: .9rem; margin-top: 6px; }
.fold { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 14px; }
.fold[open] { padding-bottom: 14px; display: grid; gap: 10px; }
.fold summary { cursor: pointer; padding: 14px 0; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.tabs { margin-top: -4px; }
.seg a.seg-btn { display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.badge.warn-b { background: var(--warn); color: #241600; font-weight: 800; }

/* ---------- Negocio: menú y pantallas guiadas ---------- */
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: var(--muted); text-decoration: none; font-weight: 600; margin-bottom: -10px; }
.back:hover { color: var(--text); }
.hub { display: grid; gap: 12px; }
.hub-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; min-height: 84px; }
.hub-card:hover { background: var(--surface-2); border-color: var(--line-2); }
.hub-ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: rgba(76,141,255,.14); color: var(--focus); }
.hub-main { display: grid; gap: 4px; min-width: 0; }
.hub-main strong { font-family: var(--font-display); font-size: 1.05rem; }
.hub-main .muted { font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.hub-go { display: flex; align-items: center; gap: 4px; color: var(--focus); font-weight: 700; }
@media (max-width: 479px) { .hub-cta { display: none; } }
.goal-items { display: grid; gap: 8px; }
.goal-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.goal-item.is-done .task-title { color: var(--muted); text-decoration: line-through; }
.progress-line { display: grid; gap: 6px; }
.q-list { display: grid; gap: 10px; }
.q-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 0 14px; }
.q-card[open] { border-color: var(--line-2); padding-bottom: 14px; }
.q-card summary { display: flex; align-items: center; gap: 12px; min-height: 56px; cursor: pointer; font-weight: 600; }
.q-title { flex: 1; min-width: 0; font-family: var(--font-display); font-size: 1rem; }
.q-tick { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-2); color: transparent; }
.q-card.answered .q-tick { background: var(--good); border-color: var(--good); color: #052316; }
.q-body { display: grid; gap: 12px; padding-top: 4px; }
.num-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.num-out { display: grid; gap: 10px; }
.num-line { font-size: 1.05rem; line-height: 1.5; }
.num-line strong { font-family: var(--font-display); color: var(--good); }
.num-line.bad, .num-line.bad strong { color: var(--bad); }

/* ---------- Móvil y pantallas táctiles ---------- */
button, a, input, select, summary, [role=tab] { touch-action: manipulation; }
.seg { overflow-x: auto; }
.content { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.check { position: relative; }
.check::after { content: ""; position: absolute; inset: -8px; }
@media (pointer: coarse), (max-width: 699px) {
  .btn.sm, .chip-btn, .seg-btn, .pill-reset { min-height: 44px; }
  .opt { height: 44px; }
  .pill-sel { min-height: 40px; }
  .icon-btn.sm { width: 44px; height: 44px; }
  .link { display: inline-flex; align-items: center; min-height: 44px; }
  .sugg li { min-height: 52px; }
}
@media (max-width: 559px) {
  .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
  .stat { flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; font-size: .78rem; }
  .stat .ic { display: none; }
  .stat strong { font-size: 1.35rem; line-height: 1.1; }
  .hero { gap: 12px; }
  /* Resumen de Inicio: tres tarjetas en una fila en vez de tres pantallas */
  .summary { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .sum-card { padding: 12px; gap: 2px; }
  .sum-top { font-size: .78rem; gap: 6px; }
  .sum-top .ic svg { width: 16px; height: 16px; }
  .sum-big { font-size: 1.5rem; }
  .sum-text { font-size: .78rem; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .sum-cta { display: none; }
  .task.big { padding: 14px; }
  .section { gap: 10px; }
  .view { gap: 18px; }
  .help-fab { width: 52px; height: 52px; padding: 0; justify-content: center; border-radius: 50%; }
  .help-fab .lbl { display: none; }
  .focus-actions .btn { flex: 1 1 100%; }
  .tour-card { padding: 18px; }
  .tour-actions .btn { flex: 1 1 auto; }
  .cal-head h2 { font-size: 1rem; }
  .day { min-height: 52px; padding: 5px 6px; }
  .ev-row { flex-wrap: wrap; }
  .ev-time { min-width: 0; }
}
/* Las ventanas se abren desde abajo, como en el móvil */
@media (max-width: 599px) {
  dialog.modal, dialog.modal.wide { width: 100vw; max-width: 100vw; margin: auto 0 0 0; border-radius: 22px 22px 0 0; max-height: 92dvh; padding-bottom: env(safe-area-inset-bottom); overscroll-behavior: contain; }
  .modal-body { padding-bottom: 18px; }
  .toast { bottom: calc(var(--nav-h) + 78px + env(safe-area-inset-bottom)); }
}

/* El botón de ayuda no tapa el final de la página */
@media (max-width: 699px) { .content { padding-bottom: calc(var(--nav-h) + 92px + env(safe-area-inset-bottom)); } }

.grid2.keep2 { grid-template-columns: 1fr 1fr; }
.sheet-actions .btn { flex: 1 1 auto; }
.grid2.keep2 { align-items: start; }
