/* P Organizer — estilo iOS con efecto cristal */
:root {
  --bg: #eef1f7;
  --blob-1: #7fb0ff;
  --blob-2: #ff9fcf;
  --blob-3: #86e8c4;
  --blob-4: #c3a6ff;
  --glass: rgba(255, 255, 255, .5);
  --glass-strong: rgba(255, 255, 255, .78);
  --glass-border: rgba(255, 255, 255, .7);
  --glass-shadow: 0 8px 32px rgba(31, 38, 80, .08), inset 0 1px 0 rgba(255, 255, 255, .6);
  --fill: rgba(118, 118, 128, .12);
  --fill-2: rgba(118, 118, 128, .2);
  --text: #0b0b0f;
  --muted: rgba(60, 60, 67, .62);
  --separator: rgba(60, 60, 67, .14);
  --accent: #007aff;
  --accent-soft: rgba(0, 122, 255, .12);
  --on-accent: #fff;
  --green: #34c759;
  --orange: #ff9500;
  --orange-soft: rgba(255, 149, 0, .14);
  --red: #ff3b30;
  --star: #ff9f0a;
  --radius: 22px;
  --radius-sm: 14px;
  --blur: blur(28px) saturate(180%);
  --tab-h: 62px;
  /* Medidas comunes a todas las pantallas */
  --gap: 16px;
  --page-pad: 16px;
  --head-h: 76px;
  --hour-h: 48px;
  --gutter: 44px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #05060a;
    --blob-1: #1d3a8a;
    --blob-2: #6b1d4f;
    --blob-3: #0d5546;
    --blob-4: #3b1f7a;
    --glass: rgba(40, 40, 48, .5);
    --glass-strong: rgba(30, 30, 36, .78);
    --glass-border: rgba(255, 255, 255, .1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06);
    --fill: rgba(118, 118, 128, .24);
    --fill-2: rgba(118, 118, 128, .36);
    --text: #f5f5f7;
    --muted: rgba(235, 235, 245, .6);
    --separator: rgba(255, 255, 255, .1);
    --accent: #0a84ff;
    --accent-soft: rgba(10, 132, 255, .2);
    --green: #30d158;
    --orange: #ff9f0a;
    --orange-soft: rgba(255, 159, 10, .18);
    --red: #ff453a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
html { background: var(--bg); }
body {
  min-height: 100dvh;
  background: transparent;
  color: var(--text);
  font: 17px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}
/* Fondo de color difuminado que da vida al cristal */
body::before {
  content: ""; position: fixed; inset: -20vmax; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40vmax 40vmax at 15% 10%, var(--blob-1), transparent 60%),
    radial-gradient(38vmax 38vmax at 90% 30%, var(--blob-2), transparent 60%),
    radial-gradient(45vmax 45vmax at 40% 95%, var(--blob-3), transparent 60%),
    radial-gradient(30vmax 30vmax at 75% 70%, var(--blob-4), transparent 60%);
  filter: blur(30px);
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: var(--accent); text-decoration: none; }
svg { display: block; }

/* Superficie de cristal */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: .5px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

/* ---------- Layout ---------- */
#app {
  min-width: 0;
  padding: calc(8px + env(safe-area-inset-top)) var(--page-pad) calc(var(--tab-h) + 36px + env(safe-area-inset-bottom));
  outline: none;
}
/* Todas las pantallas comparten el mismo contenedor y anchura máxima */
.page { width: 100%; max-width: 1600px; margin: 0 auto; }
.page-narrow { max-width: 760px; margin-left: 0; }

/* Barra de pestañas flotante (móvil) */
.nav {
  position: fixed; z-index: 30;
  left: 10px; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom));
  max-width: 480px; margin: 0 auto;
  height: var(--tab-h);
  display: flex; align-items: stretch; padding: 6px;
  border-radius: 31px;
  background: var(--glass-strong);
  view-transition-name: nav;
}
.nav .brand { display: none; }
.nav a {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: 10.5px; font-weight: 600; border-radius: 25px;
  transition: color .2s, background .2s, transform .12s;
}
.nav a:active { transform: scale(.94); }
.nav a svg { width: 24px; height: 24px; }
.nav a.active { color: var(--accent); background: var(--accent-soft); }

@media (min-width: 1024px) {
  :root { --page-pad: 28px; --head-h: 84px; --hour-h: 52px; --gutter: 52px; }
  .layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); }
  .nav {
    position: sticky; top: 16px; left: auto; right: auto; bottom: auto; margin: 16px 0 16px 16px;
    height: calc(100dvh - 32px); max-width: none; flex-direction: column; justify-content: flex-start; gap: 4px;
    padding: 18px 12px; border-radius: 28px;
  }
  .nav .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -.02em; padding: 4px 8px 22px; }
  .nav .brand img { border-radius: 9px; box-shadow: 0 4px 14px rgba(47, 107, 255, .35); }
  .nav a { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 14px; font-size: 16px; font-weight: 500; border-radius: 14px; }
  .nav a svg { width: 22px; height: 22px; }
  #app { padding: 24px var(--page-pad) 32px; }
}

/* ---------- Tipografía ---------- */
h1 { font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -.025em; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 1024px) { h1 { font-size: 32px; } }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); margin: 0; font-weight: 500; padding-left: 16px; }
/* Cabecera: misma altura y estructura en todas las pantallas */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; min-height: var(--head-h); margin-bottom: 18px; }
.ph-text { min-width: 0; flex: 1; }
.ph-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.eyebrow { color: var(--muted); font-size: 14px; font-weight: 500; line-height: 22px; height: 22px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.invisible { visibility: hidden; }
.one-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hint { font-size: 13px; color: var(--muted); margin: 8px 16px 0; }

/* ---------- Secciones ---------- */
.section { margin-bottom: 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; min-height: 32px; }
.card { border-radius: var(--radius); padding: 16px; }
.empty {
  color: var(--muted); font-size: 15px; padding: 16px; border-radius: var(--radius);
  background: var(--fill); border: .5px dashed var(--separator);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 16px; border-radius: 999px; border: 0;
  background: var(--fill); color: var(--accent); cursor: pointer; font-weight: 600; font-size: 15px;
  transition: transform .12s, background .2s, opacity .2s; white-space: nowrap;
}
.btn:active { transform: scale(.96); opacity: .85; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 30px; padding: 0 12px; font-size: 14px; }
.btn.danger { color: var(--red); }
.btn.wide { width: 100%; min-height: 50px; border-radius: 14px; font-size: 17px; }
.icon-btn {
  width: 36px; height: 36px; flex: none; display: inline-grid; place-items: center; border-radius: 50%;
  border: 0; background: transparent; cursor: pointer; color: var(--muted); padding: 0;
  transition: transform .15s, color .2s, background .2s;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:active { transform: scale(.88); }
.icon-btn.round { background: var(--fill); color: var(--accent); }
.icon-btn.on { color: var(--star); }

/* ---------- Navegación de fecha ---------- */
.date-nav { display: flex; align-items: center; gap: 6px; }

/* ---------- Enfoque ---------- */
.focus { display: grid; grid-template-columns: auto 1fr; gap: 12px 16px; align-items: center; border-radius: var(--radius); padding: 16px; margin-bottom: 28px; }
.ring { position: relative; width: 84px; height: 84px; grid-row: span 2; }
.ring svg { width: 84px; height: 84px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring .track { stroke: var(--fill-2); }
.ring .bar { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.ring .time { position: absolute; inset: 0; display: grid; place-items: center; font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.focus .label { font-size: 13px; color: var(--muted); font-weight: 500; margin-bottom: 4px; }
.focus select { width: 100%; }
.focus .actions { display: flex; gap: 8px; }
.focus .actions .btn { flex: 1; }

/* ---------- Progreso ---------- */
.progress { height: 6px; border-radius: 99px; background: var(--fill-2); overflow: hidden; flex: 1; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .4s cubic-bezier(.2,.8,.2,1); }
.stat-row { display: flex; align-items: center; gap: 12px; min-height: 20px; }
.stat-row .count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 72px; text-align: right; }

/* ---------- Listas (estilo iOS inset grouped) ---------- */
.tasks { list-style: none; margin: 0; padding: 0; border-radius: var(--radius); overflow: hidden; }
.task { position: relative; overflow: hidden; touch-action: pan-y; transition: height .28s ease, opacity .28s; }
.task.collapsing { opacity: 0; }
.task-row {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 12px;
  min-height: 54px; padding: 8px 6px 8px 14px; will-change: transform;
}
.task + .task::before { content: ""; position: absolute; z-index: 2; top: 0; left: 50px; right: 0; border-top: .5px solid var(--separator); }
.swipe-act { position: absolute; inset: 0; display: none; align-items: center; padding: 0 22px; font-weight: 600; font-size: 15px; color: #fff; }
.done-act { background: var(--green); justify-content: flex-start; }
.later-act { background: var(--orange); justify-content: flex-end; }
.task.swiping .task-row { background: var(--glass-strong); }
.task.swipe-right .done-act, .task.swipe-left .later-act { display: flex; opacity: .55; }
.task.swipe-pass .swipe-act { opacity: 1; }
@media (pointer: fine) { .task[data-drag] .body { cursor: grab; } body.dragging, body.dragging * { cursor: grabbing !important; } }
.touch-only { display: none; }
@media (pointer: coarse) { .touch-only { display: block; } }
.check {
  appearance: none; -webkit-appearance: none; margin: 0; flex: none;
  width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid var(--muted); background: transparent center / 14px 14px no-repeat;
  cursor: pointer; transition: background-color .2s, border-color .2s, transform .15s;
}
.check:active { transform: scale(.85); }
.check:checked {
  border-color: var(--accent); background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3 7.4l2.6 2.6L11 4.4' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.task .body { flex: 1; min-width: 0; cursor: pointer; padding: 2px 0; }
.task .title { overflow-wrap: anywhere; transition: color .2s; }
.task.done .title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--muted); }
.task .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.task .btn.small { flex: none; }
.tag {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; line-height: 20px;
  padding: 0 8px; border-radius: 99px; background: var(--fill); color: var(--muted); white-space: nowrap;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.tag.dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--accent)); flex: none; }
.tag.warn { background: var(--orange-soft); color: var(--orange); }

.quick-add { display: flex; gap: 8px; margin-top: 10px; align-items: center; border-radius: 999px; padding: 5px 5px 5px 18px; }
.quick-add input[type=text] { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; min-height: 40px; padding: 0; }
.quick-add input::placeholder { color: var(--muted); }

/* ---------- Bloques de tiempo ---------- */
.timeline { display: flex; flex-direction: column; gap: 10px; }
.block {
  position: relative; display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center;
  border-radius: 18px; padding: 12px 14px 12px 18px; cursor: pointer; overflow: hidden;
}
.block::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c, var(--accent)); }
.block .hours { font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 600; line-height: 1.25; }
.block .hours span { display: block; color: var(--muted); font-weight: 400; }
.block .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.block.now { box-shadow: 0 0 0 2px var(--accent), var(--glass-shadow); }
.block.past { opacity: .55; }
.now-badge { font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--on-accent); background: var(--accent); border-radius: 99px; padding: 2px 7px; margin-left: 6px; vertical-align: 2px; }

