/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── TOKENS DARK (default) ── */
:root,
[data-theme="dark"] {
  --bg-primary:          #0f0f1a;
  --bg-surface:          #16213e;
  --bg-card:             #16213e;
  --bg-nav:              #0d0d1f;
  --text-primary:        #eeeeee;
  --text-muted:          #90a4ae;
  --border:              rgba(255,255,255,0.07);
  --chip-inactive-bg:    rgba(255,255,255,0.07);
  --chip-inactive-color: #90a4ae;
  --day-cell-bg:         rgba(255,255,255,0.03);
  --day-cell-other:      rgba(255,255,255,0.01);
  --panel-bg:            #0d1b2a;
  --panel-border:        #1e3a5f;
  --panel-event-bg:      #16213e;
  --shadow:              none;

  /* chips por tipo — dark */
  --chip-raid-bg:      rgba(239,83,80,0.2);
  --chip-raid-color:   #ef9a9a;
  --chip-shiny-bg:     rgba(255,193,7,0.2);
  --chip-shiny-color:  #ffe082;
  --chip-comm-bg:      rgba(102,187,106,0.2);
  --chip-comm-color:   #a5d6a7;
  --chip-spec-bg:      rgba(171,71,188,0.2);
  --chip-spec-color:   #ce93d8;
  --chip-season-bg:    rgba(41,182,246,0.2);
  --chip-season-color: #81d4fa;

  /* badge Proximo (morado) */
  --badge-soon-bg:    rgba(171,71,188,.15);
  --badge-soon-color: #ce93d8;

  /* accent informativo (countdown, titulos de seccion, tags de analisis) — dark */
  --accent-info:        #64b5f6;
  --accent-info-bright: #4fc3f7;
  --accent-info-soft:   #90caf9;

  /* accent shiny (boton alerta activa) — dark */
  --accent-shiny:     #ffc107;
  --accent-shiny-dim: rgba(255,193,7,.12);

  /* toggle */
  --toggle-icon: "🌙";

  /* botones — dark */
  --btn-primary-bg:      var(--accent-info);
  --btn-primary-text:    #ffffff;
  --btn-primary-hover:   #42a5f5;
  --btn-secondary-bg:    transparent;
  --btn-secondary-border: rgba(255,255,255,0.2);
  --btn-secondary-text:  var(--text-muted);
  --btn-secondary-hover: rgba(255,255,255,0.06);
  --btn-action-bg:       rgba(30,136,229,0.15);
  --btn-action-text:     var(--accent-info);

  /* alert semanticos */
  --alert-error-bg:      rgba(239,83,80,0.10);
  --alert-error-border:  rgba(239,83,80,0.22);
  --alert-error-text:    #ef9a9a;
  --alert-error-sub:     rgba(239,154,154,0.75);
  --alert-error-accent:  #ef5350;

  --alert-warning-bg:    rgba(255,193,7,0.10);
  --alert-warning-border:rgba(255,193,7,0.22);
  --alert-warning-text:  #ffe082;
  --alert-warning-sub:   rgba(255,224,130,0.75);
  --alert-warning-accent:#ffc107;

  --alert-info-bg:       rgba(100,181,246,0.10);
  --alert-info-border:   rgba(100,181,246,0.22);
  --alert-info-text:     #90caf9;
  --alert-info-sub:      rgba(144,202,249,0.75);
  --alert-info-accent:   #64b5f6;

  --alert-success-bg:    rgba(102,187,106,0.10);
  --alert-success-border:rgba(102,187,106,0.22);
  --alert-success-text:  #a5d6a7;
  --alert-success-sub:   rgba(165,214,167,0.75);
  --alert-success-accent:#66bb6a;
}

[data-theme="light"] {
  --bg-primary:          #F3F4F6;
  --bg-surface:          #FFFFFF;
  --bg-card:             #FFFFFF;
  --bg-nav:              #FFFFFF;
  --text-primary:        #111827;
  --text-muted:          #6B7280;
  --border:              #E5E7EB;
  --chip-inactive-bg:    #F3F4F6;
  --chip-inactive-color: #6B7280;
  --day-cell-bg:         #F9FAFB;
  --day-cell-other:      #FFFFFF;
  --panel-bg:            #F9FAFB;
  --panel-border:        #E5E7EB;
  --panel-event-bg:      #FFFFFF;
  --shadow:              0 1px 3px rgba(0,0,0,0.06);

  /* chips por tipo — light (pasteles) */
  --chip-raid-bg:      #FEE2E2;
  --chip-raid-color:   #B91C1C;
  --chip-shiny-bg:     #FEF9C3;
  --chip-shiny-color:  #854D0E;
  --chip-comm-bg:      #DCFCE7;
  --chip-comm-color:   #166534;
  --chip-spec-bg:      #F3E8FF;
  --chip-spec-color:   #7E22CE;
  --chip-season-bg:    #E0F2FE;
  --chip-season-color: #0369A1;

  /* accent informativo — light: tonos oscuros para contraste sobre fondo blanco */
  --accent-info:        #1565C0;
  --accent-info-bright: #0D47A1;
  --accent-info-soft:   #1E88E5;

  /* accent shiny — light */
  --accent-shiny:     #d97706;
  --accent-shiny-dim: rgba(217,119,6,.10);

  --toggle-icon: "☀️";

  /* botones — light */
  --btn-primary-bg:      #1E88E5;
  --btn-primary-text:    #ffffff;
  --btn-primary-hover:   #1565C0;
  --btn-secondary-bg:    transparent;
  --btn-secondary-border: #9CA3AF;
  --btn-secondary-text:  #374151;
  --btn-secondary-hover: #F3F4F6;
  --btn-action-bg:       #EFF6FF;
  --btn-action-text:     #1E40AF;

  /* alert semanticos */
  --alert-error-bg:      #FEF2F2;
  --alert-error-border:  #FECACA;
  --alert-error-text:    #B91C1C;
  --alert-error-sub:     #DC2626;
  --alert-error-accent:  #EF4444;

  --alert-warning-bg:    #FFFBEB;
  --alert-warning-border:#FDE68A;
  --alert-warning-text:  #92400E;
  --alert-warning-sub:   #B45309;
  --alert-warning-accent:#F59E0B;

  --alert-info-bg:       #EFF6FF;
  --alert-info-border:   #BFDBFE;
  --alert-info-text:     #1E40AF;
  --alert-info-sub:      #1D4ED8;
  --alert-info-accent:   #1565C0;

  --alert-success-bg:    #F0FDF4;
  --alert-success-border:#BBF7D0;
  --alert-success-text:  #166534;
  --alert-success-sub:   #15803D;
  --alert-success-accent:#22C55E;
}

