/* ── RESET & VARIABLES ── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  /* Sin flash azul/gris nativo al tocar — el feedback táctil lo dan los
     :active de cada elemento tocable, no el navegador. */
  -webkit-tap-highlight-color: transparent;
}

:root {
  /* ── Tema oscuro (default) ── */
  --bg:        #050507;
  --bg2:       #09090B;
  --bg3:       #0D0D11;
  --surface:   rgba(13, 13, 17, 0.75);
  --card:      #1C1C1E;
  --border:    rgba(255, 255, 255, 0.05);
  --border2:   rgba(255, 255, 255, 0.09);
  --text:      #FFFFFF;
  --text2:     #FFFFFF;
  --text3:     #FFFFFF;
  --text4:     #FFFFFF;
  --text-muted: #8E8E93;
  --accent:    #6366F1;
  --accent-rgb: 99, 102, 241;
  --success:   #10B981;
  --success-text: #6EE7B7;
  --danger:    #F43F5E;
  --danger-text: #FCA5A5;
  --warning:   #F59E0B;
  --warning-text: #FDBA74;
  --purple-text: #A78BFA;
  --cyan-text: #06B6D4;
  --accent-text: #A5B4FC;
  --overlay-strong: rgba(255,255,255,0.14);
  --bg-blur:   rgba(5,5,7,0.92);
  --bg2-blur:  rgba(9,9,11,0.88);
  --card-blur: rgba(26,28,30,0.97);
  --slot-h:    48px;
  --shadow-card: none;
}

/* ── Tema claro ── */
[data-theme="light"] {
  --bg:        #FBFAF8;
  --bg2:       #F5F3EF;
  --bg3:       #EFE9DF;
  --surface:   rgba(255, 255, 255, 0.85);
  --card:      #FFFFFF;
  --border:    #EFE9DF;
  --border2:   #E5DFD3;
  --text:      #1C1917;
  --text2:     #1C1917;
  --text3:     #1C1917;
  --text4:     #1C1917;
  --text-muted: #78716C;
  --accent:    #6366F1;
  --accent-rgb: 99, 102, 241;
  --success:   #10B981;
  --success-text: #059669;
  --danger:    #F43F5E;
  --danger-text: #E11D48;
  --warning:   #F59E0B;
  --warning-text: #B45309;
  --purple-text: #7C3AED;
  --cyan-text: #0E7490;
  --accent-text: #4338CA;
  --overlay-strong: rgba(28,25,23,0.10);
  --bg-blur:   rgba(251,250,248,0.92);
  --bg2-blur:  rgba(245,243,239,0.90);
  --card-blur: rgba(255,255,255,0.94);
  --shadow-card: 0 1px 3px rgba(28, 25, 23, 0.08), 0 1px 2px rgba(28, 25, 23, 0.04);
}

/* Kill ALL browser input styling */
input, textarea, select, button {
  font-family: 'Geist', sans-serif;
}

input {
  -webkit-appearance: none;
  appearance: none;
  box-shadow: none;
  -webkit-box-shadow: none;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px var(--bg) inset !important;
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--accent);
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Geist', sans-serif;
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ── BOOT LOADING ── */
.boot-loading {
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.boot-logo {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 32px;
  color: var(--text);
  opacity: 0.5;
  animation: bootPulse 1.4s ease-in-out infinite;
}

@keyframes bootPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.7; }
}

/* ── AUTH ── */
.auth-screen {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

/* Cartel arriba del form — deja claro que el registro "pasa por
   Foquito" antes de que exista sesión. Sin avatar (sacado a pedido de
   Marco), solo el texto. */
.auth-foq-hint {
  width: 100%;
  max-width: 340px;
  padding: 0 24px;
  margin-bottom: 18px;
  cursor: pointer;
}

.auth-foq-bubble {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 10px 13px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text2);
  text-align: center;
  transition: border-color .15s;
}

.auth-foq-hint:hover .auth-foq-bubble { border-color: var(--accent); color: var(--text); }

@media (min-width: 768px) {
  .auth-foq-hint { max-width: 420px; }
  .auth-foq-bubble { font-size: 14px; padding: 12px 16px; }
}

.auth-box {
  width: 100%;
  max-width: 360px;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-logo {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 36px;
  color: var(--text);
  text-align: center;
  margin-bottom: 2px;
  letter-spacing: -0.5px;
}

.auth-tagline {
  font-size: 13px;
  color: var(--text3);
  text-align: center;
  margin-bottom: 10px;
}

.auth-google {
  display: flex;
  justify-content: center;
  min-height: 40px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text3);
}

.auth-divider span {
  flex: 1;
  height: 1px;
  background: var(--border2);
}

.auth-switch {
  font-size: 12px;
  color: var(--text3);
  text-align: center;
  cursor: pointer;
  margin-top: 2px;
}

.auth-switch span {
  color: var(--accent);
  font-weight: 500;
}

.auth-confirm-text {
  font-size: 13px;
  color: var(--text2);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 6px;
}

.auth-input {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 13px 16px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.auth-input:focus { border-color: var(--accent); }
.auth-input::placeholder { color: var(--text-muted); }

.auth-btn {
  width: 100%;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: 10px;
  height: 46px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
  margin-top: 4px;
}

.auth-btn:hover { opacity: 0.9; }
.auth-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.auth-error {
  font-size: 12px;
  color: var(--danger);
  text-align: center;
  min-height: 16px;
}

/* ── APP LAYOUT ── */
#app {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── HEADER ── */
#header {
  /* height crece con el notch/isla en vez de robarle alto al contenido
     (box-sizing:border-box) — la banda de 44px de logo/íconos queda intacta,
     el safe-area se suma arriba de esa banda, no la reemplaza. */
  height: calc(44px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  padding-top: env(safe-area-inset-top, 0px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-blur);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.logo {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 20px;
  letter-spacing: -0.3px;
  color: var(--text);
}


.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notif-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.12s;
}

.notif-btn:hover { background: var(--border2); }

.notif-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 6px rgba(16,185,129,0.5);
}

.notif-btn.off .notif-dot {
  background: var(--overlay-strong);
  box-shadow: none;
}

.notif-btn.error .notif-dot {
  background: var(--warning);
  box-shadow: 0 0 6px rgba(245,158,11,0.5);
}

.theme-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.12s;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1;
}

.theme-toggle-btn:hover { background: var(--border2); }

.commitment-wrap {
  cursor: default;
}

.commitment-ring {
  position: relative;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.commitment-ring svg { transform: rotate(-90deg); }

.commitment-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 500;
  color: var(--text);
}

/* ── WEEKLY DIGEST ── */
.digest-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.8);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn .3s ease;
}

