/* Material Design 3 (Material UI) Theme - Clean, Light & Pleasant */
:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --surface-subtle: #f1f3f9;
  --panel: #ffffff;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.14);
  --text: #1d1b20;
  --text-muted: #525866;
  --muted: #64748b;
  --a: #6750a4; /* Material Primary Deep Purple */
  --a-hover: #5b4495;
  --a-container: #ede9fe;
  --a-on-container: #3b0764;
  --b: #0284c7; /* Material Sky Accent */
  --c: #0891b2; /* Material Cyan */
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --card-shadow-hover: 0 12px 24px -4px rgba(0, 0, 0, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', system-ui, -apple-system, Roboto, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(800px 500px at 10% 0%, rgba(103, 80, 164, 0.05), transparent),
              radial-gradient(700px 500px at 90% 10%, rgba(2, 132, 199, 0.04), transparent);
}

/* Material App Bar */
.top {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 32px;
  position: sticky;
  top: 0;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  z-index: 100;
  flex-wrap: wrap;
}

.brand {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1d1b20;
  letter-spacing: -0.3px;
}

.brand span {
  background: linear-gradient(135deg, var(--a), var(--b));
  -webkit-background-clip: text;
  color: transparent;
}

/* Material Navigation Tabs */
nav {
  display: flex;
  gap: 8px;
  flex: 1;
}

.tab {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.tab:hover {
  color: #1d1b20;
  background: rgba(103, 80, 164, 0.08);
}

.tab.active {
  background: var(--a);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(103, 80, 164, 0.3);
  font-weight: 600;
}

.badge {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #bae6fd;
  background: #f0f9ff;
  color: #0284c7;
  font-weight: 600;
}

.hidden { display: none !important; }

/* Main Content Layout */
main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 24px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}

.page-header-text {
  flex: 1;
}

.view-toggles {
  display: none !important;
}

.view-toggle-btn {
  background: transparent;
  border: 0;
  padding: 6px 11px;
  font-size: 1.05rem;
  border-radius: 7px;
  cursor: pointer;
  color: #64748b;
  line-height: 1;
  transition: all 0.15s ease;
}

.view-toggle-btn:hover {
  color: #1e293b;
}

.view-toggle-btn.active {
  background: #ffffff;
  color: var(--a);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.meta.ott-date {
  font-weight: 600;
  color: #0284c7;
}

.bottom-nav {
  display: none;
}

/* Movie Grid & Material Cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
  margin-top: 24px;
}

.movie {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.22s, border-color 0.22s;
  display: flex;
  flex-direction: column;
  box-shadow: var(--card-shadow);
}

.movie:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
  border-color: rgba(103, 80, 164, 0.3);
}

.poster {
  aspect-ratio: 2/3;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  padding: 12px;
  position: relative;
  background-color: #f1f3f9;
}

.poster .match {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #ede9fe;
  border: 1px solid #ddd6fe;
  color: #5b21b6;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.poster .ph {
  font-size: 2.2rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.info h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #1d1b20;
  line-height: 1.35;
}

.meta {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

/* Material Chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  font-size: 0.74rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.chip.ott {
  background: #e0f2fe;
  border-color: #bae6fd;
  color: #0369a1;
  font-weight: 600;
}

.chip.sel {
  background: var(--a);
  color: #ffffff;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(103, 80, 164, 0.3);
}

.chip.pick {
  cursor: pointer;
  font-size: 0.84rem;
  padding: 6px 14px;
  transition: all 0.15s ease;
}

.chip.pick:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.why {
  font-size: 0.78rem;
  color: var(--muted);
  background: #f8fafc;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

/* Star Ratings */
.stars {
  display: flex;
  gap: 3px;
  margin-top: auto;
  padding-top: 6px;
}

.stars button {
  background: none;
  border: 0;
  font-size: 1.3rem;
  cursor: pointer;
  color: #cbd5e1;
  padding: 0;
  transition: transform 0.15s ease, color 0.15s ease;
}

.stars button.on {
  color: #f59e0b;
}

.stars button:hover {
  transform: scale(1.25);
  color: #fbbf24;
}

/* Material Buttons */
.btn {
  background: var(--a);
  border: 0;
  color: #ffffff;
  font: inherit;
  font-size: 0.92rem;
  padding: 10px 22px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(103, 80, 164, 0.25);
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.btn:hover {
  background: var(--a-hover);
  box-shadow: 0 4px 8px rgba(103, 80, 164, 0.35);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn.ghost {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn.ghost:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.btn.small {
  padding: 5px 14px;
  font-size: 0.82rem;
  border-radius: 8px;
}

.btn.taste-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.btn.taste-pill.active {
  background: var(--a);
  color: #ffffff;
  border-color: var(--a);
  box-shadow: 0 2px 8px rgba(103, 80, 164, 0.35);
}

.btn.taste-pill.active:hover {
  background: var(--a-hover);
}

.btn.taste-pill:not(.active) {
  background: #ffffff;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.btn.taste-pill:not(.active):hover {
  background: #f8fafc;
  color: #0f172a;
}

.taste-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  background: #22c55e;
  box-shadow: 0 0 4px #22c55e;
}

.taste-pill:not(.active) .taste-indicator-dot {
  background: #94a3b8;
  box-shadow: none;
}

/* Settings & Form Panels */
.panel {
  grid-column: 1 / -1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--card-shadow);
}

.panel h2 {
  margin-top: 0;
  color: #1d1b20;
}

.panel label {
  display: block;
  margin: 18px 0 8px;
  font-weight: 600;
  color: #334155;
}

input[type=time], select {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--text);
  padding: 9px 14px;
  border-radius: 10px;
  font: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type=time]:focus, select:focus {
  border-color: var(--a);
  box-shadow: 0 0 0 3px rgba(103, 80, 164, 0.15);
}

/* Material Modal Dialog */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 28px;
  max-width: 960px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08);
  color: #1d1b20;
}