/* ---------- Tarjetas de proyecto / objetivo ---------- */
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.item-card { display: flex; flex-direction: column; gap: 10px; color: inherit; position: relative; overflow: hidden; transition: transform .15s; }
.item-card:active { transform: scale(.98); }
.item-card .swatch { width: 34px; height: 34px; border-radius: 10px; background: var(--c, var(--accent)); display: grid; place-items: center; color: #fff; box-shadow: 0 4px 12px color-mix(in srgb, var(--c, #007aff) 40%, transparent); }
.item-card .swatch svg { width: 18px; height: 18px; }
.item-card .top { display: flex; align-items: center; gap: 12px; }
.item-card .name { font-weight: 600; font-size: 17px; }
.item-card .why { font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-card .meta { display: flex; gap: 6px; flex-wrap: wrap; }

/* Control segmentado */
.segmented { display: flex; padding: 3px; border-radius: 12px; background: var(--fill); margin-bottom: 18px; }
.segmented button {
  flex: 1; border: 0; background: transparent; padding: 7px 4px; border-radius: 9px; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background .2s, box-shadow .2s;
}
.segmented button.on { background: var(--glass-strong); box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.04); font-weight: 600; }

.back { display: inline-flex; align-items: center; gap: 0; font-size: 15px; font-weight: 500; margin-left: -6px; }
.back svg { width: 20px; height: 20px; }
.title-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--c); margin-right: 10px; vertical-align: 5px; }
.notes { white-space: pre-wrap; font-size: 15px; }
.why-box { border-radius: var(--radius-sm); padding: 12px 14px; background: var(--orange-soft); }
.why-box strong { color: var(--orange); display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }

/* ---------- Formularios ---------- */
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search], input[type=date], input[type=time], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; border: 0; border-radius: 12px; background: var(--fill);
  font-size: 16px; /* evita el zoom automático de iOS */
}
select { appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%238e8e93' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px; }
textarea { min-height: 88px; resize: vertical; }
input[type=date], input[type=time] { -webkit-appearance: none; appearance: none; display: block; text-align: left; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.btn:focus-visible, .icon-btn:focus-visible, .segmented button:focus-visible, .check:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
label.field, .field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
label.field input, label.field select, label.field textarea { color: var(--text); }
.row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.row > * { min-width: 0; }
.colors { display: flex; gap: 10px; flex-wrap: wrap; }
.colors input { appearance: none; -webkit-appearance: none; width: 30px; height: 30px; border-radius: 50%; background: var(--c); cursor: pointer; margin: 0; transition: transform .15s; }
.colors input:checked { box-shadow: 0 0 0 3px var(--glass-strong), 0 0 0 5px var(--c); transform: scale(.92); }
label.field.toggle-row { flex-direction: row; align-items: center; justify-content: space-between; font-size: 16px; color: var(--text); font-weight: 400; background: var(--fill); border-radius: 12px; padding: 6px 8px 6px 14px; min-height: 44px; cursor: pointer; }
.switch { appearance: none; -webkit-appearance: none; width: 51px; height: 31px; border-radius: 99px; background: var(--fill-2); position: relative; cursor: pointer; transition: background .25s; margin: 0; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15); transition: transform .25s cubic-bezier(.3,.7,.4,1); }
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(20px); }

/* ---------- Hoja modal (sheet) ---------- */
dialog {
  border: 0; padding: 0; color: var(--text);
  width: 100%; max-width: 560px; max-height: 92dvh;
  margin: auto auto 0; border-radius: 22px 22px 0 0;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(40px) saturate(180%); backdrop-filter: blur(40px) saturate(180%);
  box-shadow: 0 -10px 40px rgba(0,0,0,.2);
}
dialog[open] { animation: sheet-up .32s cubic-bezier(.2,.9,.3,1); }
dialog::backdrop { background: rgba(0,0,0,.28); animation: fade .25s; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } }
@media (min-width: 640px) {
  dialog { margin: auto; border-radius: 22px; }
  dialog[open] { animation: pop .25s cubic-bezier(.2,.9,.3,1); }
  @keyframes pop { from { transform: scale(.94); opacity: 0; } }
}
#modal-form { display: flex; flex-direction: column; gap: 16px; padding: 8px 20px calc(20px + env(safe-area-inset-bottom)); max-height: 92dvh; overflow: auto; }
.grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--fill-2); margin: 0 auto 4px; flex: none; }
.sheet-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; position: sticky; top: -8px; padding: 8px 0; z-index: 1; }
.sheet-head h3 { margin: 0; font-size: 17px; font-weight: 600; text-align: center; }
.sheet-head .btn { justify-self: start; padding: 0 4px; background: transparent; font-weight: 400; font-size: 17px; }
.sheet-head .btn.primary { justify-self: end; background: transparent; color: var(--accent); font-weight: 600; }

/* ---------- Ajustes ---------- */
.settings-group { border-radius: var(--radius); overflow: hidden; }
.settings-group .item { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; min-height: 52px; flex-wrap: wrap; }
.settings-group .item + .item::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--separator); }
.settings-group select { width: auto; min-height: 36px; }

/* ---------- Aviso (toast) ---------- */
#toast {
  position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top)); z-index: 50;
  transform: translate(-50%, -140%); max-width: calc(100vw - 32px);
  padding: 12px 18px; border-radius: 18px; font-size: 15px; font-weight: 500; text-align: center;
  background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: .5px solid var(--glass-border); box-shadow: 0 10px 30px rgba(0,0,0,.15);
  pointer-events: none; opacity: 0; transition: transform .4s cubic-bezier(.2,.9,.3,1.2), opacity .25s;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; }

.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
/* Navegadores sin backdrop-filter: cristal más opaco para que se lea bien */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass: rgba(255,255,255,.9); --glass-strong: rgba(255,255,255,.96); }
  @media (prefers-color-scheme: dark) { :root { --glass: rgba(36,36,40,.94); --glass-strong: rgba(30,30,34,.97); } }
}

/* ======================================================================
   P Organizer v4: diseño adaptable, semana y calendario
   ====================================================================== */

.mobile-only { }
.desktop-only { display: none; }
@media (min-width: 1024px) { .mobile-only { display: none !important; } .desktop-only { display: block; } }
.section-gap { margin-top: 28px; }
.btn svg { width: 18px; height: 18px; }

/* Tarjetas de proyecto/objetivo: mismo alto en todas las rejillas */
.grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: var(--gap); }
.item-card { min-height: 172px; justify-content: space-between; }
.grid-tight { grid-template-columns: 1fr; }
.info-card { display: flex; flex-direction: column; gap: 14px; }