.digest-box {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: 28px 24px;
  max-width: 360px;
  width: 90%;
  animation: slideUp .35s cubic-bezier(.4,0,.2,1);
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.digest-week-label {
  font-size: 10px;
  color: var(--text4);
  font-variant-numeric: tabular-nums;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.digest-headline {
  font-family: 'Instrument Serif', serif;
  font-size: 24px;
  color: var(--text);
  margin-bottom: 20px;
  line-height: 1.2;
}

.digest-stats {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.digest-stat {
  flex: 1;
  background: var(--bg2);
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
}

.digest-stat-n {
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
  display: block;
}

.digest-stat-l {
  font-size: 9px;
  color: var(--text4);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-top: 3px;
  display: block;
}

.digest-insight {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 12px;
  font-style: italic;
}

.digest-tip {
  font-size: 12px;
  color: var(--text2);
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.digest-close {
  width: 100%;
  background: var(--border2);
  color: var(--text);
  border: none;
  border-radius: 10px;
  height: 44px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Geist', sans-serif;
  cursor: pointer;
  transition: opacity .15s;
}

.digest-close:hover { opacity: .8; }

/* ── MORNING BRIEF ── */
.morning-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  animation: morningFade .5s ease;
}

@keyframes morningFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.morning-box {
  max-width: 320px;
  width: 90%;
  padding: 32px 24px;
}

.morning-greeting {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 28px;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.2;
}

.morning-sub {
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 32px;
}

.morning-section-label {
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 10px;
}

.energy-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.energy-btn {
  flex: 1;
  border-radius: 12px;
  border: 1px solid var(--border2);
  background: transparent;
  cursor: pointer;
  transition: all .15s;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.energy-btn:hover { border-color: var(--accent); background: var(--bg3); }
.energy-btn.selected { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.1); }

.morning-inp {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border2);
  color: var(--text);
  font-size: 16px;
  font-family: 'Geist', sans-serif;
  padding: 8px 0;
  outline: none;
  margin: 0 0 32px;
  -webkit-appearance: none;
}

.morning-inp::placeholder { color: var(--text-muted); }

.morning-cta {
  width: 100%;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: 10px;
  height: 48px;
  font-size: 15px;
  font-weight: 500;
  font-family: 'Geist', sans-serif;
  cursor: pointer;
  transition: opacity .15s;
}

.morning-cta:hover { opacity: .85; }
.morning-cta:disabled { opacity: .4; cursor: not-allowed; }

.add-activity-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--text3);
  border: none;
  border-radius: 0;
  padding: 10px 0 8px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  transition: color 0.15s;
  font-family: 'Geist', sans-serif;
  text-align: left;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.add-activity-btn:hover { color: var(--text2); }
.add-activity-btn:active { opacity: 0.7; }

.add-activity-plus {
  font-size: 15px;
  font-weight: 300;
  line-height: 1;
  color: var(--text4);
  flex-shrink: 0;
}

@keyframes chipPop {
  from { opacity: 0; transform: scale(0.85) translateY(2px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── MAIN ── */
#main {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ── VISTA HOY (estética iOS nativa, oscuro, sin acentos de color) ── */
#view-semana {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  --ios-card: var(--card);
  --ios-text: var(--text);
  --ios-text2: var(--text2);
  --ios-sep: var(--border2);
  --ios-circle: var(--text-muted);
}

.hoy-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 8px 16px 16px;
}

/* Espacio extra abajo en mobile para que el último evento no quede
   tapado por el FAB de Foquito (fixed, fuera del flujo del scroll) */
@media (max-width: 1023px) {
  /* FAB: bottom 52px (nav) + 24px (margen) + 92px (alto) = 168px de zócalo
     real; +16px de aire para que nunca quede pegado al borde del scroll. */
  .hoy-scroll { padding-bottom: calc(184px + env(safe-area-inset-bottom, 0px)); }
}

/* Header */
.hoy-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-top: 8px;
}

.hoy-date {
  font-size: 13px;
  font-weight: 500;
  color: var(--ios-text2);
  text-transform: capitalize;
}

.hoy-title {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  font-weight: 700;
  font-size: 34px;
  letter-spacing: -0.01em;
  color: var(--ios-text);
  line-height: 1.15;
}

.hoy-add-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--ios-card);
  color: var(--ios-text);
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 6px;
  transition: transform 0.12s;
}

.hoy-add-btn:active { transform: scale(0.9); }

.hoy-day-nav {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  margin-bottom: 14px;
}

.hoy-day-nav-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: var(--ios-card);
  color: var(--ios-text);
  font-size: 15px;
  cursor: pointer;
}

.hoy-day-nav-btn:active { opacity: 0.6; }

/* Progreso */
/* Secciones — cards estilo "inset grouped list" */
.hoy-section { margin-bottom: 22px; }

.hoy-section-hd {
  font-size: 13px;
  font-weight: 500;
  color: var(--ios-text2);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 0 4px 6px;
}

.hoy-list {
  background: var(--ios-card);
  border-radius: 12px;
  overflow: hidden;
}

.hoy-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  cursor: pointer;
  position: relative;
  transition: background-color 0.1s;
}

.hoy-row:active { background: var(--overlay-strong); }

.hoy-row:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 49px;
  right: 0;
  bottom: 0;
  height: 0.5px;
  background: var(--ios-sep);
}

.hoy-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--ios-circle);
  background: transparent;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.hoy-check.done {
  background: var(--success);
  border-color: var(--success);
}