.digest-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

/* Material Toast / Snackbar */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 10px;
  z-index: 60;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Filter Bar & Pills */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  margin-bottom: 8px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #1e293b;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  font-family: inherit;
}

.filter-pill:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.filter-pill.active {
  background: #f5f3ff;
  border-color: #c4b5fd;
  color: var(--a);
  font-weight: 600;
}

.filter-pill b {
  background: var(--a);
  color: #ffffff;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
}

.filter-clear-btn {
  padding: 7px 14px;
  font-size: 0.82rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* Dedicated Filter Sheet Modal (Single instance) */
.filter-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
}

.filter-modal.hidden {
  display: none !important;
}

.filter-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.18s ease-out;
}

.filter-sheet {
  position: relative;
  z-index: 1;
  background: #ffffff;
  border-radius: 20px;
  width: 92%;
  max-width: 520px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.06);
  animation: scaleUp 0.2s cubic-bezier(0.2, 0, 0, 1);
  overflow: hidden;
}

.filter-sheet-handle {
  display: none;
}

.filter-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #f1f5f9;
}

.filter-sheet-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.filter-sheet-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
}

.filter-sheet-count {
  font-size: 0.78rem;
  color: var(--a);
  font-weight: 600;
  background: #f5f3ff;
  padding: 2px 8px;
  border-radius: 999px;
}

.filter-sheet-close-btn {
  background: #f1f5f9;
  border: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: #64748b;
  transition: all 0.15s ease;
}

.filter-sheet-close-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.filter-sheet-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
  max-height: 52vh;
}

.filter-sheet-body .chips {
  gap: 8px;
}

.filter-sheet-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid #f1f5f9;
  background: #fafafa;
}

h2.week {
  grid-column: 1 / -1;
  margin: 24px 0 0;
  font-size: 1.3rem;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  color: #1d1b20;
}

.weekempty { grid-column: 1 / -1; margin: 0; }
.more { grid-column: 1 / -1; text-align: center; margin: 12px 0 32px; }
h2.week.empty { font-size: 1rem; margin-top: 8px; border: 0; opacity: 0.7; }

.active-filter-bar {
  display: none !important;
}

/* --- Floating CineBot Chat Widget (Material UI) --- */
.chat-launcher {
  position: fixed;
  bottom: 26px;
  right: 26px;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--a);
  border: 0;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(103, 80, 164, 0.35);
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.2s, background 0.2s;
}

.chat-launcher:hover {
  transform: translateY(-2px) scale(1.02);
  background: var(--a-hover);
  box-shadow: 0 10px 24px rgba(103, 80, 164, 0.45);
}

.chat-launcher:active {
  transform: translateY(0) scale(0.98);
}