/* Hoy: una columna en móvil, dos en ordenador (tareas | agenda) */
.today-grid, .detail-grid { display: grid; gap: 0 var(--gap); grid-template-columns: minmax(0, 1fr); }
.agenda-cal { display: none; }
@media (min-width: 1024px) {
  .today-grid { grid-template-columns: minmax(0, 1.15fr) minmax(340px, 1fr); gap: 0 28px; align-items: start; }
  .today-grid .col-side { position: sticky; top: 24px; }
  .agenda-list { display: none; }
  .agenda-cal { display: block; }
  .agenda-cal .cal-scroll { height: calc(100dvh - var(--head-h) - 150px); min-height: 420px; }
  .detail-grid { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 0 28px; align-items: start; }
  .detail-grid .col-side { position: sticky; top: 24px; }
}
@media (min-width: 1440px) {
  .today-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.detail-grid .col-side { margin-bottom: 24px; }

/* Control segmentado compacto (cabeceras) */
.segmented.compact { margin: 0; padding: 2px; }
.segmented.compact button { padding: 5px 10px; font-size: 13px; }

/* ---------- Semana ---------- */
.week-layout { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.page-week .cal-scroll { height: calc(100dvh - var(--head-h) - 290px - env(safe-area-inset-bottom) - env(safe-area-inset-top)); min-height: 360px; }
.tray { border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tray-head h2 { padding-left: 4px; }
.tray-list { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.tray-list::-webkit-scrollbar { display: none; }
.tray-list .chip { flex: 0 0 auto; max-width: 220px; }
.tray-empty { color: var(--muted); font-size: 14px; padding: 6px 4px; }
.tray .quick-add { margin-top: 0; box-shadow: none; background: var(--fill); border: 0; }
.tray.drop-over { box-shadow: 0 0 0 2px var(--accent), var(--glass-shadow); }
@media (min-width: 1024px) {
  .week-layout { grid-template-columns: 260px minmax(0, 1fr); gap: var(--gap); align-items: stretch; }
  .page-week .cal-scroll { height: calc(100dvh - var(--head-h) - 100px); }
  .tray { max-height: calc(100dvh - var(--head-h) - 100px); }
  .tray-list { flex-direction: column; overflow-x: visible; overflow-y: auto; flex: 1; }
  .tray-list .chip { max-width: none; }
}

/* ---------- Calendario (rejilla de horas) ---------- */
.cal-scroll {
  position: relative; overflow: auto; border-radius: var(--radius);
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.cal-grid {
  display: grid; min-width: 100%;
  grid-template-columns: var(--gutter) repeat(var(--days), minmax(110px, 1fr));
  grid-template-rows: auto calc(var(--hour-h) * 24);
}
/* Móvil: 3 días visibles con desplazamiento lateral que encaja por día, o la semana entera */
@media (max-width: 1023px) {
  .cal-scroll.mode-3 { scroll-snap-type: x mandatory; scroll-padding-left: var(--gutter); }
  .cal-scroll.mode-3 .cal-grid { grid-template-columns: var(--gutter) repeat(var(--days), calc((100vw - 2 * var(--page-pad) - var(--gutter)) / 3)); }
  .cal-scroll.mode-3 .cal-dayhead { scroll-snap-align: start; }
  .cal-scroll.mode-7 .cal-grid { grid-template-columns: 32px repeat(var(--days), minmax(0, 1fr)); }
  .cal-scroll.mode-7 .cal-hour span { font-size: 9px; }
  .cal-scroll.mode-7 .ev-time { display: none; }
  .cal-scroll.mode-7 .ev-title { font-size: 10.5px; }
  .cal-scroll.mode-7 .chip { padding: 3px 4px; font-size: 10.5px; }
  .cal-scroll.mode-7 .chip .check { display: none; }
}
.cal-scroll.compact .cal-grid { grid-template-columns: var(--gutter) minmax(0, 1fr); }

.cal-corner, .cal-dayhead {
  position: sticky; top: 0; z-index: 4;
  background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-bottom: .5px solid var(--separator);
}
.cal-corner { left: 0; z-index: 6; }
.cal-dayhead { padding: 8px 4px 6px; min-width: 0; display: flex; flex-direction: column; gap: 6px; border-left: .5px solid var(--separator); }
.cal-dtitle { display: flex; align-items: baseline; justify-content: center; gap: 6px; border: 0; background: none; padding: 2px; cursor: pointer; border-radius: 10px; }
.cal-dname { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.cal-dnum { font-size: 20px; font-weight: 600; line-height: 30px; min-width: 30px; height: 30px; border-radius: 15px; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.is-today .cal-dname { color: var(--text); font-weight: 700; }
.is-today .cal-dnum { background: var(--action-bg); color: var(--on-action); }
.cal-lane { display: flex; flex-direction: column; gap: 4px; min-height: 30px; max-height: 108px; overflow-y: auto; padding: 2px; border-radius: 10px; transition: background .15s, box-shadow .15s; scrollbar-width: none; }
.cal-lane::-webkit-scrollbar { display: none; }
.cal-lane.drop-over { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
@media (max-width: 1023px) { .cal-lane { max-height: 84px; } }

.cal-hours { position: sticky; left: 0; z-index: 3; background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.cal-hour { height: var(--hour-h); position: relative; }
.cal-hour span { position: absolute; top: -7px; right: 6px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-col {
  position: relative; border-left: .5px solid var(--separator); cursor: copy;
  background-image: linear-gradient(var(--separator) .5px, transparent .5px),
    linear-gradient(color-mix(in srgb, var(--separator) 45%, transparent) .5px, transparent .5px);
  background-size: 100% var(--hour-h), 100% var(--hour-h);
  background-position: 0 0, 0 calc(var(--hour-h) / 2);
}
.cal-col.is-today { background-color: color-mix(in srgb, var(--accent) 4%, transparent); }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 2; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }

/* Bloques en el calendario */
.ev {
  position: absolute; z-index: 1; overflow: hidden; cursor: pointer;
  padding: 4px 7px; border-radius: 8px;
  background: color-mix(in srgb, var(--c) 22%, var(--glass-strong));
  border-left: 3px solid var(--c);
  color: var(--text); font-size: 12px; line-height: 1.25;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  transition: box-shadow .15s, opacity .15s, transform .15s;
}
.ev:hover { box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.ev-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ev-time { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.ev.short { display: flex; gap: 6px; align-items: baseline; padding-top: 2px; }
.ev.short .ev-title { -webkit-line-clamp: 1; }
.ev.past { opacity: .6; }
.ev.done .ev-title { text-decoration: line-through; }
.ev-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 10px; cursor: ns-resize; touch-action: none; }
.ev-resize::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 18px; height: 3px; margin-left: -9px; border-radius: 2px; background: var(--c); opacity: 0; transition: opacity .15s; }
.ev:hover .ev-resize::after, .ev.resizing .ev-resize::after { opacity: .8; }
@media (pointer: coarse) { .ev-resize { height: 16px; } .ev-resize::after { opacity: .5; } }
.ev.resizing { z-index: 5; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.ev.drag-source, .chip.drag-source, .task.drag-source { opacity: .35; }
.ev.preview { z-index: 4; pointer-events: none; border: 1.5px dashed var(--c); border-left-width: 3px; border-left-style: solid; background: color-mix(in srgb, var(--c) 18%, transparent); }
.ev.preview .ev-time { color: var(--text); font-weight: 600; }

/* Tareas como «chips» arrastrables */
.chip {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  padding: 5px 8px; border-radius: 9px; font-size: 12.5px; line-height: 1.2;
  background: var(--glass-strong); border: .5px solid var(--separator);
  box-shadow: inset 3px 0 0 var(--c);
  cursor: grab; touch-action: manipulation;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  transition: opacity .15s, transform .15s;
}
.chip:active { transform: scale(.98); }
.chip.imp .chip-title::before { content: "★ "; color: var(--star); }
.chip-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.chip.done .chip-title { color: var(--muted); text-decoration: line-through; }
.check.sm { width: 16px; height: 16px; border-width: 1.5px; background-size: 10px 10px; }

/* Elemento que sigue al dedo/ratón */
.drag-ghost {
  position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none;
  max-width: 240px; padding: 8px 12px; border-radius: 12px; font-size: 14px; font-weight: 600;
  box-shadow: inset 4px 0 0 var(--c), 0 12px 32px rgba(0,0,0,.22);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transform-origin: 0 0; animation: lift .18s ease-out;
}
@keyframes lift { from { scale: .9; opacity: .4; } }
body.dragging { -webkit-user-select: none; user-select: none; }

/* Transiciones entre pantallas */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; animation-timing-function: cubic-bezier(.2,.8,.2,1); }
::view-transition-old(root) { animation-name: vt-out; }
::view-transition-new(root) { animation-name: vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }

/* Elementos táctiles: respuesta inmediata al pulsar */
.item-card, .block, .chip, .ev { -webkit-tap-highlight-color: transparent; }
.tray-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* Cabeceras del calendario opacas para que las horas no se transparenten */
:root { --solid: rgb(246, 247, 251); }
@media (prefers-color-scheme: dark) { :root { --solid: rgb(22, 22, 27); } }
.cal-corner, .cal-dayhead, .cal-hours { background: var(--solid); }
.segmented button { white-space: nowrap; }
@media (max-width: 1023px) {
  .tray { padding: 10px 12px; gap: 8px; }
  .tray .quick-add { display: none; }
  .page-week .cal-scroll { height: calc(100dvh - var(--head-h) - 220px - env(safe-area-inset-bottom) - env(safe-area-inset-top)); }
}

#modal .grabber, #modal .sheet-head { touch-action: none; }
@media (max-width: 1023px) {
  .cal-scroll.mode-7 .cal-dayhead { padding: 6px 1px; gap: 4px; }
  .cal-scroll.mode-7 .cal-dtitle { flex-direction: column; align-items: center; gap: 1px; }
  .cal-scroll.mode-7 .cal-dname { font-size: 10px; }
  .cal-scroll.mode-7 .cal-dnum { font-size: 15px; min-width: 24px; height: 24px; line-height: 24px; }
  .cal-scroll.mode-7 .chip { justify-content: center; }
  .cal-scroll.mode-7 .ev { padding: 3px 3px 3px 4px; border-left-width: 2px; }
}

/* ======================================================================
   P Organizer v5: funcionalidad completa (tareas, diarias, objetivos…)
   ====================================================================== */

/* Botones: en modo oscuro, texto e iconos blancos (nada de azul eléctrico sobre negro) */
:root { --action: var(--accent); --action-bg: var(--accent); --on-action: #fff; --nav-active-bg: var(--accent-soft); }
@media (prefers-color-scheme: dark) {
  :root { --action: #f5f5f7; --action-bg: rgba(255, 255, 255, .92); --on-action: #0b0b0f; --nav-active-bg: rgba(255, 255, 255, .14); }
}
a, .btn, .icon-btn.round, .back { color: var(--action); }
.btn.primary { background: var(--action-bg); color: var(--on-action); }
.sheet-head .btn.primary { color: var(--action); }
.btn.danger { color: var(--red); }
.nav a.active { color: var(--action); background: var(--nav-active-bg); }
.item-card, .proj-row, .settings-group a.item { color: inherit; }

.grow { flex: 1; min-width: 0; }
.warn-text { color: var(--orange); }
.page-mid { max-width: 980px; }
.intro { margin: -8px 4px 18px; }
.tag svg { width: 12px; height: 12px; flex: none; }
.tag.pri-high { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.tag.pri-med { background: var(--orange-soft); color: var(--orange); }
.tag.st-vencido { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.tag.st-cumplido { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.tag-block { color: var(--text); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.toolbar select, .filters select { width: auto; min-height: 36px; font-size: 14px; padding-top: 6px; padding-bottom: 6px; }
.segmented.icons button { padding: 5px 9px; display: grid; place-items: center; }
.segmented.icons svg { width: 18px; height: 18px; }
.seg-count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--fill-2); font-size: 11px; line-height: 18px; font-weight: 600; }
.seg-count.warn { background: var(--orange-soft); color: var(--orange); }

/* Navegación: 5 pestañas en móvil; en ordenador, barra lateral con extras */
.nav-extra, .nav-new, .nav-sep { display: none !important; }
@media (min-width: 1024px) {
  .nav-extra { display: flex !important; }
  .nav-sep { display: block !important; height: 1px; background: var(--separator); margin: 10px 8px; }
  .nav-new { display: inline-flex !important; margin: 0 4px 14px; }
}
.fab {
  position: fixed; z-index: 31; right: 16px; bottom: calc(var(--tab-h) + 20px + env(safe-area-inset-bottom));
  width: 56px; height: 56px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--action-bg); color: var(--on-action); box-shadow: 0 10px 28px rgba(0, 0, 0, .25);
  transition: transform .15s;
}
.fab svg { width: 26px; height: 26px; }
.fab:active { transform: scale(.92); }
@media (min-width: 1024px) { .fab { display: none; } }
@media (max-width: 1023px) { #app { padding-bottom: calc(var(--tab-h) + 100px + env(safe-area-inset-bottom)); } }

/* Aviso con botón Deshacer */
#toast { display: flex; align-items: center; gap: 14px; }
#toast.actionable.show { pointer-events: auto; }
.toast-btn { border: 0; background: none; color: var(--action); font-weight: 700; cursor: pointer; padding: 4px 2px; }

/* Primer paso dentro de una prioridad */
.step-line { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.step-line span { flex: none; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; font-size: 10.5px; }
.step-line .step-input { min-height: 32px; padding: 4px 10px; font-size: 15px; border-radius: 9px; }

/* Secciones plegables */
.sec-toggle { display: flex; align-items: center; gap: 2px; border: 0; background: none; padding: 0; cursor: pointer; color: var(--muted); }
.sec-toggle svg { width: 14px; height: 14px; margin-left: 10px; transition: transform .2s; }
.sec-toggle h2 { padding-left: 4px; }
.collapsible.closed .sec-toggle svg { transform: rotate(-90deg); }
.collapsible.closed .collapse-body { display: none; }

/* Diarias */
.routine-list, .collapse-body > .routine + .routine { display: flex; flex-direction: column; gap: 10px; }
.collapse-body > .routine + .routine { margin-top: 10px; }
.routine { border-radius: var(--radius); overflow: hidden; }
.routine-list { gap: 12px; }
.rt-head { display: flex; align-items: center; gap: 12px; padding: 10px 8px 10px 12px; min-height: 58px; }
.rt-count {
  flex: none; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 17px; border: 0; cursor: pointer;
  background: var(--c); color: #fff; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums;
}
.rt-count.zero { background: var(--fill); color: var(--green); }
.rt-body { flex: 1; min-width: 0; cursor: pointer; }
.rt-body .meta { margin-top: 2px; }
.paused { color: var(--orange); font-weight: 600; }
.rt-chev svg { transition: transform .2s; }
.rt-chev.open svg { transform: rotate(180deg); }
.rt-list { list-style: none; margin: 0; padding: 0 12px 8px 58px; }
.rt-item { display: flex; align-items: center; gap: 10px; min-height: 40px; border-top: .5px solid var(--separator); font-size: 15px; }
.rt-item span:nth-child(2) { flex: 1; }
.rt-item.done span { color: var(--muted); text-decoration: line-through; }
.rt-actions { display: flex; align-items: center; gap: 8px; padding: 0 12px 12px 58px; flex-wrap: wrap; }

/* Tareas: búsqueda y filtros */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 4px; }
.search { flex: 1 1 220px; display: flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 999px; min-height: 42px; color: var(--muted); }
.search svg { width: 18px; height: 18px; flex: none; }
.search input { border: 0; background: transparent; outline: none; padding: 0; min-height: 40px; flex: 1; min-width: 0; color: var(--text); font-size: 16px; -webkit-appearance: none; appearance: none; }
.day-group + .day-group { margin-top: 16px; }
.group-title { font-size: 15px; font-weight: 600; margin: 0 0 8px 16px; }

/* Proyectos */
.item-card .top .fav, .proj-row .fav { margin-left: auto; }
.icon-btn.fav.on { color: var(--star); }
.swatch.emoji { font-size: 18px; color: initial; }
.swatch.sm { width: 30px; height: 30px; border-radius: 9px; font-size: 16px; display: grid; place-items: center; background: var(--c); flex: none; }
.proj-list { list-style: none; margin: 0; padding: 0; border-radius: var(--radius); overflow: hidden; }
.proj-list li + li { border-top: .5px solid var(--separator); }
.proj-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px 10px 14px; min-height: 58px; }
.proj-row .grow { display: flex; flex-direction: column; }
.proj-row .name { font-weight: 600; }
.mini-progress { width: 90px; display: flex; }
@media (max-width: 520px) { .mini-progress { display: none; } }
.next-card { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.next-card .title { font-weight: 600; }
.info-card .meta { display: flex; gap: 6px; flex-wrap: wrap; }
.info-card input[type=range] { width: 100%; accent-color: var(--accent); }

/* Revisión semanal */
.step-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.step-head h3 { margin: 2px 0 2px; font-size: 18px; }
.step-head p { margin: 0; }
.step-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--action-bg); color: var(--on-action); }
.pick-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pick-chip { border: .5px solid var(--separator); background: var(--glass-strong); border-radius: 999px; padding: 7px 14px; font-size: 14px; cursor: pointer; box-shadow: inset 3px 0 0 var(--c); }
.pick-chip.on { background: var(--action-bg); color: var(--on-action); border-color: transparent; font-weight: 600; }
.pick-chip.on .muted { color: inherit; }
.review-foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.settings-group .item .btn { flex: none; }

/* Semana: barra de herramientas y avisos */
.week-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -6px 0 12px; flex-wrap: wrap; }
.toolbar-right { display: flex; gap: 8px; }
.btn.attention { box-shadow: inset 0 0 0 1.5px var(--orange); }
.mobile-only-inline { }
@media (min-width: 1024px) { .mobile-only-inline { display: none !important; } }
.ev.clash { outline: 1.5px solid var(--orange); outline-offset: -1.5px; }
.ev-warn { color: var(--orange); }
.ev-rep, .ev-task { opacity: .7; margin-right: 3px; }
.chip-due { flex: none; font-size: 11px; color: var(--muted); }
.chip.late .chip-due { color: var(--orange); font-weight: 600; }
.goal-chip { color: var(--text); }
.goal-chip svg { width: 14px; height: 14px; flex: none; color: var(--c); }

/* Hojas: listas de acciones y campos nuevos */
.sheet-list { display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; background: var(--fill); }
.sheet-item { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 16px; border: 0; background: none; text-align: left; cursor: pointer; font-size: 17px; color: var(--text); }
.sheet-item + .sheet-item { border-top: .5px solid var(--separator); }
.sheet-item svg { width: 22px; height: 22px; color: var(--action); flex: none; }
.sheet-item span:nth-child(2) { flex: 1; }
.sheet-item:active { background: var(--fill-2); }
.sheet-sub { color: var(--muted); font-size: 14px; margin: -6px 0 0; text-align: center; }
.sheet-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sheet-actions .btn { flex: 1; }
.linked { font-size: 14px; padding: 10px 12px; border-radius: 12px; background: var(--fill); color: var(--text); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn.danger-soft { color: var(--red); background: var(--fill); }
.rep-wrap { display: flex; flex-direction: column; gap: 10px; }
#modal-form[data-rep="no"] .rep-days, #modal-form[data-rep="no"] .rep-until, #modal-form[data-rep="diaria"] .rep-days { display: none; }
#modal-form[data-pm="auto"] .pm-manual { display: none; }
.pm-manual input { accent-color: var(--accent); }
.days-pick { display: flex; gap: 6px; }
.days-pick label, .seg-radio label, .tag-pick label, .icon-pick label { cursor: pointer; }
.days-pick input, .seg-radio input, .tag-pick input, .icon-pick input { position: absolute; opacity: 0; pointer-events: none; }
.days-pick span { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--text); font-weight: 600; font-size: 14px; }
.days-pick input:checked + span { background: var(--action-bg); color: var(--on-action); }
.seg-radio { display: flex; padding: 3px; border-radius: 12px; background: var(--fill); }
.seg-radio label { flex: 1; }
.seg-radio span { display: block; text-align: center; padding: 7px 4px; border-radius: 9px; font-size: 13px; color: var(--text); white-space: nowrap; }
.seg-radio input:checked + span { background: var(--glass-strong); box-shadow: 0 3px 8px rgba(0,0,0,.12); font-weight: 600; }
.tag-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-pick span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: var(--fill); color: var(--text); font-size: 14px; }
.tag-pick span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.tag-pick input:checked + span { background: color-mix(in srgb, var(--c) 24%, transparent); box-shadow: inset 0 0 0 1.5px var(--c); font-weight: 600; }
.icon-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-pick span { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--fill); font-size: 20px; }
.icon-pick input:checked + span { box-shadow: inset 0 0 0 2px var(--action); background: var(--fill-2); }
.days-pick input:focus-visible + span, .seg-radio input:focus-visible + span, .tag-pick input:focus-visible + span, .icon-pick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.colors { align-items: center; }
.colors .color-auto input, .colors .color-custom input[type=radio] { display: none; }
.color-auto span { display: grid; place-items: center; height: 30px; padding: 0 10px; border-radius: 15px; background: var(--fill); color: var(--text); font-size: 13px; cursor: pointer; }
.color-auto:has(input:checked) span { box-shadow: inset 0 0 0 2px var(--action); font-weight: 600; }
.color-custom { position: relative; display: inline-grid; border-radius: 50%; }
.colors .color-custom input[type=color] { -webkit-appearance: auto; appearance: auto; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; overflow: hidden; }
.color-custom input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.color-custom input[type=color]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.color-custom::after { content: "+"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 700; pointer-events: none; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.color-custom:has(input[type=radio]:checked) { box-shadow: 0 0 0 3px var(--glass-strong), 0 0 0 5px var(--text); }
.subtasks { display: flex; flex-direction: column; gap: 6px; }
.sub-row, .sub-add { display: flex; align-items: center; gap: 8px; }
.sub-row input[type=text], .sub-add input { min-height: 38px; padding: 6px 12px; color: var(--text); }
.sub-row .icon-btn svg { width: 16px; height: 16px; }
.sub-add .icon-btn.round { width: 34px; height: 34px; }
.sub-add .icon-btn.round svg { width: 18px; height: 18px; }
.pick-list { border-radius: 14px; overflow: hidden; max-height: 55dvh; overflow-y: auto; }
.pick { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 48px; color: var(--text); font-size: 16px; cursor: pointer; }
.pick + .pick { border-top: .5px solid var(--separator); }

/* Ajustes */
.settings-group .item .inline { display: flex; align-items: center; gap: 8px; }
.settings-group input[type=time] { width: auto; min-height: 36px; padding: 6px 10px; }
.settings-group select.tz { max-width: 210px; }
label.item { cursor: pointer; }
.tag-item { flex-wrap: nowrap !important; }
.tag-item input[type=color] { -webkit-appearance: none; appearance: none; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: none; flex: none; cursor: pointer; }
.tag-item input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.tag-item input[type=color]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.tag-item input[type=color]::-moz-color-swatch { border: 0; border-radius: 50%; }
.inline-input { flex: 1; min-height: 36px !important; background: transparent !important; padding: 4px 0 !important; }

/* Enfoque a pantalla completa */
.focus-layer {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px;
  background: rgba(0, 0, 0, .35); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  animation: fade .2s;
}
.focus-layer[hidden] { display: none; }
.focus-card { position: relative; width: 100%; max-width: 460px; border-radius: 28px; padding: 22px 20px 20px; display: flex; flex-direction: column; gap: 16px; background: var(--glass-strong); animation: pop .25s cubic-bezier(.2,.9,.3,1); }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.focus-close { position: absolute; top: 14px; right: 14px; }
.focus-title { font-size: 24px; text-transform: none; letter-spacing: -.02em; color: var(--text); font-weight: 700; padding: 0 44px 0 0; margin-top: -10px; }
.focus-title.done { text-decoration: line-through; color: var(--muted); }
.focus-subs { display: flex; flex-direction: column; gap: 8px; }
.focus-subs label { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.focus-timer { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ring.big { width: 150px; height: 150px; }
.ring.big svg { width: 150px; height: 150px; }
.ring.big .time { font-size: 32px; }
.chips-row { display: flex; gap: 8px; }
.chip-btn { border: 0; background: var(--fill); color: var(--text); border-radius: 99px; padding: 7px 14px; font-weight: 600; font-size: 14px; cursor: pointer; }
.chip-btn.on { background: var(--action-bg); color: var(--on-action); }
.chip-btn:disabled { opacity: .5; }
.focus-timer p { margin: 0; text-align: center; }
.focus-actions { display: flex; gap: 10px; }
.focus-actions .btn { flex: 1; min-height: 48px; }
.focus-pill {
  position: fixed; z-index: 32; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tab-h) + 22px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 8px; max-width: min(320px, calc(100vw - 110px));
  border-radius: 99px; padding: 8px 14px; cursor: pointer; color: var(--text); font-size: 14px; border: .5px solid var(--glass-border);
}
.focus-pill[hidden] { display: none; }
.focus-pill svg { width: 14px; height: 14px; flex: none; color: var(--red); }
.focus-pill b { font-variant-numeric: tabular-nums; }
@media (min-width: 1024px) { .focus-pill { bottom: 24px; left: auto; right: 24px; transform: none; } }
body.focus-open { overflow: hidden; }
@media (max-width: 520px) {
  .task.prio .step-line { flex-direction: column; align-items: stretch; gap: 3px; }
  .task.prio [data-act="resched"] { display: none; }
}

/* ---------- v6: ventanas sin foco marcado y Semana en el teléfono ---------- */
#modal-form:focus, #modal-form:focus-visible { outline: none; }

.phone-week .week-toolbar { margin: -6px 0 10px; flex-wrap: nowrap; }
.grow-seg { flex: 1; }
.grow-seg button { flex: 1; }
.icon-btn.round.attention { box-shadow: inset 0 0 0 1.5px var(--orange); }
.icon-btn.round svg { width: 20px; height: 20px; }

/* Por planificar (plegado por defecto para que no se amontone) */
.ptray { border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.ptray-head { width: 100%; display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 12px 0 16px; border: 0; background: none; cursor: pointer; color: var(--text); font-weight: 600; font-size: 15px; text-align: left; }
.ptray-head .grow { font-weight: 400; }
.ptray-body { display: none; border-radius: 0; box-shadow: none; padding-top: 0; }
.ptray.open .ptray-body { display: flex; }
.wk-chev { display: grid; place-items: center; color: var(--muted); }
.wk-chev svg { width: 16px; height: 16px; transition: transform .22s; }
.ptray.open .ptray-head .wk-chev svg, .wk-day.open .wk-head .wk-chev svg { transform: rotate(180deg); }

/* Zona que se desliza a los lados */
.swipe-area { touch-action: pan-y; will-change: transform; }
.swipe-area * { touch-action: pan-y; }
.swipe-area .ev-resize { touch-action: none; }
.swipe-area.in-right { animation: in-right .26s cubic-bezier(.2,.9,.3,1); }
.swipe-area.in-left { animation: in-left .26s cubic-bezier(.2,.9,.3,1); }
@keyframes in-right { from { transform: translateX(40%); opacity: 0; } }
@keyframes in-left { from { transform: translateX(-40%); opacity: 0; } }

/* Semana: un desplegable por día */
.wk-list { display: flex; flex-direction: column; gap: 8px; }
.wk-day { border-radius: 18px; overflow: hidden; transition: box-shadow .15s; }
.wk-day.drop-over { box-shadow: 0 0 0 2px var(--action), var(--glass-shadow); }
.wk-day.past:not(.open) { opacity: .62; }
.wk-head { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 12px 8px 10px; border: 0; background: none; cursor: pointer; color: var(--text); text-align: left; }
.wk-date { flex: none; width: 46px; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.wk-dow { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.wk-num { font-size: 21px; font-weight: 700; min-width: 32px; height: 32px; border-radius: 16px; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.wk-day.is-today .wk-dow { color: var(--text); font-weight: 700; }
.wk-day.is-today .wk-num { background: var(--action-bg); color: var(--on-action); }
.wk-sum { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.wk-sum-text { font-size: 15px; font-weight: 500; }
.wk-dots { display: flex; gap: 4px; min-height: 6px; }
.wk-dots i { width: 18px; height: 5px; border-radius: 3px; background: var(--c); }
.wk-body { display: none; flex-direction: column; gap: 6px; padding: 0 12px 12px 68px; }
.wk-day.open .wk-body { display: flex; animation: fade .2s; }
.wk-ev { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 12px; cursor: pointer;
  background: color-mix(in srgb, var(--c) 18%, transparent); box-shadow: inset 3px 0 0 var(--c); }
.wk-ev.clash { outline: 1.5px solid var(--orange); outline-offset: -1.5px; }
.wk-ev.done .wk-title { text-decoration: line-through; color: var(--muted); }
.wk-time { flex: none; width: 44px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.25; }
.wk-time small { display: block; color: var(--muted); font-weight: 400; }
.wk-title { flex: 1; min-width: 0; font-size: 15px; line-height: 1.3; }
.wk-title small { display: block; color: var(--muted); font-size: 12px; }
.wk-tasks { display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }
.wk-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.wk-tasks .chip { font-size: 14px; padding: 7px 10px; }
.wk-empty { color: var(--muted); font-size: 14px; }
.wk-actions { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }

/* 3 días y Día: columnas anchas, sin desplazamiento lateral */
.cal-scroll.phone { overflow-x: hidden; scroll-snap-type: none; }
.cal-scroll.phone .cal-grid { grid-template-columns: 40px repeat(var(--days), minmax(0, 1fr)) !important; }
.phone-week .cal-scroll { height: calc(100dvh - var(--head-h) - 250px - env(safe-area-inset-bottom) - env(safe-area-inset-top)); min-height: 380px; }
.cal-scroll.phone.mode-3 .ev-time { display: block; }
.cal-scroll.phone .cal-hour span { font-size: 10px; right: 4px; }
.phone-week > .hint { padding-right: 64px; }

/* ---------- v7: progreso, planificar el día, dibujar bloques ---------- */
.cal-col { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.ev.preview.drawing { border-style: solid; background: color-mix(in srgb, var(--accent) 22%, transparent); }
.day-prog { display: flex; align-items: center; gap: 10px; }
.day-prog .stat-row { flex: 1; }
.plan-card { display: flex; align-items: center; gap: 10px; border-radius: var(--radius); padding: 12px 8px 12px 16px; margin-bottom: 20px; box-shadow: inset 4px 0 0 var(--accent), var(--glass-shadow); }
.plan-card .title { font-weight: 600; }
.plan-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.plan-summary div { background: var(--fill); border-radius: 12px; padding: 10px; text-align: center; display: flex; flex-direction: column; }
.plan-summary b { font-size: 20px; }
.plan-summary span { font-size: 12px; color: var(--muted); }
.free-slots { display: flex; flex-wrap: wrap; gap: 6px; }
.streak { color: var(--orange); font-weight: 700; }
.streak.big { font-size: 18px; flex: none; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); gap: 12px; margin-bottom: 28px; }
@media (max-width: 520px) { .stat-tiles { grid-template-columns: 1fr 1fr; } }
.tile { border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.tile b { font-size: 26px; letter-spacing: -.02em; }
.tile span { font-size: 13px; color: var(--muted); }
.tile small { font-size: 12px; font-weight: 600; }
.tile small.up { color: var(--green); }
.tile small.down { color: var(--orange); }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 170px; align-items: end; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.bar-track { flex: 1; width: 100%; max-width: 34px; display: flex; align-items: flex-end; border-radius: 8px; background: var(--fill); overflow: hidden; }
.bar { width: 100%; background: var(--accent); border-radius: 8px 8px 0 0; min-height: 0; transition: height .4s; }
.bar-col.today .bar { background: var(--orange); }
.bar-val { font-size: 12px; font-weight: 600; min-height: 16px; font-variant-numeric: tabular-nums; }
.bar-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.bar-col.today .bar-label { color: var(--orange); }
.login { gap: 8px !important; }
.login { flex-wrap: wrap; }
.login input { flex: 1 1 160px; width: auto; min-height: 38px; }
.login-actions { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.login-actions .ghost { margin-left: auto; }

/* ---------- v12: rendimiento en móvil ----------
   El desenfoque (backdrop-filter) es lo que más cuesta al hacer scroll en el móvil. Las tarjetas que
   van en la página solo tienen detrás el fondo de color, que ya es difuso, así que se ven igual sin él.
   Se mantiene en lo que flota sobre el contenido (barra inferior, hojas, cabeceras fijas, avisos). */
@media (max-width: 1023px) {
  .page .glass { -webkit-backdrop-filter: none; backdrop-filter: none; }
  body::before { will-change: transform; }
}

/* ---------- v13: lenguaje normal, ¿me cabe?, diario, calendarios externos, buscador ---------- */
.qa-preview { display: none; flex-wrap: wrap; gap: 6px; margin: -4px 4px 10px; }
.qa-preview.on { display: flex; }

.fit { border-radius: 18px; padding: 12px 14px; margin-bottom: var(--gap); }
.fit-top { display: flex; align-items: center; gap: 12px; }
.fit-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--fill); }
.fit-ic svg { width: 18px; height: 18px; }
.fit b { font-weight: 600; }
.fit-bar { height: 6px; border-radius: 3px; background: var(--fill); margin-top: 10px; overflow: hidden; }
.fit-bar span { display: block; height: 100%; border-radius: 3px; background: var(--green); transition: width .3s; }
.fit-tight .fit-bar span { background: var(--orange); }
.fit-over .fit-bar span { background: var(--red); }
.fit-ok .fit-ic { color: var(--green); }
.fit-tight .fit-ic { color: var(--orange); }
.fit-over .fit-ic { color: var(--red); }

.journal { border-radius: 18px; padding: 12px 14px; display: grid; gap: 10px; }
.j-row { display: flex; align-items: center; gap: 12px; }
.j-label { width: 64px; flex: none; color: var(--muted); font-size: 15px; }
.j-moods { display: flex; gap: 6px; flex-wrap: wrap; }
.j-mood { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--fill); font-size: 22px; cursor: pointer; filter: grayscale(.85); opacity: .7; transition: transform .15s, filter .15s, opacity .15s; }
.j-mood.on { filter: none; opacity: 1; transform: scale(1.12); background: var(--fill-2); }
.j-energy { display: flex; gap: 6px; }
.j-en { width: 30px; height: 18px; border-radius: 6px; border: 0; background: var(--fill); cursor: pointer; transition: background .15s; }
.j-en.on { background: var(--green); }
.j-note { min-height: 44px; resize: vertical; }

.mood-grid { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 4px; text-align: center; }
.mood-day { display: grid; gap: 4px; justify-items: center; font-size: 12px; color: var(--muted); }
.mood-day.today .md-d { color: var(--text); font-weight: 700; }
.md-emoji { font-size: 18px; line-height: 1; height: 20px; }
.md-en { width: 8px; height: 40px; border-radius: 4px; background: var(--fill); display: flex; align-items: flex-end; overflow: hidden; }
.md-en i { display: block; width: 100%; background: var(--green); border-radius: 4px; }
.md-n { font-weight: 600; color: var(--text); min-height: 16px; }
.insights { margin: 12px 0 0; padding-left: 18px; display: grid; gap: 6px; font-size: 15px; }

/* Eventos de calendarios externos: rayados y sin arrastre */
.ev.ext { cursor: default; background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--c) 16%, var(--glass-strong)) 0 6px, color-mix(in srgb, var(--c) 9%, var(--glass-strong)) 6px 12px); border-left-style: dotted; }
.wk-ev.ext { opacity: .92; background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--c) 12%, transparent) 0 6px, transparent 6px 12px); }
.block.ext { background-image: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--c) 8%, transparent) 0 6px, transparent 6px 12px); }
.chip.ext { border: 0; cursor: pointer; background: color-mix(in srgb, var(--c) 20%, var(--fill)); color: var(--text); }
.wk-allday { padding: 6px 10px; border-radius: 10px; font-size: 14px; font-weight: 500; background: color-mix(in srgb, var(--c) 20%, var(--fill)); cursor: pointer; }
.allday-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.dot-c { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; }
.howto { padding: 12px 14px; border-radius: 14px; background: var(--fill); line-height: 1.6; margin-top: 4px; }
button.item { width: 100%; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
button.item svg { width: 16px; height: 16px; color: var(--muted); flex: none; }

/* Buscador */
.page-head { position: relative; }
.ph-search { position: absolute; top: 0; right: 0; width: 34px; height: 34px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--fill); color: var(--action); cursor: pointer; }
.ph-search svg { width: 18px; height: 18px; }
@media (max-width: 1023px) { .page-head .eyebrow { padding-right: 44px; } }
.gsearch { position: relative; margin-bottom: 14px; }
.gsearch input { padding-left: 42px; }
.gs-ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.gs-ic svg { width: 18px; height: 18px; }
.gs-group { margin-bottom: 14px; }
.gs-h { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 4px 6px; }
.gs-list { border-radius: 14px; overflow: hidden; }
.gs-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; min-height: 48px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.gs-row + .gs-row { border-top: .5px solid var(--separator); }
.gs-row .grow { display: grid; min-width: 0; }
.gs-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-row.done .gs-title { text-decoration: line-through; color: var(--muted); }
.gs-kind { width: 24px; text-align: center; color: var(--muted); flex: none; }
.nav-search { display: none; }
@media (min-width: 1024px) {
  .nav-search { display: flex; align-items: center; gap: 12px; margin: -6px 4px 12px; padding: 9px 14px; border-radius: 14px; border: 0; background: var(--fill); color: var(--muted); font: inherit; font-size: 15px; cursor: pointer; }
  .nav-search svg { width: 18px; height: 18px; }
  .nav-search kbd { margin-left: auto; font: inherit; font-size: 12px; padding: 1px 7px; border-radius: 6px; background: var(--fill-2); }
}

#modal-form:not([data-rpt]) .rep-n, #modal-form[data-rpt=""] .rep-n { visibility: hidden; }

/* ---------- v14: desplegables propios y diseño más sobrio ---------- */
select.sel-native { display: none !important; }
.sel-btn {
  display: flex; align-items: center; width: 100%; min-height: 44px; padding: 10px 34px 10px 14px; border: 0; border-radius: 12px;
  background: var(--fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%238e8e93' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center / 12px;
  color: var(--text); font: inherit; font-size: 16px; text-align: left; cursor: pointer;
}
.sel-btn .sel-val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-btn.open, .sel-btn:focus-visible { outline: 1.5px solid var(--muted); outline-offset: 0; }
.sel-btn:disabled { opacity: .5; cursor: default; }
.focus .sel-btn { width: 100%; }
.settings-group .sel-btn { width: auto; min-height: 36px; }
.settings-group .sel-btn.sel-tz { max-width: 210px; }
.toolbar .sel-btn, .filters .sel-btn { width: auto; min-height: 36px; font-size: 14px; padding-top: 6px; padding-bottom: 6px; }
.sel-pop {
  position: fixed; z-index: 1000; overflow-y: auto; overscroll-behavior: contain; padding: 6px;
  background: var(--solid, var(--glass-strong)); border: .5px solid var(--separator); border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .22); animation: fade .12s;
}
.sel-pop[popover] { inset: auto; margin: 0; color: var(--text); }
.sel-opt { padding: 9px 12px 9px 34px; border-radius: 9px; font-size: 15px; color: var(--text); cursor: pointer; position: relative; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sel-opt.hi { background: var(--fill); }
@media (hover: hover) { .sel-opt:hover { background: var(--fill); } }
.sel-opt.on { font-weight: 600; }
.sel-opt.on::before { content: ""; position: absolute; left: 13px; top: 50%; width: 9px; height: 5px; margin-top: -4px; border: solid var(--text); border-width: 0 0 2px 2px; transform: rotate(-45deg); }
.sel-opt.off { opacity: .4; pointer-events: none; }

/* Fechas y horas nativas con el mismo tema y sin color chillón */
input[type=date], input[type=time] { accent-color: var(--action); }
input[type=date]::-webkit-calendar-picker-indicator, input[type=time]::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }
input:focus-visible, textarea:focus-visible { outline: 1.5px solid var(--muted); }

/* Hoy sin círculo: número en negrita con una rayita debajo */
.is-today .cal-dnum, .wk-day.is-today .wk-num { background: none; color: var(--text); font-weight: 800; position: relative; }
.is-today .cal-dnum::after, .wk-day.is-today .wk-num::after { content: ""; position: absolute; left: 50%; bottom: -3px; width: 14px; height: 2px; margin-left: -7px; border-radius: 1px; background: var(--text); }
.is-today .cal-dname, .wk-day.is-today .wk-dow { color: var(--text); }
.cal-col.is-today { background-color: color-mix(in srgb, var(--text) 3%, transparent); }

/* Menos adornos */
body::before { opacity: .45; }
:root { --glass-shadow: 0 2px 10px rgba(31, 38, 80, .05), inset 0 1px 0 rgba(255, 255, 255, .5); }
@media (prefers-color-scheme: dark) { :root { --glass-shadow: 0 2px 12px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .04); } }
.btn.attention, .icon-btn.round.attention { box-shadow: none; position: relative; }
.btn.attention::after, .icon-btn.round.attention::after { content: ""; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }
.ev.ext, .wk-ev.ext, .block.ext { background-image: none; }
.ev.ext { background: color-mix(in srgb, var(--c) 10%, var(--glass-strong)); border-left-style: dashed; }
.wk-ev.ext { background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 35%, transparent); }
.block.ext::before { opacity: .5; }

/* v14.1: en móvil el título de Hoy se ajusta para que la fecha se lea entera */
@media (max-width: 480px) {
  .page-today .page-head h1 { font-size: clamp(21px, 6.6vw, 30px); }
  .page-today .ph-actions { gap: 6px; }
  /* En el móvil «Hoy» del menú ya vuelve al día de hoy */
  .page-today .ph-actions [data-n="0"] { display: none; }
}
.page-head .t-short { display: none; }
@media (max-width: 370px) { .page-head .t-long { display: none; } .page-head .t-short { display: inline; } }

/* ---------- v16: bienvenida (onboarding) ---------- */
body.ob-open { overflow: hidden; }
.ob {
  position: fixed; inset: 0; z-index: 3000; display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg); color: var(--text); opacity: 0; transition: opacity .35s;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); touch-action: pan-y;
}
.ob::before { content: ""; position: absolute; inset: -20%; background: radial-gradient(40% 35% at 20% 15%, var(--blob-1), transparent 70%), radial-gradient(40% 35% at 85% 30%, var(--blob-2), transparent 70%); opacity: .35; pointer-events: none; }
.ob.in { opacity: 1; }
.ob.out { opacity: 0; transform: scale(1.02); transition: opacity .35s, transform .35s; pointer-events: none; }
.ob-skip { position: absolute; top: calc(env(safe-area-inset-top) + 14px); right: 16px; z-index: 2; border: 0; background: var(--fill); color: var(--text); font: inherit; font-size: 15px; padding: 7px 14px; border-radius: 99px; cursor: pointer; transition: opacity .25s; }
.ob.last .ob-skip { opacity: 0; pointer-events: none; }
.ob-track { flex: 1; display: flex; min-height: 0; transition: transform .5s cubic-bezier(.22,.9,.24,1); will-change: transform; }
.ob-slide { flex: 0 0 100%; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 64px 24px 12px; overflow: hidden; }
.ob-stage { width: 100%; max-width: 380px; height: min(46vh, 340px); display: grid; place-items: center; position: relative; }
.ob-copy { max-width: 420px; text-align: center; }
.ob-step { font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: .02em; margin-bottom: 6px; }
.ob h2 { font-size: 26px; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 10px; }
.ob p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.45; }
.ob-slide .ob-copy > * { opacity: 0; transform: translateY(10px); }
.ob-slide.on .ob-copy > * { animation: ob-up .55s cubic-bezier(.2,.8,.2,1) forwards; }
.ob-slide.on .ob-copy > :nth-child(2) { animation-delay: .07s; }
.ob-slide.on .ob-copy > :nth-child(3) { animation-delay: .14s; }
@keyframes ob-up { to { opacity: 1; transform: none; } }
.ob-foot { display: flex; align-items: center; gap: 12px; padding: 12px 20px 20px; max-width: 520px; width: 100%; margin: 0 auto; position: relative; }
.ob-back { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--fill); color: var(--text); display: grid; place-items: center; cursor: pointer; flex: none; transition: opacity .25s; }
.ob-back svg { width: 20px; height: 20px; }
.ob.first .ob-back { opacity: 0; pointer-events: none; }
.ob-dots { flex: 1; display: flex; justify-content: center; gap: 6px; }
.ob-dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 99px; background: var(--fill-2); cursor: pointer; transition: width .35s cubic-bezier(.2,.8,.2,1), background .35s; }
.ob-dots button.on { width: 22px; background: var(--text); }
.ob-next { min-width: 118px; min-height: 44px; border-radius: 99px; }
.ob.last .ob-next { opacity: 0; pointer-events: none; }