.hoy-row-title {
  flex: 1;
  font-size: 15px;
  color: var(--ios-text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hoy-row-title.done { color: var(--ios-text2); }

.hoy-row-time {
  font-size: 13px;
  color: var(--ios-text2);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.hoy-now-pill {
  background: var(--text);
  color: var(--bg);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 8px;
}

.hoy-row-chevron {
  color: var(--ios-circle);
  font-size: 16px;
  flex-shrink: 0;
  margin-left: 2px;
}

/* Input de creación — search bar iOS, arriba de todo, siempre visible */
/* ── VISTA PATRONES ── */
#view-patrones {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ── DASHBOARD PATRONES ── */
.dashboard-wrap {
  padding: 20px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.dash-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.dash-stat {
  background: var(--border);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
}

.dash-stat-val {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1;
  margin-bottom: 5px;
}

.dash-stat-label {
  font-size: 10px;
  color: var(--text4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dash-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dash-section-title {
  font-size: 11px;
  font-weight: 500;
  color: var(--text4);
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

.day-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.day-bar-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 76px;
}

.day-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 3px;
}

.day-bar-pct {
  font-size: 9px;
  color: var(--text4);
  height: 12px;
  line-height: 12px;
}

.day-bar-inner {
  width: 100%;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
  min-height: 3px;
  transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.day-bar-inner.bar-empty {
  background: var(--border);
}

.day-bar-labels {
  display: flex;
  gap: 8px;
}

.day-bar-label {
  flex: 1;
  text-align: center;
  font-size: 10px;
  color: var(--text4);
}

.heatmap-wrap {
  padding: 16px;
}

.heatmap-title {
  font-size: 11px;
  font-weight: 500;
  color: var(--text3);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: 36px repeat(7, 1fr);
  gap: 3px;
  min-width: 280px;
}

.hm-header {
  font-size: 9px;
  font-weight: 500;
  color: var(--text4);
  text-align: center;
  padding: 4px 0;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.hm-hour-label {
  font-size: 8px;
  color: var(--text4);
  text-align: right;
  padding-right: 6px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-variant-numeric: tabular-nums;
}

.hm-cell {
  height: 18px;
  border-radius: 3px;
  background: var(--border);
  transition: opacity .1s;
  cursor: default;
}

.hm-cell[data-rate="high"] { background: var(--success); }
.hm-cell[data-rate="mid"]  { background: var(--success); opacity: .5; }
.hm-cell[data-rate="low"]  { background: #064E3B; opacity: .6; }
.hm-cell[data-rate="none"] { background: var(--border); }

.hm-insight {
  margin-top: 20px;
  padding: 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
  font-style: italic;
}

.hm-empty {
  padding: 48px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text4);
  line-height: 1.8;
}

/* ── VISTA MES ── */
#view-mes {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px;
  gap: 10px;
  overflow-y: auto;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
}

.mes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.mes-title {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 20px;
  color: var(--text);
}

.mes-nav {
  display: flex;
  gap: 4px;
}

.mes-nav-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  color: var(--text3);
  font-size: 13px;
  transition: all 0.12s;
}

.mes-nav-btn:hover { color: var(--text); border-color: var(--border2); }

.mes-day-names {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  flex-shrink: 0;
}

.mes-day-name {
  text-align: center;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text4);
  padding: 3px 0;
}

.mes-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  flex: 1;
}

.mes-day {
  border-radius: 7px;
  padding: 5px 4px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.12s;
  min-height: 58px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mes-day:hover { background: var(--bg3); border-color: var(--border); }
.mes-day.today { background: var(--bg3); border-color: var(--border2); }
.mes-day.other-month { opacity: 0.15; }

.mes-day-num {
  font-size: 11px;
  color: var(--text3);
}

.mes-day.today .mes-day-num { color: var(--text); font-weight: 500; }

.mes-dots {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.mes-dot { width: 4px; height: 4px; border-radius: 50%; }

.mes-load-bar {
  height: 2px;
  border-radius: 1px;
  margin-top: auto;
  background: var(--border);
  overflow: hidden;
}

.mes-load-fill { height: 100%; border-radius: 1px; }

/* ── VISTA SUGERENCIAS ── */
#view-sugerencias {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── HERO ── */
.sug-hero {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: 16px;
  flex-shrink: 0;
}

.sug-hero-eyebrow {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 12px;
}

/* ── SECTION LABEL ── */
.sug-section {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text3);
  padding: 8px 2px 2px;
  flex-shrink: 0;
}

.sug-section--cyan   { color: var(--text3); }
.sug-section--purple { color: var(--text3); }

/* ── CARDS ── */
.sug-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 14px 15px;
  flex-shrink: 0;
}

.sug-card.conflict {
  border-color: rgba(244,63,94,0.3);
  background: rgba(244,63,94,0.05);
}

.sug-card--cyan {
  border-left: 2px solid var(--border2);
  background: var(--surface);
}

.sug-card--purple {
  border-left: 2px solid var(--border2);
  background: var(--surface);
}

.sug-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sug-card-top > div { flex: 1; min-width: 0; }

/* ── INLINE BUTTON ── */
.sug-inline-btn {
  background: var(--border2);
  border: 1px solid var(--border2);
  color: var(--text2);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
  font-family: 'Geist', sans-serif;
}

.sug-inline-btn:hover { border-color: var(--accent); color: var(--text); }

.sug-inline-btn--purple {
  border-color: rgba(125,130,122,0.3);
  color: var(--purple-text);
}

.sug-inline-btn--purple:hover { border-color: var(--accent); color: var(--text2); }

/* ── TEXT ── */
.sug-title {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 4px;
  line-height: 1.35;
}

.sug-desc {
  font-size: 11px;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 0;
}

/* ── BLOQUE 1: PULSO — cifra grande + barra (reusa .proj-progress) ── */
.pulso-num { font-size: 40px; font-weight: 600; color: var(--text); line-height: 1; margin-bottom: 4px; }
.pulso-label { font-size: 12px; color: var(--text2); margin-bottom: 12px; }

/* ── BLOQUE 2: INSIGHT DE LA IA — card protagonista ── */
.sug-insight-card {
  /* Borde un toque más marcado que el resto de las cards — es la protagonista */
  border-color: rgba(var(--accent-rgb), 0.35);
}
.sug-insight-hd {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.sug-insight-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}
.sug-insight-tip {
  font-size: 11px;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid rgba(var(--accent-rgb), 0.15);
  border-radius: 7px;
  padding: 8px 10px;
  line-height: 1.5;
  margin-top: 10px;
}

/* Pie de la vista — reemplaza el input de chat, redirige a Foquito */
.sug-foot-hint {
  font-size: 11px;
  color: var(--text3);
  text-align: center;
  padding: 10px 4px 4px;
}

.sug-btns { display: flex; gap: 6px; }

.sug-btn {
  border: none;
  border-radius: 7px;
  padding: 6px 13px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s;
}

.sug-btn-primary {
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.25);
}

.sug-btn-primary:hover { background: rgba(var(--accent-rgb), 0.25); }

.sug-btn-secondary {
  background: transparent;
  color: var(--text3);
  border: 1px solid var(--border);
}

.sug-btn-secondary:hover { color: var(--text); border-color: var(--border2); }

/* ── BOTTOM NAV ── */
#bottom-nav {
  /* Mismo criterio que #header: height crece con el home indicator, el
     padding-bottom de abajo ya sumaba el safe-area pero la height fija
     (border-box) hacía que ese padding le robara alto a los íconos en vez
     de agregar espacio nuevo — por eso quedaban más arriba de lo debido. */
  height: calc(52px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  padding: 6px 12px calc(6px + env(safe-area-inset-bottom, 0px));
  gap: 4px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-blur);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.nav-btn {
  flex: 1;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: 'Geist', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 100%;
  border-radius: 10px;
  transition: all 0.18s cubic-bezier(.4,0,.2,1);
  padding: 0 8px;
  position: relative;
}

.nav-btn:hover { color: var(--text-muted); background: var(--border); }
.nav-btn.active { color: var(--text); background: var(--border2); }
.nav-btn:active .nav-icon { transform: scale(0.88); }

.nav-btn.active::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s cubic-bezier(.34,1.56,.64,1);
}

.nav-btn.active .nav-icon { transform: scale(1.1); }

/* ── FOQUITO (chat) ── */
#foq-fab {
  position: fixed;
  right: 14px;
  /* alto real de #bottom-nav (52px) + margen visible (24px) para que el
     FAB flote limpio arriba de la tab bar, no apoyado. +env() por si el
     dispositivo tiene home indicator (safe area) que la tab bar no resta. */
  bottom: calc(52px + 24px + env(safe-area-inset-bottom, 0px));
  /* 92px (no 76): el personaje llena ~85% del cuadrado del asset, con
     76px quedaba grande dentro del redondel. Agrandar el boton en vez
     de volver a tocar la imagen. padding achica un toque mas sin
     tocar el asset ni el tamano del boton. */
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  padding: 5px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0,0,0,0.45);
  z-index: 250;
  transition: transform 0.2s cubic-bezier(.34,1.56,.64,1), opacity 0.2s;
}

#foq-fab:hover { transform: scale(1.06); }
#foq-fab.open { opacity: 0; pointer-events: none; transform: scale(0.7); }

/* Imagen ocupa el botón entero, sin padding que deje ver el redondel de
   fondo — pensado para el asset circular y sin fondo que va a reemplazar
   al PNG actual. */
#foq-fab .foq-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.foq-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* Flota solo, todo el tiempo — que se sienta vivo, no un ícono fijo */
  animation: foqFloat 3.2s ease-in-out infinite;
}

@keyframes foqFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-5px) rotate(-2deg); }
}

.foq-avatar-sm {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  flex-shrink: 0;
}

/* Estados de Foquito — hasta tener las variantes de expresión separadas,
   "reacciona" con un gesto simple sobre la misma imagen */
#foq-fab.state-happy { animation: foqBounce 0.5s cubic-bezier(.34,1.56,.64,1); }
#foq-fab.state-thinking .foq-avatar-img { animation: foqPulse 1s ease-in-out infinite; }

@keyframes foqBounce {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.18); }
}

@keyframes foqPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

#foq-panel {
  position: fixed;
  right: 12px;
  bottom: 68px;
  left: 12px;
  margin-left: auto;
  width: min(360px, calc(100vw - 24px));
  height: min(65vh, 520px);
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 251;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(.4,0,.2,1), transform 0.2s cubic-bezier(.4,0,.2,1);
}

#foq-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.foq-panel-hd {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* Agrupa el botón de saltear (solo visible en modo onboarding) y la X,
   empujados juntos a la derecha del header — antes el margin-left:auto
   vivía en .foq-panel-close solo, que alcanzaba porque era el único
   elemento del lado derecho. */
.foq-panel-hd-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.foq-ob-skip-btn {
  background: none;
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text3);
  font-size: 11px;
  font-family: 'Geist', sans-serif;
  cursor: pointer;
  padding: 4px 8px;
}

.foq-ob-skip-btn:hover { color: var(--text); border-color: var(--accent); }

.foq-panel-close {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}

.foq-panel-close:hover { color: var(--text); }

.foq-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.foq-bubble {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 300;
  animation: chipPop 0.2s cubic-bezier(.34,1.56,.64,1);
  white-space: pre-wrap;
}

