/* Una sola pantalla: la semana. Lo único con color es el lugar de cada publicación. */
:root {
  --bg: #F4F5F7; --surface: #FFFFFF; --ink: #0E1624; --ink-2: #46546A; --ink-3: #7A889D; --line: #E1E6ED; --line-2: #C9D2DE;
  --primary: #0E1624; --on-primary: #FFFFFF; --focus: #2F6BFF; --danger: #C42B3A;
  --f-head: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif; --f-body: "Outfit", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #0A0F16; --surface: #131B26; --ink: #EAF0F7; --ink-2: #B4BECB; --ink-3: #8794A4; --line: #223040; --line-2: #2E3F53; --primary: #EAF0F7; --on-primary: #0A0F16; --focus: #7FA6FF; --danger: #FF8A95; color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #0A0F16; --surface: #131B26; --ink: #EAF0F7; --ink-2: #B4BECB; --ink-3: #8794A4; --line: #223040; --line-2: #2E3F53; --primary: #EAF0F7; --on-primary: #0A0F16; --focus: #7FA6FF; --danger: #FF8A95; color-scheme: dark; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.45 var(--f-body); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, p { margin: 0; }
h1, h2 { font-family: var(--f-head); letter-spacing: -0.015em; line-height: 1.1; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.app { max-width: 680px; margin: 0 auto; padding: 0 18px calc(150px + env(safe-area-inset-bottom, 0px)); }

/* encabezado: semana, lugares, avance */
.top { padding: 26px 0 6px; display: grid; gap: 16px; }
.wk { display: flex; align-items: center; gap: 12px; }
.wk-t { flex: 1; min-width: 0; }
.wk-t h1 { font-size: clamp(1.9rem, 7vw, 2.4rem); font-weight: 700; }
.wk-t p { color: var(--ink-2); margin-top: 4px; }
.nav { width: 48px; height: 48px; flex: none; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); font-size: 1.6rem; line-height: 1; display: grid; place-items: center; padding: 0 0 3px; }
.nav:hover { border-color: var(--ink-3); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-inline: -18px; padding-inline: 18px; }
.chips::-webkit-scrollbar { display: none; }
.chip { --c: var(--ink); flex: none; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 9px 16px; font-weight: 500; min-height: 44px; }
.chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.chip[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.prog { display: grid; gap: 8px; color: var(--ink-2); font-size: 0.95rem; }
.bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--primary); border-radius: 4px; transition: width 0.3s var(--ease); }
.tip { color: var(--ink-3); font-size: 0.9rem; }

/* lista por día */
.day { margin-top: 30px; }
.day h2 { font-size: 1.25rem; font-weight: 700; display: flex; align-items: center; gap: 10px; text-transform: capitalize; }
.hoy { font: 600 0.72rem var(--f-body); letter-spacing: 0.04em; text-transform: uppercase; background: var(--primary); color: var(--on-primary); padding: 3px 10px; border-radius: 999px; }
.items { list-style: none; margin: 8px 0 0; padding: 0; }
.it { --c: #888; display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.st { width: 48px; height: 48px; flex: none; border: 0; background: none; padding: 0; border-radius: 50%; display: grid; place-items: center; }
.st svg { width: 36px; height: 36px; transition: transform 0.18s var(--ease); }
.st:active svg { transform: scale(0.88); }
.st[disabled] { cursor: default; }
.it-main { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 4px 0; display: grid; gap: 3px; }
.it-t { font-weight: 500; font-size: 1.02rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.it-s { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; color: var(--ink-2); }
.it-s i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.it.is-done .it-t { color: var(--ink-3); }
.it.is-done .it-main { opacity: 0.75; }

.empty { margin-top: 34px; display: grid; gap: 14px; justify-items: start; color: var(--ink-2); }
.empty b { font-family: var(--f-head); font-size: 1.3rem; color: var(--ink); }
.btn { border: 1px solid var(--line-2); background: var(--surface); border-radius: 14px; padding: 12px 18px; font-weight: 500; min-height: 48px; }
.btn:hover { border-color: var(--ink-3); }
.btn-primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); font-weight: 600; }
.link { border: 0; background: none; color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; padding: 10px 0; font-size: 0.92rem; }
.foot { margin-top: 36px; text-align: center; }
.add { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(22px + env(safe-area-inset-bottom, 0px)); z-index: 20; min-width: min(300px, calc(100% - 36px)); height: 58px; border: 0; border-radius: 999px; background: var(--primary); color: var(--on-primary); font: 600 1.1rem var(--f-body); box-shadow: 0 12px 30px rgba(14, 22, 36, 0.32); }
.add:active { transform: translateX(-50%) scale(0.97); }