.chat-launcher .chat-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.chat-launcher-badge {
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.chat-window {
  position: fixed;
  bottom: 90px;
  right: 26px;
  width: 420px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 110px);
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.14), 0 4px 12px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  animation: chatSlideUp 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes chatSlideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #f8f9fc;
  border-bottom: 1px solid #e2e8f0;
  gap: 12px;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #ede9fe;
  border: 1px solid #ddd6fe;
  color: #6750a4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.chat-header-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-header-pill {
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--a);
  color: #ffffff;
  font-weight: 600;
}

.chat-header-sub {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.chat-header-btn {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  line-height: 1;
  transition: all 0.15s ease;
}

.chat-header-btn:hover {
  color: #1e293b;
  background: rgba(0, 0, 0, 0.05);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
  background: #fafbfc;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  animation: chatMsgFade 0.2s ease-out;
}

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

.chat-msg.user { align-self: flex-end; }
.chat-msg.assistant { align-self: flex-start; }

.chat-bubble {
  padding: 10px 15px;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.5;
  word-break: break-word;
}

.chat-msg.user .chat-bubble {
  background: var(--a);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(103, 80, 164, 0.25);
}

.chat-msg.assistant .chat-bubble {
  background: #f1f3f9;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  border-bottom-left-radius: 4px;
}

.chat-bubble p { margin: 0 0 8px; }
.chat-bubble p:last-child { margin-bottom: 0; }
.chat-bubble strong { color: #0f172a; font-weight: 600; }
.chat-bubble em { color: #0369a1; font-style: normal; }
.chat-bubble ul { margin: 6px 0; padding-left: 18px; }
.chat-bubble li { margin-bottom: 4px; }

.chat-time {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 4px;
  padding: 0 4px;
}

.chat-msg.user .chat-time { align-self: flex-end; }

/* Attached Mini Movie Cards Inside Chat */
.chat-movie-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.chat-movie-card {
  display: flex;
  gap: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 8px 10px;
  align-items: center;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.chat-movie-card:hover {
  background: #f8fafc;
  border-color: var(--a);
  transform: translateX(3px);
}

.chat-movie-thumb {
  width: 46px;
  height: 68px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  background-color: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #475569;
}

.chat-movie-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chat-movie-title {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1e293b;
}

.chat-movie-meta {
  font-size: 0.74rem;
  color: var(--muted);
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.chat-movie-provs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.chat-movie-provs .chip {
  font-size: 0.68rem;
  padding: 2px 7px;
}

/* Typing Indicator */
.chat-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
}

.chat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--a);
  opacity: 0.4;
  animation: chatBlink 1.4s infinite ease-in-out both;
}

.chat-dot:nth-child(1) { animation-delay: -0.32s; }
.chat-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes chatBlink {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.3; }
  40% { transform: scale(1.15); opacity: 1; }
}

/* Suggestion Chips Bar */
.chat-suggestions {
  display: flex;
  gap: 6px;
  padding: 8px 14px;
  overflow-x: auto;
  scrollbar-width: none;
  border-top: 1px solid #e2e8f0;
  background: #f8f9fc;
}

.chat-suggestions::-webkit-scrollbar { display: none; }

.chat-chip {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
}

.chat-chip:hover {
  background: #ede9fe;
  border-color: var(--a);
  color: #5b21b6;
  transform: scale(1.02);
}

/* Input Bar */
.chat-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

.chat-input {
  flex: 1;
  background: #f8f9fa;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  color: #0f172a;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.chat-input:focus {
  background: #ffffff;
  border-color: var(--a);
  box-shadow: 0 0 0 3px rgba(103, 80, 164, 0.15);
}

.chat-input::placeholder {
  color: #94a3b8;
}

.chat-send-btn {
  background: var(--a);
  border: 0;
  color: #ffffff;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
  flex-shrink: 0;
}

.chat-send-btn:hover {
  background: var(--a-hover);
  transform: scale(1.05);
}

.chat-send-btn:active {
  transform: scale(0.95);
}

.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ============================================================
   RESPONSIVE DESIGN & MOBILE NATIVE APP OPTIMIZATION
   ============================================================ */

@media (max-width: 768px) {
  /* --- App Shell & Top Header --- */
  .top {
    padding: 8px 14px;
    gap: 10px;
    flex-wrap: nowrap;
    justify-content: space-between;
    height: 52px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  }

  .brand {
    font-size: 1.18rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
  }

  /* Hide desktop header tabs – replaced by bottom nav bar */
  #tabs {
    display: none !important;
  }

  .auth-nav {
    margin-left: auto;
    gap: 8px;
  }

  /* Compact Avatar circle on mobile header */
  .user-display-name,
  .user-dropdown-arrow {
    display: none !important;
  }

  .user-menu-btn {
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 50% !important;
    background: transparent !important;
    border: 1.5px solid #334155 !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    cursor: pointer;
  }

  .user-photo {
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .user-avatar-initial {
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 1.1rem !important;
  }

  .user-photo.hidden,
  .user-avatar-initial.hidden,
  .user-menu-btn .hidden {
    display: none !important;
  }

  .btn.small#login-open-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 999px;
  }

  /* --- Main Content Layout --- */
  main {
    padding: 12px 12px calc(72px + env(safe-area-inset-bottom, 0px));
  }

  .page-header {
    margin-bottom: 6px;
    gap: 8px;
  }

  h1 {
    font-size: 1.25rem;
    letter-spacing: -0.3px;
    margin: 0 0 2px;
    line-height: 1.25;
  }

  #subtitle {
    font-size: 0.76rem;
    line-height: 1.3;
    margin: 0;
    color: var(--muted);
  }

  .view-toggles {
    padding: 2px;
    border-radius: 8px;
  }

  .view-toggle-btn {
    padding: 4px 8px;
    font-size: 0.95rem;
    border-radius: 6px;
  }

  /* --- Mobile Filter Bar (Horizontal Momentum Scroll) --- */
  .filters {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 8px;
    padding: 4px 1px 10px;
    margin-top: 4px;
    margin-bottom: 2px;
  }

  .filters::-webkit-scrollbar {
    display: none;
  }

  .filters > * {
    flex-shrink: 0 !important;
  }

  .filter-pill {
    padding: 6px 12px;
    font-size: 0.78rem;
    height: 34px;
    border-radius: 999px;
  }

  /* Mobile Taste Pill button */
  .btn.taste-pill {
    padding: 6px 12px;
    font-size: 0.78rem;
    border-radius: 999px;
    height: 34px;
    order: -2; /* Make My Taste the first item! */
    white-space: nowrap;
  }

  .taste-indicator-dot {
    width: 7px;
    height: 7px;
  }

  .filter-clear-btn {
    padding: 6px 12px;
    font-size: 0.78rem;
    height: 34px;
    border-radius: 999px;
    white-space: nowrap;
  }

  /* On mobile, filter-sheet is a native bottom sheet */
  .filter-modal {
    align-items: flex-end !important;
  }

  .filter-sheet {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: 80vh !important;
    animation: slideUpSheet 0.22s cubic-bezier(0.2, 0, 0, 1) !important;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2) !important;
  }

  .filter-sheet-handle {
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: #cbd5e1;
    margin: 8px auto 0;
  }

  .filter-sheet-header {
    padding: 12px 18px 10px;
  }

  .filter-sheet-body {
    padding: 14px 18px;
    max-height: 56vh;
  }

  .filter-sheet-footer {
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
  }

  /* --- Movie Grid: 2-Column Mobile Optimization --- */
  .grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin-top: 8px;
  }

  .movie {
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  }

  .poster {
    aspect-ratio: 2/3;
    padding: 6px;
    border-radius: 12px 12px 0 0;
  }

  .poster .match {
    top: 5px;
    right: 5px;
    font-size: 0.65rem;
    padding: 2px 5px;
    font-weight: 700;
  }

  .info {
    padding: 8px 8px 10px;
    gap: 3px;
  }

  .info h3 {
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.1em;
  }

  .meta {
    font-size: 0.7rem;
    line-height: 1.2;
    color: #64748b;
  }

  .meta.ott-date {
    font-size: 0.73rem;
    font-weight: 700;
    color: #0284c7;
  }

  .meta.theater-date {
    display: none; /* Hide theater date on compact 2-column mobile cards to save space */
  }

  .chips {
    gap: 3px;
    margin-top: 2px;
  }

  .chip {
    font-size: 0.62rem;
    padding: 2px 5px;
  }

  .why {
    font-size: 0.65rem;
    padding: 3px 5px;
    border-radius: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .stars {
    gap: 2px;
    padding-top: 2px;
  }

  .stars button {
    font-size: 0.95rem;
    padding: 1px;
  }

  /* --- List View Mode for Mobile --- */
  .grid.list-view {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .grid.list-view .movie {
    flex-direction: row !important;
    align-items: stretch;
    min-height: 110px;
  }

  .grid.list-view .poster {
    width: 76px;
    min-width: 76px;
    max-width: 76px;
    aspect-ratio: 2/3;
    border-radius: 12px 0 0 12px;
    padding: 4px;
  }

  .grid.list-view .poster .match {
    top: 3px;
    right: 3px;
    font-size: 0.6rem;
    padding: 1px 4px;
  }

  .grid.list-view .info {
    padding: 8px 10px;
    justify-content: space-between;
    overflow: hidden;
    flex: 1;
    gap: 2px;
  }

  .grid.list-view .info h3 {
    font-size: 0.88rem;
    white-space: nowrap;
    text-overflow: ellipsis;
    min-height: auto;
  }

  .grid.list-view .meta.theater-date {
    display: block;
  }

  /* Week Headers */
  h2.week {
    font-size: 0.98rem !important;
    margin: 14px 0 4px !important;
    padding-bottom: 4px !important;
    color: #334155;
    font-weight: 700;
  }

  /* --- Native Mobile Bottom Navigation Bar --- */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04);
    z-index: 50;
    justify-content: space-around;
    align-items: center;
  }

  .bnav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px 0;
    color: #64748b;
    position: relative;
    transition: color 0.15s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .bnav-item:active {
    transform: scale(0.92);
  }

  .bnav-icon {
    font-size: 1.25rem;
    line-height: 1.2;
    transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1);
  }

  .bnav-label {
    font-size: 0.66rem;
    font-weight: 600;
    margin-top: 2px;
    letter-spacing: -0.2px;
  }

  .bnav-ai-badge {
    position: absolute;
    top: 5px;
    right: calc(50% - 20px);
    background: linear-gradient(135deg, var(--a), var(--b));
    color: #ffffff;
    font-size: 0.52rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 999px;
    line-height: 1;
  }

  .bnav-item.active {
    color: var(--a);
  }

  .bnav-item.active .bnav-icon {
    transform: translateY(-2px);
  }

  .bnav-item.active::after {
    content: '';
    position: absolute;
    bottom: calc(2px + env(safe-area-inset-bottom, 0px));
    width: 16px;
    height: 3px;
    border-radius: 2px;
    background: var(--a);
  }

  /* --- CineBot on Mobile --- */
  .chat-launcher {
    display: none !important; /* Bottom nav has CineBot tab! */
  }

  .chat-window {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-width: 100vw !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    border: none !important;
    z-index: 100 !important;
  }

  .chat-header {
    padding: 12px 14px;
  }

  .chat-messages {
    flex: 1;
    padding: 12px;
  }

  .chat-form {
    padding: 10px 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  }

  /* --- User Profile Dropdown on Mobile (anchored cleanly below header avatar) --- */
  .user-dropdown {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 0 !important;
    left: auto !important;
    bottom: auto !important;
    width: max-content !important;
    min-width: 220px !important;
    max-width: calc(100vw - 24px) !important;
    margin: 0 !important;
    border-radius: 16px !important;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.25) !important;
    z-index: 10001 !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
  }

  /* --- Modals / Setup Wizard on Mobile --- */
  .modal {
    padding: 0 !important;
    align-items: flex-end !important;
  }

  .modal .card {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: 90dvh !important;
    overflow-y: auto !important;
    padding: 18px 16px max(24px, env(safe-area-inset-bottom, 0px)) !important;
  }

  .setup-rate-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
}