.foq-bubble-user {
  align-self: flex-end;
  background: var(--accent);
  color: var(--text);
  border-bottom-right-radius: 4px;
}

.foq-bubble-foq {
  align-self: flex-start;
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.foq-input-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-blur);
}

.foq-mic-btn, .foq-send-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--bg3);
  color: var(--text3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.foq-mic-btn:hover, .foq-send-btn:hover { color: var(--text); background: var(--border2); }

.foq-mic-btn.recording {
  color: var(--text);
  background: var(--danger);
  animation: foqPulse 1.1s ease-in-out infinite;
}

@keyframes foqPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(244,63,94,0.45); }
  50% { box-shadow: 0 0 0 6px rgba(244,63,94,0); }
}

#foq-input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 18px;
  padding: 9px 14px;
  color: var(--text);
  font-size: 13px;
  font-weight: 300;
  outline: none;
  min-width: 0;
  caret-color: var(--accent);
}

#foq-input::placeholder { color: var(--text4); }

.foq-send-btn { background: var(--accent); color: var(--text); }
.foq-send-btn:hover { background: var(--accent); opacity: 0.85; }

/* ── EVENT PANEL ── */
/* ── EVENT PANEL ─────────────────────────────────────────── */

.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0);
  backdrop-filter: blur(0px);
  z-index: 299;
  display: none;
  transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

.panel-overlay.open {
  display: block;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(3px);
}

.event-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg2-blur);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border2);
  border-radius: 22px 22px 0 0;
  transform: translateY(100%);
  transition: transform 0.34s cubic-bezier(.32,0,.15,1);
  z-index: 300;
  box-shadow: 0 -24px 64px rgba(0,0,0,0.7), 0 -1px 0 var(--border);
}

.event-panel.open { transform: translateY(0); }

.panel-drag-wrap {
  display: flex;
  justify-content: center;
  padding: 12px 0 4px;
}

.panel-drag {
  width: 32px;
  height: 3px;
  background: var(--border2);
  border-radius: 2px;
}

.panel-color-bar {
  height: 2px;
  background: var(--event-color, var(--accent));
  opacity: 0.7;
}

.panel-content {
  padding: 16px 18px 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.panel-close-btn {
  background: var(--border2);
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  color: var(--text3);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.panel-close-btn:hover { color: var(--text); background: var(--border2); }

.panel-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.panel-title {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Geist', sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  letter-spacing: -0.2px;
  line-height: 1.25;
}

.panel-meta {
  font-size: 12px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Geist', sans-serif;
}

.panel-meta::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--event-color, var(--accent));
  flex-shrink: 0;
}

.panel-details {
  width: 100%;
  background: var(--border);
  border: 1px solid var(--border2);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  font-family: 'Geist', sans-serif;
  font-weight: 300;
  line-height: 1.6;
  padding: 10px 12px;
  outline: none;
  resize: none;
  caret-color: var(--event-color, var(--accent));
  -webkit-appearance: none;
  box-sizing: border-box;
  overflow: hidden;
  min-height: 40px;
  transition: border-color 0.2s, background 0.2s;
}

.panel-details:focus { border-color: var(--overlay-strong); background: var(--border); }
.panel-details::placeholder { color: var(--text3); }

.panel-done-main {
  flex: 1;
  height: 46px;
  border-radius: 12px;
  border: none;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Geist', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  letter-spacing: 0.01em;
}

.panel-done-main:hover { opacity: 0.9; }

.panel-done-main.done {
  background: rgba(16,185,129,0.15);
  color: var(--success-text);
}

.panel-done-main.done:hover {
  background: rgba(16,185,129,0.22);
}

.panel-timer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--border);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 10px 14px;
}

.panel-ring-svg { width: 36px; height: 36px; flex-shrink: 0; }

.panel-timer-count {
  font-family: 'Instrument Serif', serif;
  font-size: 24px;
  color: var(--text);
  letter-spacing: -0.5px;
  flex: 1;
  line-height: 1;
}

.panel-timer-pause, .panel-timer-stop {
  height: 28px;
  padding: 0 11px;
  border-radius: 7px;
  font-size: 12px;
  font-family: 'Geist', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.panel-timer-pause {
  border: 1px solid var(--border2);
  background: var(--border);
  color: var(--text);
}
.panel-timer-pause:hover { background: var(--border2); color: var(--text); }

.panel-timer-stop {
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
}
.panel-timer-stop:hover { background: rgba(var(--accent-rgb), 0.18); color: var(--text2); }

.panel-actions-row {
  display: flex;
  gap: 8px;
}

.panel-focus-btn {
  flex: 1;
  height: 46px;
  border: 1px solid var(--border2);
  border-radius: 12px;
  background: var(--bg3);
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  font-family: 'Geist', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s;
  letter-spacing: 0.01em;
}

.panel-focus-btn:hover { border-color: var(--accent); color: var(--text); }
.panel-focus-btn:active { transform: scale(0.98); }

/* ── ANIMACIONES ── */
@keyframes viewEnter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes eventEnter {
  from { opacity: 0; transform: scaleY(0.8) translateY(-4px); transform-origin: top; }
  to   { opacity: 1; transform: scaleY(1) translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── TOAST ── */
#toast-container {
  position: fixed;
  top: 56px;
  right: 12px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--card-blur);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  backdrop-filter: blur(20px);
  transform: translateX(110%);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(.34,1.56,.64,1), opacity 0.22s;
  white-space: nowrap;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  pointer-events: none;
}

.toast.show { transform: translateX(0); opacity: 1; }
.toast-success { border-color: rgba(16,185,129,0.45); color: var(--success-text); }
.toast-error   { border-color: rgba(244,63,94,0.45);  color: var(--danger-text); }
.toast-info    { border-color: rgba(var(--accent-rgb), 0.35);  color: var(--text2); }

/* ── LIVE CLOCK ── */
.live-clock {
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 5px;
  padding: 3px 9px;
}

/* ── SVG stroke overrides ── */
#commitment-arc { stroke: var(--accent); }
#panel-ring     { stroke: var(--accent); }

/* ── PARTICLES CANVAS ── */
.particles-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  display: none;
}

/* ── COMMAND PALETTE ── */
.cmd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  z-index: 600;
  display: none;
  animation: none;
}

.cmd-overlay.open { display: block; animation: cmdBgIn 0.15s ease forwards; }

@keyframes cmdBgIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.cmd-palette {
  position: fixed;
  top: 18%;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  width: min(500px, 94vw);
  background: var(--card-blur);
  border: 1px solid var(--border2);
  border-radius: 18px;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  z-index: 601;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.7), 0 0 0 1px var(--border);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s cubic-bezier(.34,1.56,.64,1), opacity 0.18s;
}

.cmd-palette.open {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.cmd-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border2);
  color: var(--text);
  font-size: 15px;
  font-family: 'Geist', sans-serif;
  padding: 20px 22px;
  outline: none;
  -webkit-appearance: none;
}

.cmd-input::placeholder { color: var(--text4); }

.cmd-results { padding: 8px; max-height: 300px; overflow-y: auto; }

.cmd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.1s;
}

.cmd-item:hover, .cmd-item.focused { background: var(--border2); }

.cmd-item-icon {
  font-size: 15px;
  width: 26px;
  text-align: center;
  flex-shrink: 0;
  color: var(--text3);
}

.cmd-item-label { font-size: 13px; color: var(--text); flex: 1; }
.cmd-item-hint  { font-size: 10px; color: var(--text4); }

.cmd-footer {
  padding: 8px 22px;
  font-size: 10px;
  color: var(--text4);
  border-top: 1px solid var(--border);
}

/* ── AMBIENT MODE ── */
body.ambient {
  background-color: #080809;
}

body.ambient #app::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 55% 55% at 50% 38%, rgba(var(--accent-rgb), 0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: ambientPulse 5s ease-in-out infinite;
}