/* ── INVARIANTES ── */
:root {
  --header-gradient:  linear-gradient(135deg, #1565c0, #0d47a1);
  --color-active:     #64b5f6;
  --nav-height:       60px;
  --snackbar-bottom:  calc(var(--nav-height) + 8px);
  --color-raid:       #ef5350;
  --color-community:  #66bb6a;
  --color-special:    #ab47bc;
  --color-shiny:      #ffc107;
  --color-season:     #29b6f6;
  /* stripe tokens para mini-cal dots (alias de color-*) */
  --stripe-raid:      var(--color-raid);
  --stripe-community: var(--color-community);
  --stripe-special:   var(--color-special);
  --stripe-season:    var(--color-season);
  --stripe-shiny:     var(--color-shiny);
}
[data-theme="light"] {
  --color-raid:      #EF4444;
  --color-community: #22C55E;
  --color-special:   #A855F6;
  --color-shiny:     #F59E0B;
}

/* ── LAYOUT ── */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  transition: background 0.2s, color 0.2s;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#view-container {
  flex: 1;
  overflow-y: auto;
  padding-bottom: var(--nav-height);
}

/* ── BOTTOM NAV ── */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--bg-nav);
  border-top: 1px solid var(--border);
  display: flex;
  height: var(--nav-height);
  z-index: 100;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 10px;
  cursor: pointer;
  gap: 2px;
  transition: color 0.15s;
  font-family: inherit;
}

.nav-item.active { color: var(--color-active); }

.nav-icon { font-size: 20px; }

.hidden { display: none !important; }