/* hoja para agregar o editar */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(8, 12, 18, 0.5); opacity: 0; transition: opacity 0.2s var(--ease); }
.scrim.on { opacity: 1; }
.sheet { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; max-height: calc(100% - 24px - env(safe-area-inset-top, 0px)); background: var(--bg); border-radius: 24px 24px 0 0; display: flex; flex-direction: column; transform: translateY(102%); transition: transform 0.26s var(--ease); max-width: 680px; margin-inline: auto; }
.sheet.on { transform: translateY(0); }
.sheet:focus { outline: none; }
.sh-h { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 6px; }
.sh-h h2 { font-size: 1.4rem; }
.sh-x { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--surface); font-size: 1.3rem; }
.sh-b { overflow-y: auto; padding: 8px 20px 18px; display: grid; gap: 20px; overscroll-behavior: contain; }
.field { display: grid; gap: 8px; }
.field > span { font-weight: 600; font-size: 0.95rem; }
.field input, .field textarea { width: 100%; border: 1px solid var(--line-2); background: var(--surface); border-radius: 14px; padding: 12px 14px; font-size: 16px; min-height: 50px; }
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus { outline: 3px solid color-mix(in srgb, var(--focus) 35%, transparent); border-color: var(--focus); }
.hint { color: var(--ink-2); font-size: 0.95rem; }
.prow { --c: var(--ink); position: relative; }
.prow .field > span { display: flex; align-items: center; gap: 8px; }
.prow .field > span i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.prow .field > span small { margin-left: auto; color: var(--ink-3); font-weight: 400; font-size: 0.85rem; }
.rm { position: absolute; top: -11px; right: -6px; height: 44px; padding: 0 8px; border: 0; background: none; color: var(--danger); font-weight: 500; font-size: 0.95rem; text-decoration: underline; text-underline-offset: 3px; }
.btn-dash { width: 100%; border-style: dashed; border-width: 2px; color: var(--ink-2); }
.btn[disabled] { opacity: 0.55; cursor: default; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opts button { --c: var(--ink); border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 10px 16px; font-weight: 500; min-height: 46px; display: inline-flex; align-items: center; gap: 8px; }
.opts button i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.opts button[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.sh-f { display: grid; gap: 4px; padding: 12px 20px calc(16px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--surface); }
.sh-f .btn-primary { width: 100%; min-height: 54px; font-size: 1.05rem; }
.del { justify-self: center; color: var(--danger); }
.del.armed { background: var(--danger); color: #fff; border-radius: 12px; padding: 10px 18px; text-decoration: none; }
.err { color: var(--danger); font-size: 0.9rem; font-weight: 500; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--primary); color: var(--on-primary); padding: 11px 18px; border-radius: 999px; font-weight: 500; box-shadow: 0 8px 24px rgba(14, 22, 36, 0.3); max-width: calc(100% - 32px); text-align: center; }
.ro .add { display: none; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* pantalla de entrada (solo en la versión propia) */
html { -webkit-text-size-adjust: 100%; }
.entrada { min-height: 100dvh; display: grid; place-items: center; padding: 24px 18px; }
.entrada-caja { width: 100%; max-width: 380px; display: grid; gap: 18px; }
.entrada-caja h1 { font-size: clamp(1.9rem, 7vw, 2.3rem); font-weight: 700; }
.entrada-caja p { color: var(--ink-2); }
.entrada-caja .err { color: var(--danger); }
.entrada-caja .btn-primary { width: 100%; min-height: 54px; font-size: 1.05rem; }
.cargando { text-align: center; color: var(--ink-3); padding: 40vh 18px 0; }
.foot .link { display: inline; }
.foot span { color: var(--ink-3); }
.btn[disabled] { opacity: 0.55; cursor: default; }