@keyframes ambientPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.06); }
}

/* ── EVENT EXIT ANIMATION (fix) ── */
.event-block.completing {
  animation: completingAnim 0.4s cubic-bezier(.4,0,.2,1) forwards !important;
}

/* ── EVENING CHECK-IN ── */
.evening-main-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}

.evening-main-btn {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 14px 8px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.evening-main-btn.selected {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
}

.evening-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.evening-btn-label {
  font-size: 10px;
  color: var(--text);
  font-family: 'Geist', sans-serif;
}

/* ── GOAL BAR ── */
.goal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  margin: 0 12px 2px;
  background: rgba(var(--accent-rgb), 0.05);
  border: 1px solid rgba(var(--accent-rgb), 0.12);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  overflow: hidden;
  flex-shrink: 0;
}

.goal-bar:hover {
  background: rgba(var(--accent-rgb), 0.1);
  border-color: rgba(var(--accent-rgb), 0.25);
}

.goal-bar-label {
  font-size: 9px;
  color: var(--accent);
  font-weight: 500;
  white-space: nowrap;
  font-family: 'Geist', sans-serif;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.goal-bar-text {
  font-size: 11px;
  color: var(--text2);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.goal-bar-edit {
  font-size: 11px;
  color: var(--text4);
  flex-shrink: 0;
}

/* ── GOAL EDIT MODAL ── */
.goal-edit-modal {
  position: fixed;
  bottom: 70px;
  left: 12px;
  right: 12px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 16px;
  z-index: 700;
  display: none;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  animation: fadeIn 0.18s ease;
}

.goal-edit-title {
  font-size: 11px;
  color: var(--text3);
  font-weight: 500;
  font-family: 'Geist', sans-serif;
}

/* ── WEEKLY REVIEW ── */
.review-box {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 18px;
  padding: 24px 20px;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: fadeIn 0.25s ease;
}

.review-progress {
  font-size: 10px;
  color: var(--text4);
  text-align: center;
  font-family: 'Geist', sans-serif;
  letter-spacing: 0.04em;
  min-height: 14px;
}

.review-step {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.review-q {
  font-size: 16px;
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  color: var(--text);
  line-height: 1.4;
}

.review-textarea {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  resize: none;
  min-height: 90px;
  line-height: 1.6;
  font-family: 'Geist', sans-serif;
  transition: border-color 0.2s;
}

.review-textarea:focus { border-color: var(--accent); }
.review-textarea::placeholder { color: var(--text4); }

.review-ficha-label {
  font-size: 9px;
  color: var(--text4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
  font-family: 'Geist', sans-serif;
}

.review-ficha {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ficha-titulo {
  font-size: 19px;
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  color: var(--text);
  text-align: center;
  line-height: 1.3;
  padding: 4px 0 8px;
}

.ficha-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}

.ficha-label {
  font-size: 9px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
  font-weight: 500;
  font-family: 'Geist', sans-serif;
}

.ficha-text {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.6;
}

/* ── SUGERENCIAS — review CTA ── */
.sug-review-cta {
  margin-top: 10px;
  background: rgba(125,130,122,0.12);
  border: 1px solid rgba(125,130,122,0.25);
  border-radius: 9px;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  font-family: 'Geist', sans-serif;
  transition: all 0.15s;
  width: 100%;
  text-align: center;
}

.sug-review-cta:hover {
  background: rgba(125,130,122,0.20);
}

/* ── EQUIPO ── */
#view-equipo {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.equipo-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  gap: 14px;
}

.equipo-coming-title {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 30px;
  color: var(--text);
}

.equipo-coming-sub {
  font-size: 13px;
  color: var(--text3);
  text-align: center;
  max-width: 260px;
  line-height: 1.6;
}

.equipo-coming-card {
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 16px;
  max-width: 280px;
  width: 100%;
  margin-top: 8px;
}

.equipo-coming-tag {
  font-size: 9px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  font-family: 'Geist', sans-serif;
  margin-bottom: 10px;
}

.equipo-coming-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.equipo-coming-item {
  font-size: 12px;
  color: var(--text2);
  padding-left: 14px;
  position: relative;
  font-family: 'Geist', sans-serif;
}

.equipo-coming-item::before {
  content: '·';
  position: absolute;
  left: 4px;
  color: var(--text4);
}

/* ── FILAS DE PROPIEDAD (event panel, estilo Recordatorios) ── */
.panel-rows {
  background: var(--card);
  border-radius: 10px;
  overflow: hidden;
}

.panel-rows > *:last-child { border-bottom: none; }

.panel-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  background: transparent;
  border: none;
  border-bottom: 0.5px solid var(--border2);
  color: var(--text);
  font-size: 13px;
  font-family: 'Geist', sans-serif;
  cursor: pointer;
  text-align: left;
}

.panel-row:hover { background: var(--border); }
.panel-row-static { cursor: default; }
.panel-row-static:hover { background: transparent; }

.panel-row-danger { color: var(--danger-text); }
.panel-row-danger:hover { background: rgba(244,63,94,0.08); }

.panel-row-icon {
  width: 18px;
  text-align: center;
  font-size: 13px;
  color: var(--text3);
  flex-shrink: 0;
}

.panel-row-label { flex: 1; color: var(--text); }

.panel-row-value {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text3);
  font-size: 12px;
}

.panel-row-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.panel-row-chevron { color: var(--text3); font-size: 13px; }

.panel-row-expand {
  padding: 6px 12px 12px 38px;
  background: rgba(0,0,0,0.15);
  border-bottom: 0.5px solid var(--border2);
}

/* Toggle iOS — reemplaza el botón-pill de "Foco del día" */
.ios-switch {
  position: relative;
  width: 42px;
  height: 25px;
  border-radius: 13px;
  background: var(--overlay-strong);
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.2s;
}

.ios-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: transform 0.2s;
}

.ios-switch.active { background: var(--warning); }
.ios-switch.active::after { transform: translateX(17px); }

/* ── ÁREA PILLS (event panel) ── */
.panel-area-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.area-pill {
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 20px;
  padding: 5px 10px;
  font-size: 11px;
  color: var(--text3);
  cursor: pointer;
  font-family: 'Geist', sans-serif;
  transition: all 0.15s;
}

.area-pill.selected {
  background: color-mix(in srgb, var(--area-color) 12%, transparent);
  border-color: var(--area-color);
  color: var(--area-color);
}

.area-pill:hover { border-color: var(--text3); color: var(--text2); }

/* Los colores de área/proyecto vienen como hex arbitrario inline desde JS
   (AREAS, COLORS). En oscuro contrastan bien tal cual; en claro hay que
   oscurecerlos para que el texto no quede ilegible sobre fondo claro. */
[data-theme="light"] .area-pill.selected,
[data-theme="light"] .proj-chip,
[data-theme="light"] .proj-area,
[data-theme="light"] .pcard-area,
[data-theme="light"] .lm-area-btn.active {
  filter: brightness(0.62) saturate(1.25);
}

/* ── MODAL REPETICIÓN ── */
.recur-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 301;
}
.recur-overlay.open { display: block; }

.recur-modal {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border2);
  border-radius: 20px 20px 0 0;
  padding: 20px 16px 32px;
  z-index: 302;
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(.4,0,.2,1);
}
.recur-modal.open {
  display: block;
  transform: translateY(0);
}
.recur-modal-header {
  margin-bottom: 16px;
}
.recur-modal-event {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  font-family: 'Geist', sans-serif;
  margin-bottom: 4px;
}
.recur-modal-question {
  font-size: 12px;
  color: var(--text2);
  font-family: 'Geist', sans-serif;
}
.recur-modal-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.recur-opt {
  display: flex;
  align-items: center;
  gap: 14px;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  width: 100%;
}
.recur-opt:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.recur-opt-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: 'Geist', sans-serif;
}
.recur-opt-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.recur-opt-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  font-family: 'Geist', sans-serif;
}
.recur-opt-desc {
  font-size: 11px;
  color: var(--text2);
  font-family: 'Geist', sans-serif;
}