/* ── APP HEADER ── */
.app-header {
  background: var(--header-gradient);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.app-header h1 { font-size: 17px; font-weight: 700; color: #fff; }
.app-header .subtitle { font-size: 11px; color: #90caf9; margin-top: 2px; }

.theme-toggle {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.theme-toggle:hover { background: rgba(255,255,255,0.25); }

/* ── FILTER BAR ── */
.filter-bar {
  background: var(--bg-surface);
  padding: 8px 12px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border);
}
.filter-bar::-webkit-scrollbar { display: none; }

.chip {
  white-space: nowrap;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: var(--chip-inactive-bg);
  color: var(--chip-inactive-color);
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.chip.active { background: #1565c0; color: #fff; }

.chip[data-type="raid"]      { background: var(--chip-raid-bg);  color: var(--chip-raid-color); }
.chip[data-type="community"] { background: var(--chip-comm-bg);  color: var(--chip-comm-color); }
.chip[data-type="shinies"]   { background: var(--chip-shiny-bg); color: var(--chip-shiny-color); }
.chip[data-type="special"]   { background: var(--chip-spec-bg);  color: var(--chip-spec-color); }
.chip[data-type="season"]    { background: var(--chip-season-bg); color: var(--chip-season-color); }

/* ── SECTION LABEL ── */
.section-label {
  padding: 12px 16px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-active);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ── LOADING / EMPTY ── */
.loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--color-active);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== CALENDAR VIEW ===== */
.calendar-header {
  background: var(--header-gradient);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.month-nav { display: flex; align-items: center; gap: 12px; }
.month-title { font-size: 17px; font-weight: 700; color: #fff; }
.nav-btn {
  background: rgba(255,255,255,0.15); border: none; color: #fff;
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 16px;
}
.today-btn { font-size: 12px; font-weight: 600; color: #fff; cursor: pointer; background: none; border: none; }
.cal-header-actions { display: flex; align-items: center; gap: 8px; }
.ev-view-toggle {
  width: 32px; height: 32px; border-radius: 8px;
  background: transparent; border: 1px solid transparent;
  color: #fff; font-size: 14px; opacity: 0.35;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; line-height: 1;
}
.ev-view-toggle.active {
  background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.5);
  color: #fff; opacity: 1;
}

.cal-grid { padding: 6px 8px; }
.day-headers {
  display: grid; grid-template-columns: repeat(7, 1fr);
  margin-bottom: 3px;
}
.day-header {
  text-align: center; font-size: 10px; font-weight: 700;
  color: #546e7a; padding: 4px 0; text-transform: uppercase;
}
.cal-weeks { display: flex; flex-direction: column; gap: 2px; }
.week-row {
  display: grid; grid-template-columns: repeat(7, 1fr);
  grid-template-rows: auto 0px;
  gap: 2px; position: relative; min-height: 74px;
}
.day-cell {
  border-radius: 6px; background: var(--day-cell-bg);
  padding: 3px 4px; cursor: pointer; position: relative;
  min-height: 104px;
  display: flex; justify-content: center;
}
.day-cell:active { background: rgba(255,255,255,0.08); }
.day-cell.other-month .day-num { color: #333; }
.day-num {
  font-size: 11px; font-weight: 600; color: #78909c; margin-bottom: 2px;
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
}
.day-cell.today .day-num {
  background: var(--accent-info); color: #fff; border-radius: 50%; font-size: 11px;
}
.day-cell.selected .day-num {
  background: var(--accent-info-bright); color: #fff; border-radius: 50%; font-size: 11px;
  box-shadow: 0 0 0 2px rgba(13,71,161,0.45);
}
.day-cell.today.selected .day-num {
  background: var(--accent-info-bright); box-shadow: 0 0 0 2px rgba(13,71,161,0.45);
}

/* Span bars */
.span-layer {
  grid-column: 1 / -1;
  position: relative; height: 0; overflow: visible;
  pointer-events: none; z-index: 2;
}
.span-layer-inner {
  position: absolute; top: -80px; left: 0; right: 0;
  pointer-events: none;
}
.span-bar {
  position: absolute; height: 14px; border-radius: 3px;
  display: flex; align-items: center;
  padding: 0 4px; font-size: 8px; font-weight: 700;
  color: rgba(255,255,255,0.92); white-space: nowrap; overflow: hidden;
  pointer-events: auto; cursor: pointer;
}
.span-bar:hover { opacity: 0.8; }
.span-overflow {
  position: absolute; bottom: 2px;
  font-size: 8px; font-weight: 700; color: var(--text-muted);
  text-align: right; padding-right: 4px; pointer-events: auto; cursor: pointer;
}

/* Expansion inline del +N */
.week-row.expanded .day-cell {
  min-height: 140px;
}
.week-row.expanded .span-layer-inner {
  top: -118px;
}

.span-collapse {
  color: #ef5350;
  font-size: 10px;
}

.span-bar.raid      { background: var(--color-raid); }
.span-bar.community { background: var(--color-community); }
.span-bar.spotlight { background: var(--color-shiny); }
.span-bar.special   { background: var(--color-special); }
.span-bar.season    { background: var(--color-season); }

/* Day panel */
.day-panel {
  background: var(--panel-bg); border-top: 1px solid var(--panel-border);
  padding: 12px 14px;
}
.day-panel-title { font-size: 12px; font-weight: 700; color: var(--accent-info); margin-bottom: 10px; }
.panel-event {
  background: var(--panel-event-bg); border-radius: 10px; padding: 9px 12px;
  margin-bottom: 7px; border-left: 3px solid #ccc;
  display: flex; justify-content: space-between; align-items: center; cursor: pointer;
}
.panel-event[data-type="raid"]      { border-left-color: var(--color-raid); }
.panel-event[data-type="community"] { border-left-color: var(--color-community); }
.panel-event[data-type="special"]   { border-left-color: var(--color-special); }
.panel-event[data-type="spotlight"] { border-left-color: var(--color-shiny); }
.panel-event-name { font-size: 13px; font-weight: 600; }
.panel-event-meta { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.panel-shiny-flag { font-size: 11px; color: var(--chip-shiny-color); }

/* ===== DETAIL VIEW ===== */
.detail-hero {
  padding: 16px;
  background: linear-gradient(160deg, #4a148c, #1565c0);
  color: #fff;
}
.detail-hero[data-type="raid"]      { background: linear-gradient(160deg, #8e1c1c, var(--color-raid)); }
.detail-hero[data-type="community"] { background: linear-gradient(160deg, #1b5e20, var(--color-community)); }
.detail-hero[data-type="spotlight"] { background: linear-gradient(160deg, #8a6500, var(--color-shiny)); }
.detail-hero[data-type="special"]   { background: linear-gradient(160deg, #4a148c, var(--color-special)); }
.detail-hero[data-type="season"]    { background: linear-gradient(160deg, #01579b, var(--color-season)); }

.back-btn {
  font-size: 12px; color: rgba(255,255,255,0.8); cursor: pointer;
  background: none; border: none; margin-bottom: 12px; display: block;
  font-family: inherit;
}
.event-type-badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 3px 10px; border-radius: 20px;
  background: rgba(255,255,255,0.2); color: #fff;
  margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px;
}
.detail-title { font-size: 20px; font-weight: 800; line-height: 1.2; }
.detail-dates { font-size: 12px; color: rgba(255,255,255,0.85); margin-top: 6px; }
.hero-actions { display: flex; gap: 8px; margin-top: 14px; }
.hero-btn {
  flex: 1; padding: 9px; border-radius: 10px; font-size: 12px;
  font-weight: 700; border: none; cursor: pointer; text-align: center;
  font-family: inherit; text-decoration: none;
}
.hero-btn.notify { background: rgba(255,255,255,0.2); color: #fff; }
.hero-btn.cal    { background: rgba(255,255,255,0.2); color: #fff; }

.countdown-bar {
  background: var(--bg-card); margin: 10px 12px; border-radius: 10px;
  padding: 10px 14px; display: flex; justify-content: space-between; align-items: center;
}
.countdown-label { font-size: 11px; color: var(--text-muted); }
.countdown-value { font-size: 16px; font-weight: 700; color: var(--accent-info-bright); }
.progress-track { height: 4px; background: var(--border); border-radius: 2px; margin-top: 8px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent-info), var(--accent-info-bright)); border-radius: 2px; }
.countdown-end-label { font-size: 11px; color: var(--text-muted); text-align: right; }

.detail-section { padding: 12px 16px 0; }
.detail-section-title {
  font-size: 11px; font-weight: 700; color: var(--accent-info);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px;
}
.shinies-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.shiny-chip {
  background: var(--chip-shiny-bg); border: 1px solid rgba(255,193,7,0.3);
  border-radius: 10px; padding: 6px 12px; font-size: 12px;
  color: var(--chip-shiny-color); font-weight: 600;
}
.raid-item {
  background: var(--bg-card); border-radius: 10px; padding: 10px 12px;
  margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center;
}
.raid-name { font-size: 13px; font-weight: 600; }
.raid-shiny { font-size: 11px; color: var(--chip-shiny-color); }
.bonus-list { list-style: none; }
.bonus-list li {
  font-size: 13px; color: var(--text-muted); padding: 5px 0;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}

.analysis-box {
  background: linear-gradient(135deg, rgba(21,101,192,0.2), rgba(74,20,140,0.2));
  border: 1px solid rgba(100,181,246,0.2); border-radius: 12px; padding: 12px 14px;
  margin-bottom: 20px;
}
.analysis-label {
  font-size: 10px; color: var(--accent-info); font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px;
}
.analysis-text { font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.analysis-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.analysis-tag {
  font-size: 10px; background: rgba(100,181,246,0.15);
  color: var(--accent-info-soft); padding: 3px 8px; border-radius: 8px;
}
.analysis-priority {
  font-size: 10px; font-weight: 700; padding: 3px 8px;
  border-radius: 8px; margin-left: 6px; text-transform: uppercase;
}
.analysis-priority.high   { background: var(--chip-raid-bg); color: var(--chip-raid-color); }
.analysis-priority.medium { background: var(--chip-shiny-bg); color: var(--chip-shiny-color); }
.analysis-priority.low    { background: var(--chip-comm-bg); color: var(--chip-comm-color); }

.analysis-pending {
  background: var(--bg-card); border: 1px dashed var(--border);
  border-radius: 12px; padding: 14px; margin-bottom: 20px; text-align: center;
}
.analysis-pending p { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.analysis-pending-btn {
  background: #1565c0; color: #fff; border: none; border-radius: 8px;
  padding: 8px 16px; font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: inherit;
}
.analysis-pending-btn:disabled { opacity: 0.6; cursor: default; }

/* ===== AGENDA VIEW ===== */
.update-btn {
  background: rgba(255,255,255,0.15);
  border: none; color: #fff; padding: 6px 12px;
  border-radius: 20px; font-size: 11px; cursor: pointer;
  font-family: inherit;
}
.update-btn:disabled { opacity: 0.6; cursor: default; }

.event-card {
  margin: 0 12px 10px;
  background: var(--bg-card);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-left: 4px solid #ccc;
  box-shadow: var(--shadow);
}
.event-card[data-type="raid"]      { border-left-color: var(--color-raid); }
.event-card[data-type="community"] { border-left-color: var(--color-community); }
.event-card[data-type="special"]   { border-left-color: var(--color-special); }
.event-card[data-type="spotlight"] { border-left-color: var(--color-shiny); }

.card-inner { padding: 12px 14px; }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.card-title { font-size: 14px; font-weight: 700; line-height: 1.3; }
.card-badge {
  font-size: 10px; font-weight: 700; padding: 3px 8px;
  border-radius: 10px; white-space: nowrap; margin-left: 8px;
}
.badge-active { background: var(--chip-comm-bg); color: var(--chip-comm-color); }
.badge-soon   { background: var(--chip-shiny-bg); color: var(--chip-shiny-color); }

.card-dates { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.meta-tag {
  font-size: 11px; background: var(--chip-inactive-bg);
  padding: 3px 8px; border-radius: 8px; color: var(--text-muted);
  border: 1px solid var(--border);
}
.meta-tag.shiny { color: var(--chip-shiny-color); background: var(--chip-shiny-bg); border-color: transparent; }

.card-actions {
  display: flex; gap: 8px; margin-top: 10px;
  padding-top: 10px; border-top: 1px solid var(--border);
}
.action-btn {
  flex: 1; padding: 7px; border-radius: 8px; font-size: 11px;
  font-weight: 600; border: none; cursor: pointer; text-align: center;
  font-family: inherit; transition: opacity .12s;
}
.action-btn:hover { opacity: 0.75; }
.action-btn:focus-visible { outline: 2px solid var(--accent-info-bright); outline-offset: 2px; }
.btn-detail  { background: var(--chip-inactive-bg); color: var(--accent-info); }
.btn-notify  { background: var(--chip-shiny-bg); color: var(--chip-shiny-color); }
.btn-calendar { background: var(--chip-comm-bg); color: var(--chip-comm-color); }

/* ── Raids enriched ───────────────────────────────── */
.raid-stars {
  font-size: 14px;
  color: var(--color-warning, #ffc107);
  letter-spacing: 1px;
  margin-top: 2px;
}

.raid-types {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.raid-type {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  padding: 2px 8px;
  border-radius: 999px;
  text-shadow: 0 1px 2px rgba(0,0,0,.3);
}

/* ── Shinies enriched ────────────────────────────── */
.shiny-origin {
  display: block;
  font-size: 11px;
  opacity: .75;
  margin-top: 2px;
}

/* ── Bonuses enriched ────────────────────────────── */
.bonus-category {
  font-size: 11px;
  opacity: .7;
  margin-left: 6px;
}

/* ── Confidence low badge ────────────────────────── */
.confidence-low {
  display: inline-block;
  font-size: 10px;
  background: var(--color-warning, #ffc107);
  color: #000;
  border-radius: 4px;
  padding: 0 5px;
  margin-left: 4px;
  vertical-align: middle;
  opacity: .8;
}

/* ── Shinies tab ──────────────────────────────────── */
.section-label {
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  color: var(--accent-warn, #f57c00); text-transform: uppercase;
  padding: 16px 16px 6px;
}

.event-group {
  margin: 0 12px 12px;
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.event-group-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 12px 14px 8px;
}

.event-group-meta { display: flex; flex-direction: column; gap: 2px; }

.event-type-label {
  font-size: 10px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em;
}

.event-title { font-size: 13px; font-weight: 700; line-height: 1.3; }

.event-dates { font-size: 11px; color: var(--text-muted); }

.shinies-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 6px; padding: 0 12px 12px;
}

.shiny-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; background: var(--chip-inactive-bg);
  border-radius: 8px; padding: 8px 4px; text-align: center;
}

.shiny-emoji { font-size: 18px; }

.shiny-name {
  font-size: 11px; font-weight: 600; line-height: 1.2;
  word-break: break-word;
}

.research-chip {
  font-size: 9px; font-weight: 600;
  background: var(--chip-shiny-bg); color: var(--chip-shiny-color);
  padding: 2px 5px; border-radius: 6px; white-space: nowrap;
}

/* -- CAL POPOVER ---------------------------------------- */
#cal-popover-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 199;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
#cal-popover-backdrop.visible { display: block; }

#cal-popover {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  width: min(92vw, 460px);
  max-height: 70vh;
  overflow-y: auto;
  display: none;
}
#cal-popover.visible { display: block; }

.cal-pop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px 7px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--panel-bg);
}
.cal-pop-date {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-info);
}
.cal-pop-close {
  background: none;
  border: none;
  color: var(--text-primary);
  opacity: 0.5;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
}
.cal-pop-close:hover { opacity: 1; }

.cal-pop-list { list-style: none; padding: 6px 0; }
.cal-pop-item {
  display: flex;
  align-items: center;
  padding: 9px 14px 9px 16px;
  cursor: pointer;
  transition: background 0.1s;
  gap: 10px;
}
.cal-pop-item:hover { background: rgba(255,255,255,0.05); }
[data-theme="light"] .cal-pop-item:hover { background: rgba(0,0,0,0.04); }

.cal-pop-bar {
  width: 3px;
  min-height: 16px;
  align-self: stretch;
  border-radius: 2px;
  flex-shrink: 0;
}
.cal-pop-bar.ev-raid      { background: var(--color-raid); }
.cal-pop-bar.ev-community { background: var(--color-community); }
.cal-pop-bar.ev-special   { background: var(--color-special); }
.cal-pop-bar.ev-season    { background: var(--color-season); }
.cal-pop-bar.ev-spotlight { background: var(--color-shiny); }

.cal-pop-title {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.35;
  flex: 1;
}

.cal-pop-arrow {
  color: var(--text-muted);
  font-size: 13px;
  opacity: 0.4;
  flex-shrink: 0;
}

/* ── Shiny alert button ─────────────────────────────── */
.shiny-alert-row {
  padding: 0 12px 12px;
}

.shiny-alert-btn {
  width: 100%; font-size: 12px; font-weight: 600;
  background: var(--chip-inactive-bg); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; cursor: pointer; transition: background 0.15s;
}
.shiny-alert-btn:hover { background: var(--bg-card); }
.shiny-alert-btn--on {
  background: var(--bg-card); color: var(--accent-shiny); border-color: var(--accent-shiny);
}

/* ── Alert form inline ──────────────────────────────── */
.shiny-alert-form, .my-alert-form {
  margin-top: 8px;
}

.alert-form-inner {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; display: flex;
  flex-direction: column; gap: 8px;
}

.alert-form-title {
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px;
}

.alert-radio {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; cursor: pointer;
}

.alert-num {
  width: 48px; padding: 2px 4px; border-radius: 4px;
  border: 1px solid var(--border); background: var(--chip-inactive-bg);
  color: var(--text-primary); font-size: 13px; text-align: center;
}

.alert-hour-row {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
}

.alert-time-input {
  padding: 3px 6px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--chip-inactive-bg); color: var(--text-primary); font-size: 13px;
}

.alert-form-actions {
  display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px;
}

.alert-cancel-btn {
  font-size: 12px; padding: 5px 12px; border-radius: 8px;
  background: var(--btn-secondary-bg); border: 1px solid var(--btn-secondary-border);
  color: var(--btn-secondary-text); cursor: pointer; font-family: inherit;
}
.alert-cancel-btn:hover { background: var(--btn-secondary-hover); }
.alert-cancel-btn:focus-visible { outline: 2px solid var(--accent-info-bright); outline-offset: 2px; }

.alert-save-btn {
  font-size: 12px; font-weight: 600; padding: 5px 14px; border-radius: 8px;
  background: var(--btn-primary-bg); color: var(--btn-primary-text); border: none; cursor: pointer; font-family: inherit;
}
.alert-save-btn:hover { background: var(--btn-primary-hover); }
.alert-save-btn:focus-visible { outline: 2px solid var(--accent-info-bright); outline-offset: 2px; }

/* ── VISTA LISTA — EVENT CARDS ────────────────────────────────────────────── */
.ev-list-container { padding-top: 4px; }

.group-head {
  padding: 10px 16px 6px; display: flex; align-items: center; gap: 8px;
  position: sticky; top: 53px; z-index: 9; background: var(--bg-surface);
}
.group-label {
  font-size: 10px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-muted);
}
.group-line { flex: 1; height: 1px; background: var(--border); }
.group-count {
  font-size: 10px; font-weight: 600; color: var(--text-muted);
  background: var(--chip-inactive-bg); border: 1px solid var(--border);
  border-radius: 20px; padding: 1px 7px;
}

.ev-card {
  margin: 0 12px 8px; background: var(--bg-card);
  border-radius: 14px; border: 1px solid var(--border);
  overflow: hidden; display: flex; flex-wrap: wrap; cursor: pointer;
  transition: border-color .15s;
}
.ev-card.in-agenda { border-color: rgba(102,187,106,.3); }
.ev-stripe { width: 4px; flex-shrink: 0; }
.ev-icon {
  width: 56px; flex-shrink: 0; display: flex; align-items: center;
  justify-content: center; font-size: 26px;
  background: var(--chip-inactive-bg);
}
.ev-body {
  flex: 1; padding: 10px 10px 10px 11px; min-width: 0;
  display: flex; flex-direction: column; gap: 3px;
}
.ev-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.ev-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 9px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 5px;
}
.ev-badge.badge-active  { background: rgba(100,181,246,.15); color: var(--accent-info); }
.ev-badge.badge-soon    { background: var(--badge-soon-bg); color: var(--badge-soon-color); }
.ev-badge.badge-ending  { background: rgba(239,83,80,.12); color: var(--color-raid); }
.ev-type-tag {
  font-size: 9px; font-weight: 600; color: var(--text-muted);
  padding: 2px 6px; border-radius: 5px;
  background: var(--chip-inactive-bg); text-transform: uppercase; letter-spacing: .05em;
}
.ev-title {
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2;
}
.ev-countdown {
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--accent-info); line-height: 1.1;
}
.ev-countdown.ending { color: var(--color-raid); }
.ev-countdown .cd-label { font-weight: 500; color: var(--text-muted); font-size: 10px; }
.ev-dates { font-size: 11px; color: var(--text-muted); line-height: 1.1; }
.ev-action {
  display: flex; align-items: center; justify-content: center;
  padding: 10px 10px 10px 6px; flex-shrink: 0;
}
.btn-add {
  padding: 6px 12px; border-radius: 8px; border: 1px solid var(--btn-secondary-border);
  background: var(--btn-secondary-bg); color: var(--btn-secondary-text);
  font-size: 11px; font-weight: 600; white-space: nowrap; cursor: pointer;
  font-family: inherit;
}
.btn-add:hover { background: var(--btn-secondary-hover); }
.btn-add:focus-visible { outline: 2px solid var(--accent-info-bright); outline-offset: 2px; }
.btn-add.added {
  background: var(--chip-comm-bg); border-color: var(--color-community);
  color: var(--chip-comm-color);
}
.btn-add.added:hover { opacity: 0.85; }
.list-end { height: 12px; }
.ev-action--agenda {
  flex-direction: column; align-items: flex-end; gap: 6px;
}

/* ── EV-CARD: countdown label/valor separados (componente unificado) ───────── */
.ev-countdown-label {
  font-size: 11px; color: var(--text-muted); margin-top: 2px;
}
.ev-countdown-value {
  font-size: 15px; font-weight: 700;
  color: var(--accent-info-bright);
  font-variant-numeric: tabular-nums; line-height: 1.2;
}
.ev-countdown-value.ending { color: var(--color-raid); }

/* chip "Inicia Hoy · H PM" en fila meta */
.chip-starts-today {
  font-size: 10px; font-weight: 700; border-radius: 20px;
  padding: 2px 8px; white-space: nowrap;
  background: rgba(100,181,246,.15);
  color: var(--accent-info);
}

/* ev-type-tag variantes de color (componente unificado) */
.ev-type-tag.raid      { background: var(--chip-raid-bg);  color: var(--chip-raid-color); }
.ev-type-tag.community { background: var(--chip-comm-bg);  color: var(--chip-comm-color); }
.ev-type-tag.special   { background: var(--chip-spec-bg);  color: var(--chip-spec-color); }
.ev-type-tag.event     { background: var(--chip-spec-bg);  color: var(--chip-spec-color); }

/* shiny chip en ev-card */
.ev-card .shiny-chip {
  font-size: 10px; font-weight: 600; border-radius: 20px;
  padding: 2px 8px; white-space: nowrap;
  background: var(--chip-shiny-bg); color: var(--chip-shiny-color);
}

/* ── BOTON ALERTA (componente unificado) ────────────────────────────────────── */
.btn-alert {
  font-size: 11px; font-weight: 600;
  padding: 6px 11px; border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--chip-inactive-bg);
  color: var(--text-muted);
  cursor: pointer; white-space: nowrap;
  font-family: inherit; transition: background .15s, color .15s;
}
.btn-alert.active {
  background: var(--accent-shiny-dim);
  border-color: var(--accent-shiny);
  color: var(--accent-shiny);
}

/* ── BADGE FINALIZADO ───────────────────────────────────────────────────────── */
.badge-done {
  background: var(--chip-inactive-bg);
  color: var(--text-muted);
}

/* ── BOTON QUITAR (solo Mi Agenda) ─────────────────────────────────────────── */
.btn-remove {
  font-size: 11px; font-weight: 600;
  padding: 6px 11px; border-radius: 9px;
  border: 1px solid rgba(239,83,80,.35);
  background: rgba(239,83,80,.08);
  color: var(--color-raid);
  cursor: pointer; white-space: nowrap;
  font-family: inherit; transition: background .15s;
}

/* ── ACCION DOBLE: alerta + quitar lado a lado ──────────────────────────────── */
.ev-action-double {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 12px 10px 0; flex-shrink: 0;
}

/* ── POPOVER ALERTA (componente unificado) ──────────────────────────────────── */
.popover-wrap {
  position: relative; display: inline-block;
}
.popover {
  display: none;
  position: absolute; bottom: calc(100% + 8px); right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  padding: 12px 14px;
  min-width: 200px;
  z-index: 200;
}
.popover.open { display: block; }
.popover-title {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  margin-bottom: 10px; text-transform: uppercase; letter-spacing: .06em;
}
.alert-chips {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.alert-chip {
  font-size: 11px; font-weight: 600; border-radius: 20px;
  padding: 5px 11px; border: 1px solid var(--border);
  background: var(--chip-inactive-bg); color: var(--text-muted);
  cursor: pointer; transition: background .15s, color .15s;
}
.alert-chip.sel {
  background: var(--accent-shiny-dim);
  border-color: var(--accent-shiny);
  color: var(--accent-shiny);
}
.popover-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px;
}
.btn-pop-cancel {
  font-size: 11px; font-weight: 600; padding: 5px 10px;
  border-radius: 8px; border: 1px solid var(--border);
  background: none; color: var(--text-muted); cursor: pointer; font-family: inherit;
}
.btn-pop-save {
  font-size: 11px; font-weight: 600; padding: 5px 12px;
  border-radius: 8px; border: none;
  background: var(--accent-info); color: #0a0f1a; cursor: pointer; font-family: inherit;
}

/* ── ALERT INLINE: tercer row en EventCard ─────────────────────────────────── */
.ev-alert-form-row {
  flex: 0 0 100%;
  display: none;
  padding: 0 12px 12px;
}
.ev-alert-form-row.open { display: block; }
.alert-form { display: none; }
.alert-form.open { display: block; }

.btn-configure-alert {
  padding: 6px 12px; border-radius: 8px; border: 1px solid var(--btn-secondary-border);
  background: var(--btn-secondary-bg); color: var(--btn-secondary-text);
  font-size: 11px; font-weight: 600; cursor: pointer; white-space: nowrap;
  font-family: inherit;
}
.btn-configure-alert:hover { background: var(--btn-secondary-hover); }
.btn-configure-alert:focus-visible { outline: 2px solid var(--accent-info-bright); outline-offset: 2px; }

/* ── FILTER PANEL BUTTON ──────────────────────────────────────────────────── */
.filter-panel-btn {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--chip-inactive-bg); color: var(--text-muted);
  cursor: pointer; flex-shrink: 0; transition: background .15s, color .15s;
}
.filter-panel-btn.has-filters {
  background: rgba(100,181,246,.15); border-color: rgba(100,181,246,.3);
  color: var(--accent-info);
}
.filter-badge {
  position: absolute; top: -5px; right: -5px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--accent-info); border: 2px solid var(--bg-surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; font-weight: 800; color: #0a0f1a; line-height: 1;
}

/* ── ACTIVE FILTER STRIP ─────────────────────────────────────────────────── */
.active-filter-strip {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px; overflow-x: auto; flex-shrink: 0;
  background: rgba(100,181,246,.04); border-bottom: 1px solid rgba(100,181,246,.1);
}
.active-filter-strip::-webkit-scrollbar { display: none; }
.af-chip {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0;
  height: 20px; padding: 0 7px; border-radius: 10px;
  font-size: 11px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.af-chip .af-x { opacity: .6; font-size: 12px; }
.af-search, .af-sort   { background: rgba(100,181,246,.15); color: var(--accent-info); }
.af-estado             { background: rgba(100,181,246,.15); color: var(--accent-info); }
.af-shiny              { background: rgba(255,193,7,.15);   color: var(--color-spotlight); }
.af-duracion           { background: rgba(144,164,174,.12); color: var(--text-muted); }
.af-bonus              { background: rgba(102,187,106,.15); color: var(--color-community); }
.af-agenda             { background: rgba(171,71,188,.15);  color: var(--color-special); }
.af-clear {
  margin-left: auto; flex-shrink: 0; font-size: 11px; font-weight: 600;
  color: var(--text-muted); background: none; border: none; cursor: pointer;
  padding: 0 4px; white-space: nowrap;
}

/* ── FILTER PANEL OVERLAY + PANEL ────────────────────────────────────────── */
#filter-panel-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  z-index: 200; opacity: 0; pointer-events: none; transition: opacity .2s;
}
#filter-panel-overlay.visible { opacity: 1; pointer-events: auto; }

#filter-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(82vw, 320px);
  background: var(--bg-nav); border-left: 1px solid var(--border-strong);
  z-index: 201; display: flex; flex-direction: column; overflow: hidden;
  transform: translateX(100%); transition: transform .22s ease;
}
#filter-panel.visible { transform: translateX(0); }

.fp-header {
  height: 48px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.fp-title { font-size: 15px; font-weight: 800; color: var(--text-primary); letter-spacing: -.01em; }
.fp-close {
  width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--chip-inactive-bg); color: var(--text-muted);
  font-size: 18px; line-height: 1; cursor: pointer; display: flex;
  align-items: center; justify-content: center; font-family: inherit;
}

.fp-body { flex: 1; overflow-y: auto; padding: 8px 0; }
.fp-body::-webkit-scrollbar { width: 3px; }
.fp-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }

.fp-section { padding: 0 14px; margin-bottom: 12px; }
.fp-label {
  font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 7px;
}
.fp-label-row { display: flex; align-items: center; gap: 6px; }
.fp-badge-gemini {
  font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 4px;
  background: rgba(100,181,246,.15); color: var(--accent-info);
  text-transform: none; letter-spacing: 0;
}

.fp-divider { height: 1px; background: var(--border); margin: 0 14px 12px; }

/* busqueda */
.fp-search-wrap {
  background: var(--bg-surface); border-radius: 9px;
  border: 1px solid var(--border-strong);
}
.fp-search {
  width: 100%; padding: 8px 12px; font-size: 13px; color: var(--text-primary);
  background: transparent; border: none; outline: none; font-family: inherit;
}
.fp-search::placeholder { color: var(--text-muted); }

/* sort */
.fp-sort-row {
  display: flex; align-items: center; gap: 10px; padding: 7px 8px;
  border-radius: 7px; cursor: pointer; margin: 0 0 2px;
}
.fp-sort-row:hover { background: rgba(255,255,255,.04); }
.fp-sort-row.sel { background: rgba(100,181,246,.1); }
.fp-sort-icon { font-size: 15px; width: 22px; text-align: center; flex-shrink: 0; }
.fp-sort-name { flex: 1; font-size: 13px; font-weight: 500; color: var(--text-muted); }
.fp-sort-row.sel .fp-sort-name { color: var(--text-primary); font-weight: 600; }
.fp-sort-badge {
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px;
  background: rgba(100,181,246,.2); color: var(--accent-info);
}

/* chips */
.fp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fp-chip {
  height: 26px; padding: 0 10px; border-radius: 13px;
  font-size: 12px; font-weight: 600; background: var(--chip-inactive-bg);
  color: var(--text-muted); cursor: pointer; display: flex; align-items: center;
  border: 1px solid transparent; white-space: nowrap; user-select: none;
}
.fp-chip.on {
  background: rgba(100,181,246,.2); color: var(--accent-info);
  border-color: rgba(100,181,246,.3);
}
.fp-chip.fp-chip-sm { height: 22px; font-size: 11px; }

/* sub-selector umbral */
.fp-threshold {
  margin-top: 8px; padding: 8px 10px; border-radius: 8px;
  background: rgba(100,181,246,.05); border: 1px solid rgba(100,181,246,.15);
}
.fp-threshold-label {
  font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent-info); opacity: .8; margin-bottom: 6px;
}

/* toggles */
.fp-toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 3px 0;
}
.fp-toggle-txt { font-size: 13px; font-weight: 500; color: var(--text-muted); flex: 1; }
.fp-toggle-txt.on { color: var(--text-primary); }
.fp-toggle {
  width: 36px; height: 20px; border-radius: 10px; background: var(--chip-inactive-bg);
  position: relative; cursor: pointer; flex-shrink: 0; transition: background .15s;
}
.fp-toggle.on { background: var(--accent-info); }
.fp-knob {
  width: 14px; height: 14px; border-radius: 50%; background: var(--text-muted);
  position: absolute; top: 3px; left: 3px; transition: left .15s, background .15s;
}
.fp-toggle.on .fp-knob { left: 19px; background: #0a0f1a; }

/* vista toggle */
.fp-view-row { display: flex; gap: 6px; }
.fp-view-btn {
  flex: 1; height: 32px; border-radius: 8px; background: var(--chip-inactive-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; border: 1px solid transparent; user-select: none;
}
.fp-view-btn.on {
  background: rgba(100,181,246,.15); color: var(--accent-info);
  border-color: rgba(100,181,246,.25);
}

/* footer */
.fp-footer {
  padding: 10px 14px; border-top: 1px solid var(--border);
  flex-shrink: 0; display: flex; gap: 8px;
}
.fp-btn-reset {
  flex: 1; height: 36px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--chip-inactive-bg); font-size: 13px; font-weight: 600;
  color: var(--text-muted); cursor: pointer; font-family: inherit;
}
.fp-btn-apply {
  flex: 2; height: 36px; border-radius: 9px; border: none;
  background: var(--accent-info); font-size: 13px; font-weight: 700;
  color: #0a0f1a; cursor: pointer; font-family: inherit;
}

/* ── MI AGENDA — mini calendar ────────────────────────────────────────────── */
.mini-cal {
  margin: 8px 12px; background: var(--bg-card);
  border-radius: 14px; border: 1px solid var(--border); overflow: hidden;
}
.mc-header {
  display: flex; align-items: center; gap: 4px; padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border);
}
.mc-title { font-size: 13px; font-weight: 600; color: var(--text-primary); flex: 1; text-align: center; }
.mc-nav {
  font-size: 16px; color: var(--text-muted); background: none; border: none;
  cursor: pointer; padding: 0 2px; font-family: inherit;
}
.mc-toggle {
  font-size: 10px; font-weight: 600; color: var(--accent-info); background: none;
  border: none; cursor: pointer; font-family: inherit; letter-spacing: .04em; white-space: nowrap;
}
.mc-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); padding: 6px 8px 10px; gap: 2px;
}
.mc-hdr {
  text-align: center; font-size: 9px; font-weight: 700; color: var(--text-muted);
  letter-spacing: .06em; padding: 3px 0;
}
.mc-day {
  text-align: center; font-size: 11px; color: var(--text-dim);
  padding: 3px 1px 4px; border-radius: 6px; font-variant-numeric: tabular-nums;
  display: flex; flex-direction: column; align-items: center;
  justify-content: flex-start; gap: 2px; min-height: 30px; cursor: pointer;
}
.mc-day.other { color: var(--border); pointer-events: none; }
.mc-day.today { font-weight: 700; }
.mc-day .mc-num {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
}
.mc-day.today .mc-num { background: var(--accent-info); color: #fff; font-weight: 700; }
.mc-day.selected .mc-num { background: var(--accent-info-bright); color: #fff; font-weight: 700; box-shadow: 0 0 0 2px rgba(13,71,161,0.45); }
.mc-day.today.selected .mc-num { background: var(--accent-info-bright); color: #fff; }
/* multi-dot container */
.ev-dots { display: flex; gap: 2px; justify-content: center; }
.ev-dot  { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.mc-collapsed .mc-grid { display: none; }

/* ── MI AGENDA — alert chips form ─────────────────────────────────────────── */
.af {
  margin: 0 12px 8px; background: var(--panel-bg, #0d1b2a); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px; margin-top: -3px;
}
.af-t {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 10px;
}
.af-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.af-chip-btn {
  padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--chip-inactive-bg); color: var(--text-muted);
  font-size: 12px; font-weight: 500; font-family: inherit; cursor: pointer;
}
.af-chip-btn.sel {
  background: var(--accent-shiny-dim); border-color: var(--accent-shiny);
  color: var(--accent-shiny); font-weight: 700;
}
.af-btns { display: flex; gap: 8px; margin-top: 10px; }
.btn-c {
  flex: 1; padding: 7px; border-radius: 8px; border: 1px solid var(--btn-secondary-border);
  background: var(--btn-secondary-bg); color: var(--btn-secondary-text); font-size: 12px;
  font-family: inherit; cursor: pointer;
}
.btn-c:hover { background: var(--btn-secondary-hover); }
.btn-c:focus-visible { outline: 2px solid var(--accent-info-bright); outline-offset: 2px; }
.btn-s {
  flex: 2; padding: 7px; border-radius: 8px; border: none;
  background: var(--btn-primary-bg); color: var(--btn-primary-text); font-size: 12px;
  font-weight: 700; font-family: inherit; cursor: pointer;
}
.btn-s:hover { background: var(--btn-primary-hover); }
.btn-s:focus-visible { outline: 2px solid var(--accent-info-bright); outline-offset: 2px; }


/* ── SNACKBAR ──────────────────────────────────────────────────────────────── */
.snackbar {
  position: fixed; bottom: var(--snackbar-bottom); left: 16px; right: 16px; z-index: 9999;
  background: var(--bg-nav); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.snackbar-body {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; gap: 12px;
}
.snackbar-msg {
  color: var(--text-primary); font-size: 13px; flex: 1;
}
.snackbar-action {
  background: none; border: none; color: var(--accent-info);
  font-size: 13px; font-weight: 700; cursor: pointer;
  font-family: inherit; padding: 0; flex-shrink: 0;
}
.snackbar-progress {
  height: 3px; background: var(--accent-info); opacity: 0.4;
  transform-origin: left; animation: snackbar-drain linear forwards;
}
@keyframes snackbar-drain {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}


/* ── ALERT BANNER ─────────────────────────────────────────────────────────── */
.alert-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--alert-bg);
  border-bottom: 1px solid var(--alert-border);
  flex-shrink: 0;
}
.alert-error   { --alert-bg: var(--alert-error-bg);   --alert-border: var(--alert-error-border);   --alert-text-color: var(--alert-error-text);   --alert-sub-color: var(--alert-error-sub); }
.alert-warning { --alert-bg: var(--alert-warning-bg); --alert-border: var(--alert-warning-border); --alert-text-color: var(--alert-warning-text); --alert-sub-color: var(--alert-warning-sub); }
.alert-info    { --alert-bg: var(--alert-info-bg);    --alert-border: var(--alert-info-border);    --alert-text-color: var(--alert-info-text);    --alert-sub-color: var(--alert-info-sub); }
.alert-success { --alert-bg: var(--alert-success-bg); --alert-border: var(--alert-success-border); --alert-text-color: var(--alert-success-text); --alert-sub-color: var(--alert-success-sub); }

.alert-icon { font-size: 16px; flex-shrink: 0; }
.alert-body { flex: 1; min-width: 0; }
.alert-text {
  font-size: 12px; font-weight: 600;
  color: var(--alert-text-color, var(--text-primary));
  line-height: 1.3;
}
.alert-sub {
  font-size: 10px; margin-top: 2px; opacity: .85;
  color: var(--alert-sub-color, var(--text-muted));
}
.alert-btn {
  background: var(--btn-primary-bg); border: none;
  color: var(--btn-primary-text);
  font-size: 11px; font-weight: 600;
  border-radius: 8px; padding: 5px 10px;
  cursor: pointer; flex-shrink: 0;
  white-space: nowrap; font-family: inherit;
  transition: background .15s;
}
.alert-btn:hover { background: var(--btn-primary-hover); }
.alert-btn:focus-visible { outline: 2px solid var(--accent-info-bright); outline-offset: 2px; }


/* ── NOTIF SHEET ───────────────────────────────────────────────────────────── */
.notif-sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: none;
  align-items: flex-end;
}
.notif-sheet-backdrop.open { display: flex; }

.notif-sheet {
  background: var(--bg-surface);
  border-radius: 20px 20px 0 0;
  width: 100%;
  padding-bottom: 24px;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
  touch-action: pan-y;
}
.notif-sheet-handle {
  width: 36px; height: 4px;
  border-radius: 2px;
  background: var(--chip-inactive-bg);
  margin: 10px auto 0;
}
.notif-sheet-header {
  display: flex; align-items: center;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.notif-sheet-title {
  flex: 1; font-size: 15px; font-weight: 800;
  color: var(--text-primary);
}
.notif-sheet-close {
  background: var(--chip-inactive-bg);
  border: none; color: var(--text-muted);
  font-size: 18px; line-height: 1;
  width: 30px; height: 30px;
  border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s; font-family: inherit;
}
.notif-sheet-close:hover { background: var(--border); }

.notif-sheet-body { padding: 16px 20px; }
.notif-sheet-lead {
  font-size: 13px; color: var(--text-muted);
  margin-bottom: 16px; line-height: 1.4;
}

.browser-tabs-row {
  display: flex; gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto; scrollbar-width: none;
}
.browser-tabs-row::-webkit-scrollbar { display: none; }

.browser-tab-btn {
  font-size: 11px; font-weight: 600;
  padding: 5px 12px; border-radius: 20px;
  border: 1px solid transparent;
  background: var(--chip-inactive-bg);
  color: var(--chip-inactive-color);
  cursor: pointer; white-space: nowrap;
  font-family: inherit;
  transition: background .15s, color .15s;
}
.browser-tab-btn.active {
  background: rgba(100,181,246,.15);
  border-color: var(--accent-info);
  color: var(--accent-info);
}

.notif-steps-list {
  display: flex; flex-direction: column;
  gap: 12px; margin-bottom: 20px;
}
.notif-steps-list.hidden { display: none; }

.notif-step { display: flex; gap: 12px; align-items: flex-start; }
.notif-step-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent-info); color: var(--btn-primary-text);
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.notif-step-text {
  flex: 1; font-size: 13px; color: var(--text-primary);
  line-height: 1.4; padding-top: 3px;
}
.notif-step-text em {
  font-style: normal; font-weight: 600; color: var(--accent-info);
}

.notif-sheet-divider {
  height: 1px; background: var(--border);
  margin: 0 -20px 16px;
}
.notif-sheet-fallback {
  font-size: 12px; color: var(--text-muted); text-align: center;
}
.notif-sheet-fallback a {
  color: var(--accent-info); text-decoration: none;
}
.notif-sheet-fallback a:hover { text-decoration: underline; }