/* Piezas comunes de las demostraciones */
.ob-card { width: 100%; background: var(--glass-strong); border: .5px solid var(--glass-border); border-radius: 20px; padding: 16px; box-shadow: 0 18px 40px rgba(0,0,0,.14); }
.ob-m { font-size: 13px; color: var(--muted); }
.ob-bar { height: 6px; border-radius: 99px; background: var(--fill-2); overflow: hidden; }
.ob-bar > span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--green); }
.ob-task { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-top: .5px solid var(--separator); }
.ob-t { font-size: 16px; position: relative; display: inline-block; }
.ob-t::after { content: ""; position: absolute; left: 0; top: 55%; height: 1.5px; width: 0; background: var(--muted); }
.ob-check { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--muted); flex: none; display: grid; place-items: center; }
.ob-check svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 14; stroke-dashoffset: 14; }
.ob-chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 99px; background: var(--fill); font-size: 13px; font-weight: 600; }
.ob-slide:not(.on) * { animation-play-state: paused !important; }

/* 1 · Bienvenida */
.demo-welcome { position: relative; width: 100%; height: 100%; }
.dw-icon { position: absolute; left: 50%; top: 42%; width: 104px; height: 104px; margin: -52px 0 0 -52px; border-radius: 26px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.on .dw-icon { animation: ob-pop .7s cubic-bezier(.3,1.5,.5,1) both, ob-float 4s 1s ease-in-out infinite; }
.dw-card { position: absolute; padding: 10px 14px; border-radius: 14px; background: var(--glass-strong); border: .5px solid var(--glass-border); box-shadow: 0 10px 30px rgba(0,0,0,.14); font-size: 14px; font-weight: 600; white-space: nowrap; opacity: 0; }
.dw-1 { left: 0; top: 6%; } .dw-2 { right: 0; top: 30%; } .dw-3 { left: 8%; bottom: 4%; }
.on .dw-card { animation: ob-in .6s cubic-bezier(.2,.8,.2,1) forwards, ob-float 5s ease-in-out infinite; }
.on .dw-1 { animation-delay: .35s, 1s; } .on .dw-2 { animation-delay: .55s, 1.6s; } .on .dw-3 { animation-delay: .75s, 2.2s; }
@keyframes ob-pop { from { transform: scale(.4); opacity: 0; } }
@keyframes ob-in { from { opacity: 0; transform: translateY(16px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes ob-float { 50% { translate: 0 -6px; } }

/* 2 · Hoy: las tareas se marcan una tras otra */
.ob-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 10px; }
.dt-count { display: inline-flex; gap: 4px; text-transform: none; }
.dt-num { position: relative; display: inline-block; width: 1ch; height: 1em; }
.dt-count b { position: absolute; left: 0; top: 0; color: var(--text); opacity: 0; }
.dt-count .n0 { opacity: 1; }
.demo-today .ob-bar { margin-bottom: 8px; }
.on .demo-today .ob-bar > span { animation: dt-bar 6s infinite; }
@keyframes dt-bar { 0%, 19% { width: 0; } 25%, 44% { width: 33.3%; } 50%, 69% { width: 66.6%; } 75%, 94% { width: 100%; } 98%, 100% { width: 0; } }
.on .demo-today .dt-1 .ob-check { animation: dt-check1 6s infinite; }
.on .demo-today .dt-1 .ob-check svg { animation: dt-tick1 6s infinite; }
.on .demo-today .dt-1 .ob-t::after { animation: dt-strike1 6s infinite; }
@keyframes dt-check1 { 0%, 17% { background: transparent; border-color: var(--muted); transform: none; } 19% { transform: scale(.82); background: transparent; border-color: var(--muted); } 21% { background: var(--green); border-color: var(--green); transform: scale(1.08); } 24%, 94% { background: var(--green); border-color: var(--green); transform: none; } 98%, 100% { background: transparent; border-color: var(--muted); } }
@keyframes dt-tick1 { 0%, 19% { stroke-dashoffset: 14; } 24%, 94% { stroke-dashoffset: 0; } 98%, 100% { stroke-dashoffset: 14; } }
@keyframes dt-strike1 { 0%, 21% { width: 0; } 27%, 94% { width: 100%; } 98%, 100% { width: 0; } }
.on .demo-today .dt-2 .ob-check { animation: dt-check2 6s infinite; }
.on .demo-today .dt-2 .ob-check svg { animation: dt-tick2 6s infinite; }
.on .demo-today .dt-2 .ob-t::after { animation: dt-strike2 6s infinite; }
@keyframes dt-check2 { 0%, 42% { background: transparent; border-color: var(--muted); transform: none; } 44% { transform: scale(.82); background: transparent; border-color: var(--muted); } 46% { background: var(--green); border-color: var(--green); transform: scale(1.08); } 49%, 94% { background: var(--green); border-color: var(--green); transform: none; } 98%, 100% { background: transparent; border-color: var(--muted); } }
@keyframes dt-tick2 { 0%, 44% { stroke-dashoffset: 14; } 49%, 94% { stroke-dashoffset: 0; } 98%, 100% { stroke-dashoffset: 14; } }
@keyframes dt-strike2 { 0%, 46% { width: 0; } 52%, 94% { width: 100%; } 98%, 100% { width: 0; } }
.on .demo-today .dt-3 .ob-check { animation: dt-check3 6s infinite; }
.on .demo-today .dt-3 .ob-check svg { animation: dt-tick3 6s infinite; }
.on .demo-today .dt-3 .ob-t::after { animation: dt-strike3 6s infinite; }
@keyframes dt-check3 { 0%, 67% { background: transparent; border-color: var(--muted); transform: none; } 69% { transform: scale(.82); background: transparent; border-color: var(--muted); } 71% { background: var(--green); border-color: var(--green); transform: scale(1.08); } 74%, 94% { background: var(--green); border-color: var(--green); transform: none; } 98%, 100% { background: transparent; border-color: var(--muted); } }
@keyframes dt-tick3 { 0%, 69% { stroke-dashoffset: 14; } 74%, 94% { stroke-dashoffset: 0; } 98%, 100% { stroke-dashoffset: 14; } }
@keyframes dt-strike3 { 0%, 71% { width: 0; } 77%, 94% { width: 100%; } 98%, 100% { width: 0; } }
.on .dt-count .n0 { animation: dt-n0 6s infinite; } .on .dt-count .n1 { animation: dt-n1 6s infinite; } .on .dt-count .n2 { animation: dt-n2 6s infinite; } .on .dt-count .n3 { animation: dt-n3 6s infinite; }
@keyframes dt-n0 { 0%, 20% { opacity: 1; } 21%, 100% { opacity: 0; } }
@keyframes dt-n1 { 0%, 20% { opacity: 0; } 21%, 45% { opacity: 1; } 46%, 100% { opacity: 0; } }
@keyframes dt-n2 { 0%, 45% { opacity: 0; } 46%, 70% { opacity: 1; } 71%, 100% { opacity: 0; } }
@keyframes dt-n3 { 0%, 70% { opacity: 0; } 71%, 96% { opacity: 1; } 97%, 100% { opacity: 0; } }

/* 3 · Apuntar como hablas */
.dq-input { display: flex; align-items: center; min-height: 48px; padding: 0 8px 0 14px; border-radius: 14px; background: var(--fill); font-size: 16px; }
.dq-text { white-space: pre; }
.dq-caret { width: 2px; height: 20px; background: var(--text); margin-left: 1px; animation: ob-blink 1s steps(1) infinite; }
.dq-plus { margin-left: auto; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-weight: 700; }
@keyframes ob-blink { 50% { opacity: 0; } }
.dq-chips { display: flex; gap: 6px; flex-wrap: wrap; min-height: 30px; margin: 12px 0 6px; }
.dq-chips .ob-chip { opacity: 0; transform: scale(.7); }
.typed .dq-chips .ob-chip { animation: ob-chip .45s cubic-bezier(.3,1.6,.5,1) forwards; }
.typed .dq-chips .c2 { animation-delay: .12s; } .typed .dq-chips .c3 { animation-delay: .24s; }
@keyframes ob-chip { to { opacity: 1; transform: none; } }
.dq-task { opacity: 0; transform: translateY(12px); }
.typed .dq-task { animation: ob-in .5s .7s cubic-bezier(.2,.8,.2,1) forwards; }

/* 4 · Semana: arrastrar una tarea a una hora */
.dw-days { display: grid; grid-template-columns: repeat(5, 1fr); text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.dw-days .on { color: var(--text); }
.dw-grid { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); grid-auto-rows: 44px; border-radius: 12px; overflow: hidden; }
.dw-grid i { border-right: .5px solid var(--separator); border-bottom: .5px solid var(--separator); }
.dw-grid i:nth-child(5n) { border-right: 0; }
.dw-block { position: absolute; width: calc(20% - 6px); padding: 5px 7px; border-radius: 8px; font-size: 11px; font-weight: 700; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 22%, transparent); }
.b1 { --c: var(--green); left: calc(0% + 3px); top: 92px; height: 38px; }
.b2 { --c: #5e5ce6; left: calc(60% + 3px); top: 4px; height: 80px; }
.dw-drag { --c: var(--orange); position: absolute; left: 6px; top: -46px; width: calc(20% - 6px); padding: 5px 7px; border-radius: 8px; font-size: 11px; font-weight: 700; background: var(--glass-strong); border: .5px solid var(--glass-border); box-shadow: 0 8px 20px rgba(0,0,0,.2); }
.demo-week { overflow: visible; padding-top: 60px; }
.on .dw-drag { animation: dw-move 4.5s cubic-bezier(.45,.05,.3,1) infinite; }
@keyframes dw-move {
  0%, 12% { transform: translate(0, 0); background: var(--glass-strong); height: 26px; border-left: 0 solid var(--c); }
  20% { transform: translate(0, 0) scale(1.06) rotate(-2deg); }
  50% { transform: translate(calc(100% + 6px), 100px) scale(1.06) rotate(-2deg); background: var(--glass-strong); height: 26px; }
  58%, 92% { transform: translate(calc(100% + 6px), 100px); background: color-mix(in srgb, var(--orange) 22%, transparent); height: 80px; border-left: 3px solid var(--c); box-shadow: none; }
  100% { transform: translate(calc(100% + 6px), 100px); opacity: 0; height: 80px; }
}
.dw-hand { position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; background: rgba(127,127,127,.35); border: 2px solid rgba(255,255,255,.8); opacity: 0; pointer-events: none; }
.demo-week { position: relative; }
.on .dw-hand { animation: dw-hand 4.5s cubic-bezier(.45,.05,.3,1) infinite; }
@keyframes dw-hand { 0%, 8% { opacity: 0; transform: scale(1.5); } 14%, 50% { opacity: 1; transform: none; } 58%, 100% { opacity: 0; transform: scale(1.5); } }

/* 5 · ¿Me cabe hoy? */
.df-row { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.df-ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); }
.df-title { font-weight: 700; position: relative; height: 22px; }
.df-title span { position: absolute; left: 0; top: 0; white-space: nowrap; }
.df-title .ok { color: var(--green); } .df-title .ko { color: var(--red); opacity: 0; }
.df-bar { display: flex; gap: 3px; height: 12px; border-radius: 99px; background: var(--fill-2); overflow: hidden; }
.df-bar span { height: 100%; width: 0; border-radius: 3px; background: var(--c); }
.df-bar .s1 { --c: #5e5ce6; --w: 22%; } .df-bar .s2 { --c: var(--orange); --w: 18%; } .df-bar .s3 { --c: var(--green); --w: 14%; } .df-bar .s4 { --c: var(--red); --w: 46%; }
.on .df-bar .s1 { animation: df-s 7s infinite; } .on .df-bar .s2 { animation: df-s 7s .25s infinite; } .on .df-bar .s3 { animation: df-s 7s .5s infinite; }
.on .df-bar .s4 { animation: df-s4 7s infinite; }
@keyframes df-s { 0%, 6% { width: 0; } 16%, 94% { width: var(--w); } 100% { width: 0; } }
@keyframes df-s4 { 0%, 34% { width: 0; } 44%, 64% { width: var(--w); } 74%, 100% { width: 0; } }
.on .df-title .ok { animation: df-ok 7s infinite; } .on .df-title .ko { animation: df-ko 7s infinite; }
@keyframes df-ok { 0%, 36% { opacity: 1; } 40%, 70% { opacity: 0; } 74%, 100% { opacity: 1; } }
@keyframes df-ko { 0%, 36% { opacity: 0; } 40%, 70% { opacity: 1; } 74%, 100% { opacity: 0; } }
.df-btn { margin-top: 16px; display: inline-block; padding: 8px 14px; border-radius: 99px; background: var(--fill); font-size: 14px; font-weight: 600; }
.on .df-btn { animation: df-btn 7s infinite; }
@keyframes df-btn { 0%, 52% { transform: none; } 56% { transform: scale(.92); background: var(--fill-2); } 60%, 100% { transform: none; } }

/* 6 · Enfoque */
.demo-focus { position: relative; width: 230px; height: 230px; display: grid; place-items: center; }
.df-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.df-ring circle { fill: none; stroke: var(--fill-2); stroke-width: 7; }
.df-ring .arc { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 327; stroke-dashoffset: 0; }
.on .df-ring .arc { animation: df-arc 9s linear infinite; }
@keyframes df-arc { to { stroke-dashoffset: 327; } }
.df-time { font-size: 46px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin-top: -16px; }
.df-label { position: absolute; bottom: 62px; font-size: 14px; color: var(--muted); }
.on .demo-focus { animation: ob-pop .6s cubic-bezier(.3,1.4,.5,1) both; }

/* 7 · Objetivos */
.demo-goals { width: 100%; display: grid; gap: 14px; }
.dg-card { display: grid; gap: 8px; opacity: 0; }
.on .dg-card { animation: ob-in .6s cubic-bezier(.2,.8,.2,1) forwards; }
.on .dg-card:nth-child(2) { animation-delay: .2s; }
.dg-h { display: flex; align-items: center; gap: 10px; }
.dg-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 25%, transparent); font-size: 15px; }
.on .ob-bar .g1 { animation: dg-bar 5s .4s cubic-bezier(.2,.8,.2,1) infinite; --w: 62%; }
.on .ob-bar .g2 { animation: dg-bar 5s .7s cubic-bezier(.2,.8,.2,1) infinite; --w: 60%; background: #0a84ff; }
@keyframes dg-bar { 0% { width: 0; } 30%, 90% { width: var(--w); } 100% { width: var(--w); opacity: 0; } }

/* 8 · Progreso y sincronización */
.dp-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.dp-fire { font-size: 26px; display: inline-block; }
.on .dp-fire { animation: dp-fire 1.6s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes dp-fire { 50% { transform: scale(1.12) rotate(-4deg); } }
.dp-n { font-size: 30px; }
.dp-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 110px; align-items: end; }
.dp-bars span { height: var(--h); border-radius: 6px; background: var(--accent); transform-origin: bottom; transform: scaleY(0); }
.on .dp-bars span { animation: dp-bar .7s var(--d) cubic-bezier(.2,.9,.3,1.2) forwards; }
@keyframes dp-bar { to { transform: none; } }
.dp-sync { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; font-size: 24px; }
.dp-dots { display: flex; gap: 6px; }
.dp-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .25; }
.on .dp-dots i { animation: dp-dot 1.2s infinite; } .on .dp-dots i:nth-child(2) { animation-delay: .2s; } .on .dp-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes dp-dot { 30% { opacity: 1; transform: scale(1.3); } }

/* 9 · Entrar o crear cuenta */
.ob-login { justify-content: center; }
.ob-login-box { width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.ob-logo { width: 72px; height: 72px; border-radius: 18px; margin-bottom: 6px; box-shadow: 0 14px 34px rgba(0,0,0,.2); }
.on .ob-logo { animation: ob-pop .6s cubic-bezier(.3,1.5,.5,1) both; }
.ob-login-box > * { opacity: 0; }
.ob-login.on .ob-login-box > * { animation: ob-up .5s cubic-bezier(.2,.8,.2,1) forwards; }
.ob-login.on .ob-login-box > :nth-child(2) { animation-delay: .06s; } .ob-login.on .ob-login-box > :nth-child(3) { animation-delay: .12s; }
.ob-login.on .ob-login-box > :nth-child(4) { animation-delay: .18s; } .ob-login.on .ob-login-box > :nth-child(5) { animation-delay: .24s; }
.ob-form { width: 100%; display: grid; gap: 10px; margin-top: 10px; }
.ob-form input { width: 100%; min-height: 50px; padding: 0 16px; border-radius: 14px; border: 0; background: var(--fill); color: var(--text); font: inherit; }
.ob-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.ob-msg { font-size: 14px; color: var(--muted); min-height: 0; }
.ob-msg:empty { display: none; }
.ob-msg.bad { color: var(--red); }
.ob-later { margin-top: 6px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 8px; }
@media (min-width: 900px) {
  .ob-slide { flex-direction: row; gap: 64px; padding: 40px 64px; }
  .ob-copy { text-align: left; }
  .ob-stage { max-width: 420px; height: 380px; }
  .ob h2 { font-size: 34px; }
  .ob-login { flex-direction: column; }
}
@media (max-height: 640px) { .ob-stage { height: 38vh; } .ob-slide { gap: 18px; padding-top: 56px; } .ob h2 { font-size: 22px; } }
@media (prefers-reduced-motion: reduce) {
  .ob *, .ob *::before, .ob *::after { animation: none !important; transition: none !important; }
  .ob-slide .ob-copy > *, .dw-card, .dg-card, .ob-login-box > *, .dq-chips .ob-chip, .dq-task { opacity: 1 !important; transform: none !important; }
  .dp-bars span { transform: none; }
  .ob-bar > span { width: 60%; }
}

/* ---------- v16: animaciones de la app (solo opacidad y transformaciones: nada mueve el diseño) ---------- */
/* Marcar una tarea: el círculo rebota y sale una onda */
.just-done .check { animation: chk-pop .45s cubic-bezier(.3,1.6,.5,1); }
@keyframes chk-pop { 0% { transform: scale(.7); } 60% { transform: scale(1.15); } 100% { transform: none; } }
.just-done .title { animation: done-fade .5s ease; }
@keyframes done-fade { from { opacity: .4; } }
.just-done .check { box-shadow: 0 0 0 0 var(--accent); animation: chk-pop .45s cubic-bezier(.3,1.6,.5,1), chk-ring .6s ease-out; }
@keyframes chk-ring { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } to { box-shadow: 0 0 0 12px transparent; } }
/* Desplegables: se abren desde su campo */
.sel-pop { transform-origin: top center; animation: sel-in .16s cubic-bezier(.2,.8,.2,1); }
@keyframes sel-in { from { opacity: 0; transform: translateY(-4px) scale(.97); } }
/* Ordenador: las tarjetas responden al ratón */
@media (hover: hover) and (pointer: fine) {
  .item-card { transition: transform .18s, box-shadow .18s; }
  .item-card:hover { transform: translateY(-2px); }
}

/* v16 ajustes de la bienvenida: títulos normales, blanco en oscuro (no azul) y acceso que cabe en móviles bajos */
.ob h2 { text-transform: none; color: var(--text); font-weight: 700; padding: 0; letter-spacing: -.02em; }
.ob:focus { outline: none; }
.ob-next:focus:not(:focus-visible), .ob-back:focus:not(:focus-visible), .ob-dots button:focus:not(:focus-visible) { outline: none; }
.dq-plus { background: var(--action-bg); color: var(--on-action); }
.df-ring .arc { stroke: var(--action); }
.dp-bars span { background: var(--action); }
.ob-form input:focus { outline-color: var(--action); }
.ob-form .btn.primary { background: var(--action-bg); color: var(--on-action); }
.dw-icon { top: 52%; width: 92px; height: 92px; margin: -46px 0 0 -46px; border-radius: 22px; }
.dw-1 { left: 0; top: 2%; }
.dw-2 { right: 0; left: auto; top: 17%; }
.dw-3 { left: 10%; bottom: 2%; }
.ob-login { overflow-y: auto; justify-content: flex-start; padding-top: 48px; padding-bottom: 8px; }
.ob-login-box { margin: auto 0; }
@media (max-height: 700px) { .ob-logo { width: 56px; height: 56px; border-radius: 14px; } .ob-login-box { gap: 6px; } .ob-form { gap: 8px; } .ob-form input { min-height: 46px; } }

@media (min-width: 1100px) { .ob-stage { max-width: 460px; height: 440px; } .ob-stage > * { zoom: 1.15; } .ob-copy { max-width: 440px; } }

/* ---------- v17: tutorial guiado (oscurece y deja un hueco sobre lo que hay que tocar) ---------- */
.tour { position: fixed; inset: 0; z-index: 2500; margin: 0; padding: 0; border: 0; background: none; width: auto; height: auto; max-width: none; max-height: none; overflow: visible; pointer-events: none; color: var(--text); animation: fade .3s; }
.tour.out { opacity: 0; transition: opacity .25s; }
.tour-shade { position: absolute; inset: 0; background: rgba(0, 0, 0, .62); pointer-events: auto; transition: clip-path .35s cubic-bezier(.2,.8,.2,1); }
.tour-ring { position: absolute; border-radius: 14px; box-shadow: 0 0 0 2px #fff, 0 0 0 6px rgba(255,255,255,.25); pointer-events: none; transition: left .35s cubic-bezier(.2,.8,.2,1), top .35s cubic-bezier(.2,.8,.2,1), width .35s cubic-bezier(.2,.8,.2,1), height .35s cubic-bezier(.2,.8,.2,1), opacity .2s; }
.tour-ring::after { content: ""; position: absolute; inset: -2px; border-radius: inherit; box-shadow: 0 0 0 2px #fff; animation: tour-pulse 1.6s ease-out infinite; }
@keyframes tour-pulse { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(1.12); } }
.tour-tip { position: absolute; pointer-events: auto; padding: 16px 16px 12px; border-radius: 18px; background: var(--solid, var(--glass-strong)); border: .5px solid var(--glass-border); box-shadow: 0 18px 50px rgba(0,0,0,.35); transition: left .35s cubic-bezier(.2,.8,.2,1), top .35s cubic-bezier(.2,.8,.2,1); }
.tour-tip.in { animation: tour-in .4s cubic-bezier(.2,.8,.2,1); }
@keyframes tour-in { from { opacity: 0; transform: translateY(8px) scale(.97); } }
.tour-count { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.tour-title { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.tour-text { font-size: 15px; line-height: 1.4; color: var(--muted); }
.tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.tour-skip { border: 0; background: none; color: var(--muted); font: inherit; font-size: 14px; padding: 6px 0; cursor: pointer; }
.tour-next[hidden] { display: none; }
.tour-actions .btn.primary { background: var(--action-bg); color: var(--on-action); }
@media (prefers-reduced-motion: reduce) { .tour-ring::after { display: none; } }

/* v18: en los pasos de solo mirar no se puede tocar nada (ni siquiera lo resaltado) */
.tour-block { position: absolute; inset: 0; pointer-events: none; }
.tour.look .tour-block { pointer-events: auto; }