/* ── CONFIRMACIÓN GENÉRICA (delete de evento/proyecto/nota) ── */
/* Reusa .recur-overlay/.recur-modal (mismo sheet centrado abajo), con su
   propio z-index para quedar arriba del event-panel (z:300) y del recur-modal
   (z:301/302) — la confirmación de borrado gana si se disparan juntos. */
.confirm-overlay { z-index: 303; }
.confirm-modal { z-index: 304; }
.confirm-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.confirm-danger-btn {
  flex: 1;
  height: 46px;
  border: none;
  border-radius: 12px;
  background: var(--danger);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Geist', sans-serif;
  cursor: pointer;
  transition: opacity .15s;
}
.confirm-danger-btn:hover { opacity: 0.88; }

/* ── REPETICIÓN (event panel) ── */
.panel-recur-pills {
  display: flex;
  gap: 6px;
}
.recur-pill {
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 11px;
  color: var(--text3);
  cursor: pointer;
  font-family: 'Geist', sans-serif;
  transition: all 0.15s;
}
.recur-pill:hover { border-color: var(--text3); color: var(--text2); }
.recur-pill.active {
  background: rgba(var(--accent-rgb), 0.12);
  border-color: var(--accent);
  color: var(--accent);
}

/* Indicador ↻ en eventos recurrentes */
.ev-recur {
  font-size: 9px;
  opacity: 0.55;
  margin-left: 4px;
  vertical-align: middle;
}

/* ── ESTADO DEL DÍA ── */
.estado-box {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 18px;
  padding: 22px 20px;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.25s ease;
}

.estado-header {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.estado-label-top {
  font-size: 9px;
  color: var(--cyan-text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  font-family: 'Geist', sans-serif;
}

.estado-fecha {
  font-size: 15px;
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  color: var(--text);
}

.estado-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.estado-field-label {
  font-size: 10px;
  color: var(--text3);
  font-weight: 500;
  font-family: 'Geist', sans-serif;
}

/* ── CARTA DEL DOMINGO ── */
.carta-box {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: 28px 24px;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.3s ease;
}

.carta-meta {
  font-size: 10px;
  color: var(--text4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: 'Geist', sans-serif;
}

.carta-saludo {
  font-size: 16px;
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  color: var(--text);
  line-height: 1.4;
}

.carta-cuerpo {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.8;
  font-family: 'Geist', sans-serif;
}

.carta-firma {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 18px;
  color: var(--accent);
  margin-top: 4px;
}

/* ── PALABRA DE LA SEMANA ── */
.palabra-box {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 18px;
  padding: 28px 20px;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  animation: fadeIn 0.2s ease;
}

.palabra-prompt {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 20px;
  color: var(--text);
  text-align: center;
  line-height: 1.3;
}

.palabra-sub {
  font-size: 11px;
  color: var(--text4);
  text-align: center;
  font-family: 'Geist', sans-serif;
  margin-top: -8px;
}

.palabra-inp {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border2);
  padding: 8px 0;
  font-size: 22px;
  color: var(--text);
  outline: none;
  text-align: center;
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  transition: border-color 0.2s;
}

.palabra-inp:focus { border-bottom-color: var(--purple-text); }
.palabra-inp::placeholder { color: var(--text4); font-size: 14px; }

.palabras-previas {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  min-height: 10px;
}

.palabra-chip {
  background: rgba(167,139,250,0.08);
  border: 1px solid rgba(167,139,250,0.2);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--purple-text);
  font-family: 'Geist', sans-serif;
}

/* ── MOOD TIMELINE ── */
.mood-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 4px 0;
}

.mood-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.85;
  transition: transform 0.1s;
}

.mood-dot:hover { transform: scale(1.4); opacity: 1; }

.mood-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
}

/* ── AREA ROWS (patrones + sugerencias) ── */
.area-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
}

.area-row-label {
  font-size: 11px;
  color: var(--text2);
  font-family: 'Geist', sans-serif;
  width: 88px;
  flex-shrink: 0;
}

.area-row-bar {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.area-row-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s cubic-bezier(.4,0,.2,1);
}

.area-row-pct {
  font-size: 10px;
  color: var(--text4);
  font-family: 'Geist', sans-serif;
  width: 26px;
  text-align: right;
  flex-shrink: 0;
}

.areas-timeline {
  padding: 6px 0 2px;
}

/* ── SLAB VIEW (Patrones) ──────────────────────────────────── */

.slab-view {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.slab-section {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 14px;
  overflow: hidden;
}

.slab-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}

.slab-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.slab-add-btn {
  background: none;
  border: 1px solid var(--border2);
  color: var(--text3);
  border-radius: 6px;
  width: 24px;
  height: 24px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
  font-family: 'Geist', sans-serif;
}
.slab-add-btn:hover { border-color: var(--accent); color: var(--accent); }

.slab-empty {
  font-size: 12px;
  color: var(--text4);
  padding: 14px 16px;
  font-family: 'Geist', sans-serif;
}

/* Kanban columns layout */
.slab-view {
  flex-direction: row !important;
  align-items: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 14px 12px;
  gap: 10px;
}

.slab-section {
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 140px);
}

.slab-hd {
  flex-shrink: 0;
}

#recordatorios-list, #notas-list, #proyectos-simple-list {
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

.slab-item {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  transition: border-color 0.15s, transform 0.1s, box-shadow 0.15s;
}
.slab-item:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }

.slab-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  font-family: 'Geist', sans-serif;
  line-height: 1.35;
}

.nota-text {
  color: var(--text2);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
  white-space: pre-wrap;
}

.slab-del {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--text4);
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.12s;
  font-family: 'Geist', sans-serif;
  opacity: 0;
}
.slab-item:hover .slab-del { opacity: 1; }
.slab-del:hover { color: var(--danger); }

/* Recordatorios */
.recorda-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.recorda-date {
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  font-variant-numeric: tabular-nums;
}

.recorda-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  font-variant-numeric: tabular-nums;
  background: var(--border2);
  color: var(--text2);
  letter-spacing: 0.02em;
}
.recorda-badge.week {
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--accent-text);
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.2);
}
.recorda-badge.soon {
  background: rgba(251,146,60,0.2);
  color: var(--warning-text);
  box-shadow: 0 0 8px rgba(251,146,60,0.2);
}
.recorda-badge.overdue {
  background: rgba(248,113,113,0.2);
  color: var(--danger-text);
  box-shadow: 0 0 8px rgba(248,113,113,0.2);
}

/* Proyectos */
.proj-item { cursor: pointer; }

.proj-item-top {
  display: flex;
  align-items: center;
  gap: 7px;
}

.proj-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.proj-chip {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  margin-left: auto;
}

.proj-item-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.proj-area { font-size: 11px; }

.proj-pct {
  font-size: 11px;
  color: var(--text3);
  font-variant-numeric: tabular-nums;
}

.proj-progress {
  height: 2px;
  background: var(--border2);
  border-radius: 1px;
  overflow: hidden;
}
.proj-progress-fill {
  height: 100%;
  border-radius: 1px;
}

/* Inline forms */
.recorda-form, .nota-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid var(--border);
  background: rgba(var(--accent-rgb), 0.03);
}