/* --- Firebase Authentication & User Profile Navigation --- */
.auth-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.user-profile-menu {
  position: relative;
}

@media (min-width: 769px) {
  .user-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 3px 12px 3px 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    color: #1e293b;
  }

  .user-menu-btn:hover {
    border-color: var(--a);
    box-shadow: 0 2px 6px rgba(103, 80, 164, 0.18);
  }
}

.user-photo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.user-avatar-initial {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ede9fe;
  color: #6750a4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
}

.user-photo.hidden,
.user-avatar-initial.hidden {
  display: none !important;
}

.user-display-name {
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-arrow {
  font-size: 0.7rem;
  color: #94a3b8;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  padding: 8px;
  min-width: 230px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: chatMsgFade 0.15s ease-out;
}

.user-dropdown-header {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-dropdown-header strong {
  color: #1e293b;
  font-size: 0.92rem;
}

.dropdown-item {
  background: transparent;
  border: 0;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dropdown-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.dropdown-item.danger:hover {
  background: #fee2e2;
  color: #b91c1c;
}

/* Auth Modal Card */
.auth-card {
  max-width: 440px;
  border-radius: 24px;
  padding: 36px 32px;
  background: #ffffff;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.15);
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-header .brand {
  margin-bottom: 8px;
}

.auth-header h2 {
  margin: 10px 0 6px;
  font-size: 1.45rem;
  color: #1d1b20;
}

.auth-header p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.4;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 11px 16px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.btn-google:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.btn-google:active {
  transform: translateY(0);
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0;
  color: #94a3b8;
  font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e2e8f0;
}

.auth-divider span {
  padding: 0 12px;
}

.auth-tabs {
  display: flex;
  gap: 6px;
  background: #f1f3f9;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 18px;
}

.auth-tab {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 8px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-tab.active {
  background: #ffffff;
  color: #1d1b20;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
}

.form-group input {
  background: #f8f9fa;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.9rem;
  color: #0f172a;
  outline: none;
  transition: all 0.15s ease;
}

.form-group input:focus {
  background: #ffffff;
  border-color: var(--a);
  box-shadow: 0 0 0 3px rgba(103, 80, 164, 0.15);
}

.auth-error {
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.84rem;
  padding: 8px 12px;
  border-radius: 8px;
  margin-top: 8px;
  line-height: 1.4;
}

.setup-card {
  max-width: 680px;
  border-radius: 24px;
  padding: 32px 36px;
  background: #ffffff;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.16);
  display: flex;
  flex-direction: column;
  max-height: 88vh;
  overflow-y: auto;
}

.setup-wizard {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.setup-wizard-header {
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 16px;
}

.setup-wizard-header h2 {
  margin: 0 0 4px;
  font-size: 1.5rem;
  color: #1d1b20;
}

.setup-progress {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.setup-progress-step {
  flex: 1;
  height: 5px;
  background: #e2e8f0;
  border-radius: 4px;
  transition: background 0.25s ease;
}

.setup-progress-step.active {
  background: var(--a);
}

.setup-progress-step.done {
  background: #16a34a;
}

.avatar-upload-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 10px 0 16px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 16px;
  border: 1px dashed #cbd5e1;
}

.avatar-preview-box {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.avatar-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-upload-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.avatar-upload-btn-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  width: fit-content;
}

.avatar-upload-btn-label:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.setup-step {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.setup-step-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.setup-step-desc {
  font-size: 0.86rem;
  color: var(--muted);
  margin: -4px 0 6px;
  line-height: 1.4;
}

.setup-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}

.setup-rate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  max-height: 360px;
  overflow-y: auto;
  padding: 6px 2px;
}

.setup-rate-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow 0.2s ease;
}

.setup-rate-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.setup-rate-thumb {
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  background-color: #cbd5e1;
}

.setup-rate-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.setup-rate-stars {
  display: flex;
  gap: 4px;
}

.setup-rate-stars button {
  background: transparent;
  border: 0;
  font-size: 1.15rem;
  color: #cbd5e1;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease;
}

.setup-rate-stars button.on {
  color: #f59e0b;
}

/* ============================================================
   BEHAVIOR ANALYTICS DASHBOARD STYLING
   ============================================================ */
.analytics-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 14px;
  margin-bottom: 18px;
}
.analytics-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.analytics-close-btn {
  background: transparent;
  border: 0;
  font-size: 1.3rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
}
.analytics-close-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.analytics-kpi-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.analytics-kpi-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.03em;
}
.analytics-kpi-val {
  font-size: 1.55rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}
.analytics-kpi-sub {
  font-size: 0.78rem;
  color: #94a3b8;
}
.analytics-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  margin: 18px 0 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.analytics-table-wrap {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}
.analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.analytics-table th, .analytics-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
}
.analytics-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #475569;
}
.analytics-table tr:last-child td {
  border-bottom: 0;
}
.analytics-bar-bg {
  background: #e2e8f0;
  border-radius: 999px;
  height: 8px;
  width: 100%;
  overflow: hidden;
  margin-top: 4px;
}
.analytics-bar-fill {
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}
.analytics-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}
.analytics-badge.hover { background: #e0e7ff; color: #4338ca; }
.analytics-badge.click { background: #dcfce7; color: #15803d; }
.analytics-badge.dwell { background: #fef3c7; color: #b45309; }
.analytics-badge.rate { background: #fae8ff; color: #86198f; }
.analytics-export-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
  flex-wrap: wrap;
}