.slab-input, .slab-textarea {
  background: var(--border);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-family: 'Geist', sans-serif;
  padding: 8px 10px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
.slab-input:focus, .slab-textarea:focus { border-color: var(--accent); }
.slab-textarea { min-height: 64px; resize: none; line-height: 1.5; }
.slab-input-date { color: var(--text2); }

.slab-save-btn {
  background: var(--accent);
  color: var(--text);
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Geist', sans-serif;
  align-self: flex-start;
  transition: opacity 0.15s;
}
.slab-save-btn:hover { opacity: 0.85; }

/* ── PIPE-TOP (mantener por si se usa) ── */

.pipe-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.pipe-stats {
  display: flex;
  gap: 20px;
}

.pipe-stat-val {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.pipe-stat-lbl {
  font-size: 9px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 3px;
}

.pipe-new-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: var(--text);
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
  font-family: 'Geist', sans-serif;
}
.pipe-new-btn:hover { opacity: 0.82; }

/* Kanban board */
.kanban-board {
  display: flex;
  gap: 10px;
  padding: 14px 12px 14px;
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1;
  align-items: flex-start;
}

.kanban-board::-webkit-scrollbar { height: 3px; }

.kanban-col {
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  max-height: 100%;
  transition: border-color 0.15s;
}

.kanban-col.drag-over {
  border-color: rgba(var(--accent-rgb), 0.5);
  background: rgba(var(--accent-rgb), 0.05);
}

.kanban-col-hd {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.kcol-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.kcol-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex: 1;
}

.kcol-count {
  font-size: 10px;
  color: var(--text3);
  background: var(--border2);
  border-radius: 8px;
  padding: 1px 6px;
  font-variant-numeric: tabular-nums;
}

.kcol-sum {
  font-size: 10px;
  color: var(--text2);
  font-variant-numeric: tabular-nums;
}

.kcol-add {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  padding: 0;
  transition: color 0.15s;
  font-family: 'Geist', sans-serif;
}
.kcol-add:hover { color: var(--accent); }

.kanban-cards {
  padding: 8px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 60px;
}

.kcard-empty {
  font-size: 11px;
  color: var(--text4);
  text-align: center;
  padding: 16px 0;
  border: 1px dashed var(--border2);
  border-radius: 8px;
}

/* Lead card */
.lead-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 9px;
  padding: 11px 13px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s, box-shadow 0.15s;
  user-select: none;
}

.lead-card:hover {
  border-color: var(--cc, var(--accent));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.lead-card.dragging { opacity: 0.45; transform: scale(0.97); }

.lead-card--urgent {
  border-left: 2px solid var(--danger);
}

.lcard-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lcard-tipo {
  font-size: 11px;
  color: var(--text2);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lcard-precio {
  font-size: 15px;
  font-weight: 700;
  color: var(--cc, var(--accent));
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}

.lcard-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lcard-origen {
  font-size: 9px;
  color: var(--text4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.lcard-dias {
  font-size: 10px;
  color: var(--text3);
}
.lcard-dias.urgent { color: var(--danger); }

/* Lead modal */
.lead-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 300;
  backdrop-filter: blur(3px);
}

.lead-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(460px, 95vw);
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 16px;
  z-index: 301;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  animation: lmIn 0.18s cubic-bezier(.4,0,.2,1);
}

@keyframes lmIn {
  from { opacity: 0; transform: translate(-50%, -47%) scale(0.96); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.lm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--border);
}

.lm-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.lm-close {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  padding: 0;
  transition: color 0.15s;
}
.lm-close:hover { color: var(--text); }

.lm-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  overflow-y: auto;
  max-height: 55vh;
}

.lm-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.lm-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.lm-inp {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
  font-family: 'Geist', sans-serif;
}
.lm-inp:focus { border-color: var(--accent); }

.lm-sel {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2352525B' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
.lm-sel option { background: var(--surface); }

.lm-ta {
  resize: vertical;
  min-height: 68px;
  line-height: 1.5;
}

.lm-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.lm-estados {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.lm-estado-btn {
  padding: 5px 11px;
  border-radius: 20px;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--text2);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.13s;
  font-family: 'Geist', sans-serif;
}
.lm-estado-btn:hover { border-color: var(--text2); }

.lm-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
}

.lm-del {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 12px;
  cursor: pointer;
  padding: 6px 0;
  font-family: 'Geist', sans-serif;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.lm-del:hover { opacity: 1; }

.lm-cancel {
  background: none;
  border: 1px solid var(--border2);
  border-radius: 7px;
  color: var(--text2);
  font-size: 12px;
  padding: 7px 14px;
  cursor: pointer;
  font-family: 'Geist', sans-serif;
  transition: border-color 0.15s;
}
.lm-cancel:hover { border-color: var(--text2); }

.lm-save {
  background: var(--accent);
  border: none;
  border-radius: 7px;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  padding: 7px 16px;
  cursor: pointer;
  font-family: 'Geist', sans-serif;
  transition: opacity 0.15s;
}
.lm-save:hover { opacity: 0.82; }

/* ── Proyecto card extras ────────────────────────────────── */
.pcard-area {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
}
.pcard-area-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pcard-fecha {
  font-size: 9px;
  color: var(--text4);
}
.pcard-fecha.overdue { color: var(--danger); font-weight: 600; }
.pcard-fecha.today   { color: var(--accent); font-weight: 600; }
.pcard-fecha.soon    { color: var(--accent); }
.pcard-progress-bar {
  height: 2px;
  background: var(--border2);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}
.pcard-progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s;
}

/* ── Área pills en modal ─────────────────────────────────── */
.lm-areas {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.lm-area-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 20px;
  color: var(--text3);
  font-size: 11px;
  font-family: 'Geist', sans-serif;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.lm-area-btn:hover { border-color: var(--text3); color: var(--text2); }
.lm-area-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Progress slider en modal ───────────────────────────── */
.lm-progreso-slider {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
  margin-top: 8px;
  height: 4px;
}

/* ── Tu año (Equipo) dashboard ──────────────────────────── */
.tuana-wrap {
  padding: 16px 16px 100px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tuana-header { padding: 8px 0 4px; }
.tuana-title {
  /* Remanente viejo usaba la serif itálica del logo — Progreso no es parte
     del trío Día/Semana/Mes (esos sí llevan Instrument Serif a propósito),
     va con la tipografía del sistema como el resto de los títulos de vista. */
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  font-weight: 600;
  font-size: 28px;
  color: var(--text);
}
.tuana-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tuana-section-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--text4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: 'Geist', sans-serif;
}
.tuana-heatmap-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
}
.tuana-hm-grid {
  display: grid;
  grid-template-rows: repeat(7, 10px);
  grid-auto-flow: column;
  gap: 2px;
  width: max-content;
}
.tuana-hm-cell {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.tuana-hm-cell.today {
  outline: 1.5px solid var(--accent);
  outline-offset: 1px;
}
.tuana-heatmap-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  color: var(--text4);
  font-family: 'Geist', sans-serif;
}
.tuana-legend-dots { display: flex; gap: 3px; }
.tuana-legend-dot  { width: 8px; height: 8px; border-radius: 2px; }
.tuana-highlights {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.tuana-hl {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  text-align: center;
}
.tuana-hl-val {
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
  font-family: 'Geist', sans-serif;
  line-height: 1;
}
.tuana-hl-lbl {
  font-size: 9px;
  color: var(--text4);
  font-family: 'Geist', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tuana-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tuana-period-toggle {
  display: flex;
  gap: 2px;
  background: var(--bg3);
  border-radius: 6px;
  padding: 2px;
}
.tuana-period-btn {
  background: none;
  border: none;
  color: var(--text4);
  font-size: 10px;
  font-family: 'Geist', sans-serif;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.tuana-period-btn.active {
  background: var(--bg2);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.tuana-chart-stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 4px 0 2px;
}
.tuana-chart-big {
  font-size: 32px;
  font-weight: 500;
  color: var(--text);
  font-family: 'Geist', sans-serif;
  line-height: 1;
}
.tuana-chart-sub {
  font-size: 10px;
  color: var(--text4);
  font-family: 'Geist', sans-serif;
}
.tuana-chart {
  width: 100%;
  height: 72px;
}
.tuana-chart-labels {
  display: flex;
  justify-content: space-between;
  font-family: 'Geist', sans-serif;
  margin-top: 4px;
}
.tuana-chart-wrap {
  position: relative;
}
.tuana-chart-tip {
  position: absolute;
  bottom: calc(100% + 4px);
  display: none;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 5px 9px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 20;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.tip-lbl {
  font-size: 10px;
  color: var(--text3);
  font-family: 'Geist', sans-serif;
}
.tip-val {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  font-family: 'Geist', sans-serif;
}
.tuana-empty {
  font-size: 11px;
  color: var(--text4);
  font-family: 'Geist', sans-serif;
  line-height: 1.5;
}
.tuana-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 20px 14px;
  text-align: center;
}
.tuana-empty-state .tuana-empty { max-width: 230px; }

@media (max-width: 639px) {
  /* header */
  .live-clock { font-size: 11px; padding: 2px 7px; }
  #header { padding: 0 10px; gap: 4px; }

  /* patrones — columnas apiladas verticalmente */
  .slab-view {
    flex-direction: column !important;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 12px 12px 32px;
    gap: 10px;
  }

  .slab-section {
    flex: none;
    width: 100%;
    max-height: none;
  }

  #recordatorios-list,
  #notas-list,
  #proyectos-simple-list {
    overflow-y: visible;
    max-height: none;
  }
}

/* ── DESKTOP: Foquito fijo al costado, siempre visible (>=1024px) ── */
/* Mobile (default): wrapper transparente, no cambia nada del layout actual */
#app-left { display: contents; }

/* Entrada de una tarjeta nueva insertada en vivo por Foquito */
@keyframes hoyRowEnter {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.hoy-row-enter { animation: hoyRowEnter 0.26s cubic-bezier(.4,0,.2,1); }

@media (min-width: 1024px) {
  #app { flex-direction: row; }

  #app-left {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    overflow: hidden;
  }

  #foq-fab { display: none; }

  #foq-panel {
    position: static;
    flex-shrink: 0;
    width: 380px;
    height: 100%;
    margin-left: 0;
    border-radius: 0;
    border: none;
    border-left: 1px solid var(--border2);
    box-shadow: none;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .foq-panel-close { display: none; }
}

/* ── SELECTOR DÍA / SEMANA / MES ── */
.view-pills {
  display: flex;
  gap: 6px;
  padding: 10px 16px 0;
  flex-shrink: 0;
  background: var(--bg);
}

.view-pill {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  transition: background 0.15s, color 0.15s;
}

.view-pill.active {
  background: var(--overlay-strong);
  color: var(--text);
}

.view-pill:active { opacity: 0.6; }

/* ── VISTA SEMANA (grilla horaria) — estética tipo Notion Calendar / Cron ── */
#view-semana-grid {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  color: var(--text);
}

.sg-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  flex-shrink: 0;
}

.sg-toolbar-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sg-nav-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
}

.sg-nav-btn:hover { color: var(--text); }

.sg-week-label {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 17px;
  color: var(--text);
  min-width: 110px;
  text-align: center;
}

.sg-today-btn {
  background: var(--border2);
  border: none;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.sg-today-btn:hover { background: var(--overlay-strong); }

.sg-scrollx {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

/* Mismo colchón que .hoy-scroll: evita que el FAB tape el último evento
   de la grilla horaria (Semana/Día) */
@media (max-width: 1023px) {
  .sg-scrollx { padding-bottom: calc(184px + env(safe-area-inset-bottom, 0px)); }
}

.sg-hours-spacer { width: 44px; flex-shrink: 0; }

.sg-daylabels {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
  border-bottom: 1px solid var(--border2);
}

.sg-daylabels-days {
  flex: 1;
  display: flex;
}

.sg-daylabel {
  flex: 1;
  min-width: 0;
  text-align: center;
  padding: 6px 0 10px;
}

.sg-daylabel-dow {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.sg-daylabel-num {
  font-size: 14px;
  color: var(--text);
  width: 26px;
  height: 26px;
  line-height: 26px;
  border-radius: 50%;
  margin: 0 auto;
}

.sg-daylabel-num.today {
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
}

.sg-allday {
  display: flex;
  border-bottom: 1px solid var(--border2);
  padding: 6px 0;
}

.sg-allday-days {
  flex: 1;
  display: flex;
  gap: 4px;
  padding: 0 4px;
}

.sg-allday-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sg-chip {
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
  padding: 3px 7px;
  border-radius: 5px;
  border-left: 3px solid;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.1s;
}

.sg-chip:active { opacity: 0.6; }

.sg-body {
  display: flex;
}

.sg-hours {
  width: 44px;
  flex-shrink: 0;
}

.sg-hour-label {
  font-size: 10px;
  color: var(--text-muted);
  text-align: right;
  padding-right: 6px;
  transform: translateY(-6px);
}

.sg-days {
  flex: 1;
  display: flex;
}

.sg-day-col {
  flex: 1;
  min-width: 0;
  position: relative;
  border-left: 1px solid var(--border);
  background-image: linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 100% 44px; /* debe coincidir con ALTO_HORA en app.js */
}

.sg-block {
  position: absolute;
  border-left: 3px solid;
  border-radius: 5px;
  font-size: 11px;
  line-height: 1.3;
  overflow: hidden;
  cursor: pointer;
}

.sg-block:active .sg-block-content { opacity: 0.6; }

.sg-block-content {
  height: 100%;
  padding: 3px 16px 3px 6px; /* padding-right deja lugar al × siempre, aunque no se muestre */
  transition: transform 0.18s ease;
  cursor: pointer;
}

.sg-block-title {
  display: block;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sg-block-time {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
}

.sg-block.done {
  opacity: 0.45;
  text-decoration: line-through;
}

/* Borrar: × visible (bloques altos) + franja roja al deslizar (swipe, mobile) */
.sg-block-del {
  position: absolute;
  top: 1px;
  right: 2px;
  background: none;
  border: none;
  color: inherit;
  opacity: 0.55;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 3px;
}

.sg-block-del:hover { opacity: 1; }

.sg-block-swipe-del {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 56px;
  background: var(--danger);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  transform: translateX(100%);
  transition: transform 0.18s ease;
  cursor: pointer;
}

.sg-block.swiped .sg-block-content { transform: translateX(-56px); }
.sg-block.swiped .sg-block-swipe-del { transform: translateX(0); }

.sg-now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--danger-text);
  z-index: 1;
}

.sg-now-dot {
  position: absolute;
  left: -3px;
  top: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger-text);
}

@media (max-width: 1023px) {
  /* Scope a #view-semana-grid nada más — .sg-allday/.sg-body son clases
     compartidas con la grilla de 1 columna de Día (#view-semana), que no
     necesita ancho mínimo y quedaba con scroll horizontal fantasma. */
  .sg-scrollx { overflow-x: auto; }
  #view-semana-grid .sg-daylabels,
  #view-semana-grid .sg-allday,
  #view-semana-grid .sg-body { min-width: 620px; }
}

/* ── VISTA DÍA — grilla de 1 columna, dentro de #view-semana ── */
/* Reusa las clases .sg-* de la grilla Semana; acá solo el detalle propio
   de la banda "Sin horario" de un único día (sin sub-columnas por día). */
.dg-allday-list {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0 12px;
}

/* ── PANEL DE EVENTO EN DESKTOP — popover centrado, no bottom sheet ── */
@media (min-width: 1024px) {
  .panel-drag-wrap { display: none; }

  .event-panel {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    width: 380px;
    max-width: calc(100vw - 40px);
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 16px;
    border: 1px solid var(--border2);
    transform: translate(-50%, calc(-50% + 10px)) scale(0.97);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s cubic-bezier(.4,0,.2,1), opacity 0.18s ease;
  }

  .event-panel.open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
  }
}
