:root {
  --blue: #185FA5;
  --blue-light: #E6F1FB;
  --blue-mid: #B5D4F4;
  --green: #0F6E56;
  --green-light: #E1F5EE;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --text-hint: #9ca3af;
  --bg: #fff;
  --bg-secondary: #f8f9fb;
  --bg-tertiary: #f0f2f5;
  --border: rgba(0,0,0,0.1);
  --border-strong: rgba(0,0,0,0.18);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --header-h: 56px;
  --bottom-nav-h: 64px;
  --transition: 0.18s ease;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #f1f1f1;
    --text-muted: #9ca3af;
    --text-hint: #6b7280;
    --bg: #111317;
    --bg-secondary: #1c1f25;
    --bg-tertiary: #252830;
    --border: rgba(255,255,255,0.1);
    --border-strong: rgba(255,255,255,0.18);
    --blue-light: #0d2d4a;
    --blue-mid: #1a4a7a;
    --green-light: #062d22;
  }
}
html[data-theme="dark"] .header-btn { color: var(--text); }
html[data-theme="dark"] .header-btn:hover { background: var(--bg-tertiary); }
html[data-theme="dark"] .detail-action-btn,
html[data-theme="dark"] .detail-back { background: rgba(40,44,54,0.92); color: var(--text); }
html[data-theme="dark"] .event-heart { background: rgba(30,34,42,0.9); border-color: rgba(255,255,255,0.12); color: #cdd5e0; }
html[data-theme="dark"] .event-heart.saved { color: #E24B4A; }
html[data-theme="dark"] .mini-heart { background: rgba(30,34,42,0.88); color: #cdd5e0; }
html[data-theme="dark"] .mini-heart.saved { color: #E24B4A; }
html[data-theme="dark"] .theme-toggle-btn { color: #cdd5e0; border-color: rgba(255,255,255,0.15); }

html[data-theme="dark"] ::-webkit-scrollbar { width: 8px; height: 8px; }
html[data-theme="dark"] ::-webkit-scrollbar-track { background: #1c1f25; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #3a3f4b; border-radius: 4px; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #4e5566; }
html[data-theme="dark"] { scrollbar-color: #3a3f4b #1c1f25; }

html[data-theme="dark"] {
  --text: #f1f1f1;
  --text-muted: #9ca3af;
  --text-hint: #6b7280;
  --bg: #111317;
  --bg-secondary: #1c1f25;
  --bg-tertiary: #252830;
  --border: rgba(255,255,255,0.1);
  --border-strong: rgba(255,255,255,0.18);
  --blue-light: #0d2d4a;
  --blue-mid: #1a4a7a;
  --green-light: #062d22;
}
html[data-theme="light"] {
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --text-hint: #9ca3af;
  --bg: #fff;
  --bg-secondary: #f8f9fb;
  --bg-tertiary: #f0f2f5;
  --border: rgba(0,0,0,0.1);
  --border-strong: rgba(0,0,0,0.18);
  --blue-light: #E6F1FB;
  --blue-mid: #B5D4F4;
  --green-light: #E1F5EE;
}

/* ===== SITE FOOTER ===== */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 28px 20px 80px;
  margin-top: 32px;
  font-size: 13px;
  color: var(--text-muted);
}
.site-footer-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.site-footer-brand {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 7px;
}
.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}
.site-footer-links a {
  color: var(--blue);
  text-decoration: none;
  font-size: 12px;
}
.site-footer-links a:hover { text-decoration: underline; }
.site-footer-legal {
  font-size: 11px;
  color: var(--text-hint);
  line-height: 1.6;
}

/* ===== THEME TOGGLE ===== */
.theme-toggle-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-secondary);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.theme-toggle-btn:hover { background: var(--bg-tertiary); color: var(--text); }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-tertiary);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; line-height: 1; }
input, select, textarea { font-family: inherit; }
i.ti {
  font-family: 'tabler-icons' !important;
  font-style: normal;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

/* Icon sizes for zero-padding circle buttons */
.event-heart, .mini-heart, .header-btn, .detail-back, .detail-action-btn { padding: 0; }
.event-heart i    { font-size: 15px; }
.mini-heart i     { font-size: 13px; }
.header-btn i     { font-size: 20px; }
.detail-back i, .detail-action-btn i { font-size: 18px; }
.filter-icon-btn i, .chip i, .social-btn i { font-size: 16px; }
.bn-item i        { font-size: 22px; }
.sidebar-nav-item i { font-size: 20px; }
.meta-item i      { font-size: 13px; }
img { max-width: 100%; display: block; }

.app-shell {
  max-width: 430px;
  margin: 0 auto;
  background: var(--bg);
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 40px rgba(0,0,0,0.12);
}

/* ---- HEADER ---- */
.app-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg);
  border-bottom: 0.5px solid var(--border);
  height: var(--header-h);
  display: flex; align-items: center;
  padding: 0 16px;
  gap: 10px;
}
.app-logo { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 18px; color: var(--blue); }
.app-logo i { font-size: 22px; }
.header-spacer { flex: 1; }
.header-btn {
  width: 36px; height: 36px;
  border: none; background: transparent;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: background var(--transition);
}
.header-btn:hover { background: var(--bg-secondary); }
.avatar-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--blue-light); color: var(--blue);
  font-size: 13px; font-weight: 600;
  border: none; display: flex; align-items: center; justify-content: center;
}
.notif-dot {
  width: 8px; height: 8px; background: #E24B4A;
  border-radius: 50%; position: absolute;
  top: 6px; right: 6px;
  border: 2px solid var(--bg);
}
.header-btn-wrap { position: relative; }

/* ---- SEARCH BAR ---- */
.search-section { padding: 10px 12px; background: var(--bg-secondary); display: flex; gap: 8px; }
.search-wrap {
  flex: 1; display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 9px 12px;
}
.search-wrap i { font-size: 16px; color: var(--text-hint); flex-shrink: 0; }
.search-wrap input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 14px; color: var(--text);
}
.search-wrap input::placeholder { color: var(--text-hint); }
.filter-icon-btn {
  background: var(--bg); border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 9px 12px;
  display: flex; align-items: center; gap: 5px;
  font-size: 13px; color: var(--text-muted);
  position: relative;
}
.filter-badge {
  position: absolute; top: -4px; right: -4px;
  width: 16px; height: 16px; background: var(--blue);
  border-radius: 50%; font-size: 10px; color: #fff;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}

/* ---- TABS ---- */
.tab-bar {
  display: flex; border-bottom: 0.5px solid var(--border);
  background: var(--bg);
  overflow-x: auto; scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-item {
  flex-shrink: 0; padding: 10px 16px;
  font-size: 13px; color: var(--text-muted);
  border-bottom: 2px solid transparent;
  background: none; border-top: none; border-left: none; border-right: none;
  white-space: nowrap;
  transition: all var(--transition);
}
.tab-item.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 500; }

/* ---- CHIPS ---- */
.chip-row {
  display: flex; gap: 6px; padding: 10px 12px;
  overflow-x: auto; scrollbar-width: none; background: transparent;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; padding: 5px 12px;
  border-radius: 20px; font-size: 12px;
  border: 0.5px solid var(--border-strong);
  background: var(--bg); color: var(--text-muted);
  white-space: nowrap;
  transition: all var(--transition);
}
.chip.active { background: var(--blue-light); border-color: var(--blue); color: var(--blue); font-weight: 500; }
.chip:hover:not(.active) { background: var(--bg-secondary); }

/* ---- WEEK STRIP ---- */
.week-strip {
  display: flex; gap: 5px; padding: 8px 12px 4px;
  overflow-x: auto; scrollbar-width: none; background: var(--bg);
}
.week-strip::-webkit-scrollbar { display: none; }
.day-pill {
  flex-shrink: 0; min-width: 44px; padding: 7px 4px;
  border-radius: var(--radius-sm); border: 0.5px solid var(--border);
  background: var(--bg); display: flex; flex-direction: column;
  align-items: center; gap: 2px;
  transition: all var(--transition);
}
.day-pill.active { background: var(--blue); border-color: var(--blue); }
.day-pill .d-name { font-size: 9px; color: var(--text-hint); text-transform: uppercase; }
.day-pill .d-num { font-size: 15px; font-weight: 500; color: var(--text); }
.day-pill .d-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--blue); }
.day-pill.active .d-name, .day-pill.active .d-num { color: #fff; }
.day-pill.active .d-dot { background: #fff; }
.day-pill.has-events .d-name { color: var(--blue); }

/* ---- SCROLL CONTENT ---- */
.scroll-content {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding-bottom: calc(var(--bottom-nav-h) + 16px);
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
  contain: layout style;
}

/* ---- SECTION HEAD ---- */
.section-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 14px 6px;
}
.section-title { font-size: 14px; font-weight: 600; color: var(--text); }
.see-all { font-size: 12px; color: var(--blue); }

/* ---- EVENT CARDS ---- */
.event-card {
  margin: 0 12px 12px;
  background: var(--bg); border: 0.5px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden;
  cursor: pointer; transition: box-shadow var(--transition);
  box-shadow: var(--shadow-sm);
  contain: layout style;
}
.event-card:active { transform: scale(0.99); }
.event-img {
  height: 140px; position: relative;
  display: flex; align-items: center; justify-content: center;
}
.event-img > i { font-size: 48px; opacity: 0.7; }
.event-img-badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 5px; }
.badge {
  padding: 3px 8px; border-radius: 10px; font-size: 10px; font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-blue { background: var(--blue); color: #fff; }
.badge-green { background: var(--green); color: #fff; }
.badge-amber { background: #FAC775; color: #633806; }
.badge-red { background: #E24B4A; color: #fff; }
.event-heart {
  position: relative;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg); border: 0.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition); z-index: 2;
  margin: 0; flex-shrink: 0;
}
.event-heart.saved { color: #E24B4A; }
.event-body { padding: 12px 14px; }
.event-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 6px; line-height: 1.3; }
.event-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.meta-item { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-muted); }
.meta-item.green { color: var(--green); }
.meta-item.urgent { color: #E24B4A; }
.event-desc-preview { font-size: 12px; color: var(--text-muted); margin-top: 6px; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.open-badge { font-size: 10px; font-weight: 700; color: #16A34A; background: #DCFCE7; padding: 1px 6px; border-radius: 8px; margin-left: 4px; }
.closed-badge { font-size: 10px; font-weight: 700; color: #DC2626; background: #FEF2F2; padding: 1px 6px; border-radius: 8px; margin-left: 4px; }
.time-filter-row { display: flex; align-items: center; gap: 8px; padding: 6px 16px; overflow-x: auto; }
.time-chip { font-size: 12px; font-weight: 600; padding: 6px 14px; border-radius: 20px; border: 1.5px solid var(--border); background: var(--bg); color: var(--text-muted); cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.time-chip.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.time-input { font-size: 12px; padding: 5px 10px; border-radius: 20px; border: 1.5px solid var(--border); background: var(--bg); color: var(--text); cursor: pointer; }

/* ---- SKELETON LOADING ---- */
.skeleton-card { margin: 0 12px 12px; background: var(--bg); border: 0.5px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.skeleton-img { height: 140px; background: var(--bg-tertiary); }
.skeleton-body { padding: 12px 14px; }
.skeleton-line { height: 12px; background: var(--bg-tertiary); border-radius: 6px; margin-bottom: 8px; animation: skeleton-pulse 1.5s ease-in-out infinite; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w40 { width: 40%; }
@keyframes skeleton-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ---- IMAGE GRADIENT OVERLAY ---- */
.event-img::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 50px; background: linear-gradient(180deg, rgba(0,0,0,0.35) 0%, transparent 100%); pointer-events: none; z-index: 1; }
.event-img-badges, .event-heart, .event-img > div[style*="position:absolute"] { z-index: 2; }

/* ---- DISTANCE INDICATOR ---- */
.dist-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 3px; vertical-align: middle; }
.dist-dot.near { background: #16A34A; }
.dist-dot.mid { background: #EAB308; }
.dist-dot.far { background: #E24B4A; }

/* ---- MINI CARDS ---- */
.mini-scroll { display: flex; gap: 8px; padding: 4px 12px; overflow-x: auto; scrollbar-width: none; }
.mini-scroll::-webkit-scrollbar { display: none; }
.mini-card {
  flex-shrink: 0; width: 140px; background: var(--bg);
  border: 0.5px solid var(--border); border-radius: var(--radius-md);
  overflow: hidden; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.mini-card:active { transform: scale(0.98); }
.mini-img {
  height: 78px; display: flex; align-items: center;
  justify-content: center; position: relative;
}
.mini-img > i { font-size: 28px; opacity: 0.8; }
.mini-body { padding: 8px 10px; }
.mini-title { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 3px; line-height: 1.3; }
.mini-sub { font-size: 10px; color: var(--text-muted); }
.mini-heart {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px;
  border-radius: 50%; background: rgba(255,255,255,0.85);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  margin: 0; border: none;
}
.mini-heart.saved { color: #E24B4A; }

/* ---- BOTTOM NAV ---- */
.bottom-nav {
  position: sticky; bottom: 0; z-index: 100;
  display: flex; background: var(--bg);
  border-top: 0.5px solid var(--border);
  height: var(--bottom-nav-h);
  padding-bottom: env(safe-area-inset-bottom);
}
.bn-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  border: none; background: transparent;
  color: var(--text-muted);
  padding: 6px 0;
  transition: color var(--transition);
}
.bn-item span { font-size: 9px; font-weight: 500; }
.bn-item.active { color: var(--blue); }
.bn-item .bn-dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--blue); margin-top: 1px;
}

/* ---- SCREENS ---- */
.screen { display: none; flex: 1; flex-direction: column; content-visibility: auto; }
.screen.active { display: flex; content-visibility: visible; }

/* ---- FILTER PANEL ---- */
.filter-panel { flex: 1; overflow-y: auto; }
.filter-section { padding: 14px; border-bottom: 0.5px solid var(--border); }
.filter-label {
  font-size: 12px; font-weight: 600; color: var(--text);
  margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.filter-label i { font-size: 14px; color: var(--blue); }
.canton-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.canton-chip {
  padding: 7px 4px; border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-sm); font-size: 10px; text-align: center;
  color: var(--text-muted); background: var(--bg);
  transition: all var(--transition);
}
.canton-chip.sel { background: var(--blue-light); border-color: var(--blue); color: var(--blue); font-weight: 600; }
.dist-row { display: flex; align-items: center; gap: 12px; }
.dist-val { font-size: 14px; font-weight: 600; color: var(--blue); min-width: 56px; }
input[type=range] {
  flex: 1; appearance: none; height: 4px;
  background: var(--border-strong); border-radius: 2px; outline: none;
}
input[type=range]::-webkit-slider-thumb {
  appearance: none; width: 20px; height: 20px;
  border-radius: 50%; background: var(--blue);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.toggle-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; }
.toggle-label { font-size: 13px; color: var(--text); }
.toggle {
  width: 40px; height: 22px; background: var(--blue);
  border-radius: 11px; position: relative; cursor: pointer;
  transition: background var(--transition);
}
.toggle.off { background: var(--border-strong); }
.toggle-dot {
  width: 18px; height: 18px; background: #fff;
  border-radius: 50%; position: absolute; top: 2px; left: 20px;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  will-change: transform;
}
.toggle.off .toggle-dot { transform: translateX(-18px); }
.apply-btn {
  margin: 14px; width: calc(100% - 28px);
  padding: 14px; background: var(--blue); color: #fff;
  border: none; border-radius: var(--radius-md);
  font-size: 15px; font-weight: 600;
  transition: opacity var(--transition);
}
.apply-btn:active { opacity: 0.85; }

/* ---- DETAIL SCREEN ---- */
.detail-img {
  height: 200px; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.detail-img > i { font-size: 72px; opacity: 0.6; }
.detail-back {
  position: absolute; top: 12px; left: 12px;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.9); border: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
}
.detail-actions {
  position: absolute; top: 12px; right: 12px;
  display: flex; gap: 8px;
}
.detail-action-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.9); border: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
}
.detail-action-btn.saved { color: #E24B4A; }
.detail-body { padding: 16px; flex: 1; overflow-y: auto; padding-bottom: 80px; }
.detail-title { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 8px; line-height: 1.3; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 14px; }
.tag-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tag { font-size: 10px; padding: 3px 8px; border-radius: 10px; background: var(--blue-light); color: var(--blue); }
.organiser-card {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  background: var(--bg-secondary); border-radius: var(--radius-md); margin-bottom: 14px;
}
.org-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--blue-light); display: flex; align-items: center;
  justify-content: center; font-size: 13px; font-weight: 700; color: var(--blue);
  flex-shrink: 0;
}
.org-follow {
  margin-left: auto; font-size: 11px; padding: 5px 10px;
  border: 0.5px solid var(--blue); color: var(--blue); background: transparent;
  border-radius: 20px; white-space: nowrap;
}
.detail-desc { font-size: 13px; color: var(--text-muted); line-height: 1.7; margin-bottom: 14px; }
.info-row { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.info-row i { font-size: 16px; color: var(--blue); flex-shrink: 0; margin-top: 1px; }
.info-row span { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.detail-cta {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px;
  display: flex; gap: 10px; padding: 12px 14px;
  background: var(--bg); border-top: 0.5px solid var(--border);
  z-index: 50;
}
.btn-outline-blue {
  flex: 1; padding: 13px; border: 0.5px solid var(--blue);
  color: var(--blue); background: transparent;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
}
.btn-primary-blue {
  flex: 2; padding: 13px; background: var(--blue); color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
}

/* ---- ONBOARDING ---- */
.onboard-wrap { flex: 1; overflow-y: auto; padding: 0 16px 24px; }
.progress-bar { height: 3px; background: var(--border); margin: 0 16px; border-radius: 2px; }
.progress-fill { height: 100%; background: var(--blue); border-radius: 2px; transition: width 0.3s; }
.step-label { font-size: 11px; color: var(--text-muted); text-align: center; padding: 8px 0 12px; }
.form-group { margin-bottom: 14px; }
.form-label { font-size: 11px; color: var(--text-muted); font-weight: 600; margin-bottom: 5px; display: block; text-transform: uppercase; letter-spacing: 0.04em; }
.form-input {
  width: 100%; padding: 11px 12px;
  border: 0.5px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text); background: var(--bg); outline: none;
  transition: border-color var(--transition);
}
.form-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(24,95,165,0.1); }
.select-wrap { position: relative; }
.select-wrap select { width: 100%; appearance: none; }
.select-wrap i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--text-muted); font-size: 16px; }
.social-row { display: flex; gap: 10px; margin-bottom: 12px; }
.social-btn {
  flex: 1; padding: 11px; border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-sm); font-size: 13px; color: var(--text-muted);
  background: var(--bg); display: flex; align-items: center; justify-content: center; gap: 8px;
}
.divider-line { text-align: center; font-size: 11px; color: var(--text-hint); position: relative; margin: 12px 0; }
.divider-line::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 0.5px; background: var(--border); }
.divider-line span { background: var(--bg); padding: 0 10px; position: relative; }
.terms-row { display: flex; gap: 10px; margin-bottom: 14px; align-items: flex-start; }
.terms-row input[type=checkbox] { margin-top: 2px; flex-shrink: 0; }
.terms-row label { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.terms-row a { color: var(--blue); }
.sign-in-link { text-align: center; margin-top: 12px; font-size: 13px; color: var(--text-muted); }
.sign-in-link a { color: var(--blue); font-weight: 500; cursor: pointer; }
.pref-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.pref-card {
  padding: 12px 10px; border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-md); text-align: center; cursor: pointer; background: var(--bg);
  transition: all var(--transition);
}
.pref-card.sel { border-color: var(--blue); background: var(--blue-light); }
.pref-card i { font-size: 24px; color: var(--text-muted); margin-bottom: 5px; display: block; }
.pref-card.sel i { color: var(--blue); }
.pref-card span { font-size: 11px; color: var(--text-muted); line-height: 1.3; }
.pref-card.sel span { color: var(--blue); font-weight: 500; }
.genre-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 14px; }
.genre-chip {
  padding: 8px 4px; border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-sm); font-size: 11px; text-align: center;
  cursor: pointer; color: var(--text-muted); background: var(--bg);
  transition: all var(--transition);
}
.genre-chip.sel { background: var(--blue-light); border-color: var(--blue); color: var(--blue); font-weight: 500; }
.exclusion-note {
  font-size: 11px; color: var(--text-hint); background: var(--bg-secondary);
  padding: 8px 12px; border-radius: var(--radius-sm); margin-bottom: 14px;
  line-height: 1.5;
}
.exclusion-note strong { color: #E24B4A; }

/* ---- SAVED SCREEN ---- */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 24px; gap: 12px; flex: 1;
}
.empty-state i { font-size: 48px; color: var(--border-strong); }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--text); }
.empty-state p { font-size: 13px; color: var(--text-muted); text-align: center; line-height: 1.6; }

/* ---- ACCOUNT SCREEN ---- */
.account-header {
  display: flex; flex-direction: column; align-items: center;
  padding: 24px 16px 16px; border-bottom: 0.5px solid var(--border);
}
.account-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--blue-light); display: flex; align-items: center;
  justify-content: center; font-size: 26px; font-weight: 700; color: var(--blue);
  margin-bottom: 12px;
}
.account-name { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.account-email { font-size: 13px; color: var(--text-muted); }
.account-menu { flex: 1; overflow-y: auto; }
.menu-section-title { padding: 14px 16px 6px; font-size: 11px; font-weight: 700; color: var(--text-hint); text-transform: uppercase; letter-spacing: 0.06em; }
.menu-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-bottom: 0.5px solid var(--border);
  transition: background var(--transition);
}
.menu-item:hover { background: var(--bg-secondary); }
.menu-item i { font-size: 20px; color: var(--blue); }
.menu-item-text { flex: 1; }
.menu-item-text span { font-size: 14px; color: var(--text); }
.menu-item-text small { display: block; font-size: 11px; color: var(--text-muted); }
.menu-item .ti-chevron-right { font-size: 16px; color: var(--text-hint); }
.logout-btn {
  margin: 16px; width: calc(100% - 32px); padding: 13px;
  border: 0.5px solid #E24B4A; color: #E24B4A; background: transparent;
  border-radius: var(--radius-md); font-size: 14px; font-weight: 600;
}

/* ---- TOAST ---- */
.toast {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%) translateY(-10px);
  background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 20px; font-size: 13px; font-weight: 500;
  z-index: 9999; pointer-events: none;
  opacity: 0; transition: opacity 0.25s, transform 0.25s;
  white-space: nowrap; max-width: 90vw;
  display: flex; align-items: center; gap: 8px;
  will-change: transform, opacity;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast i { font-size: 16px; }

/* ---- NOTIFICATION PERMISSION BANNER ---- */
.notif-banner {
  background: var(--blue-light); border: 0.5px solid var(--blue-mid);
  padding: 12px 14px; margin: 10px 12px;
  border-radius: var(--radius-md); display: flex; gap: 10px; align-items: flex-start;
}
.notif-banner i { font-size: 20px; color: var(--blue); flex-shrink: 0; margin-top: 1px; }
.notif-banner-text p { font-size: 12px; color: var(--text); line-height: 1.5; margin-bottom: 8px; }
.notif-banner-btns { display: flex; gap: 8px; }
.btn-notif-allow {
  padding: 6px 14px; background: var(--blue); color: #fff;
  border: none; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.btn-notif-dismiss {
  padding: 6px 14px; background: transparent; color: var(--text-muted);
  border: 0.5px solid var(--border-strong); border-radius: 20px; font-size: 12px;
}

/* ---- EXCLUDED BADGE ---- */
.excluded-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
}
.excluded-badge {
  background: rgba(0,0,0,0.75); color: #fff; font-size: 10px;
  padding: 4px 10px; border-radius: 10px; font-weight: 600;
}

/* ---- SCREEN HEADER TITLE ---- */
.app-header span[style] { color: var(--text); }

/* ---- NIGHTLIFE THEME ---- */
html[data-nightlife="true"] { --bg: #0D0A1A; --bg-secondary: #15112A; --bg-tertiary: #1C1735; --border: rgba(124,92,255,0.15); --border-strong: rgba(124,92,255,0.25); --blue: #7C5CFF; --blue-light: #1A1040; --blue-mid: #2D1F6B; --text: #E8E0FF; --text-muted: #9B8EC4; --text-hint: #6B5F8A; }
html[data-nightlife="true"] .event-card { box-shadow: 0 2px 12px rgba(124,92,255,0.08); }
html[data-nightlife="true"] .app-header { background: #0D0A1A; border-color: rgba(124,92,255,0.15); }
html[data-nightlife="true"] .bottom-nav { background: #0D0A1A; border-color: rgba(124,92,255,0.15); }

/* ---- MODAL TRANSITION ---- */
#screen-detail, #screen-biz-profile { transition: opacity 0.2s ease; }
.detail-modal-card { transition: transform 0.2s ease, opacity 0.2s ease; }

/* ---- UTILITY ---- */
.hidden { display: none !important; }
.text-blue { color: var(--blue); }
.text-green { color: var(--green); }
.text-red { color: #E24B4A; }
.fw-600 { font-weight: 600; }

/* ---- Mobile small screens ---- */
@media (max-width: 430px) {
  .app-shell { box-shadow: none; max-width: 100%; }
  .event-img { height: 120px; }
}

/* ---- Tablet (600–767px) — 2-col card grid ---- */
@media (min-width: 600px) and (max-width: 767px) {
  .app-shell { max-width: 100%; }
  #featured-events, #weekend-events {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 0 12px;
  }
  #featured-events .event-card, #weekend-events .event-card { margin: 0; }
}

/* ============================================================
   DESKTOP LAYOUT (768px+)
   ============================================================ */
@media (min-width: 768px) {
  body { overflow: hidden; }

  .app-shell {
    max-width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: grid;
    grid-template-rows: var(--header-h) 1fr;
    grid-template-columns: 240px 1fr 300px;
    grid-template-areas:
      "sbar-head  top-head  top-head"
      "sidebar    main      panel";
    box-shadow: none;
  }

  .app-header {
    grid-area: top-head;
    border-left: 0.5px solid var(--border);
    padding: 0 20px;
    position: relative;
  }

  .bottom-nav { display: none; }

  /* Mobile-only elements hidden on desktop */
  .search-section,
  #screen-home .tab-bar,
  #screen-home .chip-row,
  #screen-home .time-filter-row,
  #screen-home .week-strip,
  #screen-home .scroll-content,
  #screen-home .notif-banner { display: none !important; }
  #screen-home { display: contents; }

  /* ---- SIDEBAR HEADER ---- */
  .desktop-sidebar-header {
    grid-area: sbar-head;
    background: var(--bg);
    border-right: 0.5px solid var(--border);
    border-bottom: 0.5px solid var(--border);
    display: flex !important;
    align-items: center;
    padding: 0 20px;
  }
  .sidebar-logo { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; color: var(--blue); }
  .sidebar-logo i { font-size: 22px; }

  /* ---- SIDEBAR ---- */
  .desktop-sidebar {
    grid-area: sidebar;
    background: var(--bg);
    border-right: 0.5px solid var(--border);
    display: flex !important;
    flex-direction: column;
    overflow-y: auto;
    padding-bottom: 24px;
  }
  .sidebar-nav { padding: 8px 0; }
  .sidebar-nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 20px; font-size: 14px; color: var(--text-muted);
    border: none; background: none; width: 100%;
    text-align: left;
    transition: background var(--transition), color var(--transition);
  }
  .sidebar-nav-item:hover { background: var(--bg-secondary); color: var(--text); }
  .sidebar-nav-item.active { color: var(--blue); background: var(--blue-light); font-weight: 500; }
  .sidebar-section-label {
    font-size: 10px; font-weight: 700; color: var(--text-hint);
    text-transform: uppercase; letter-spacing: 0.08em;
    padding: 14px 20px 4px;
  }
  .sidebar-canton-list { padding: 0 12px; }
  .sidebar-canton-btn {
    display: flex; align-items: center; justify-content: space-between;
    padding: 7px 10px; border-radius: var(--radius-sm);
    font-size: 12px; color: var(--text-muted);
    border: none; background: none; width: 100%;
    transition: background var(--transition);
  }
  .sidebar-canton-btn:hover { background: var(--bg-secondary); color: var(--text); }
  .sidebar-canton-btn.active { background: var(--blue-light); color: var(--blue); font-weight: 500; }
  .sidebar-canton-count {
    font-size: 10px; background: var(--bg-tertiary); color: var(--text-hint);
    padding: 1px 6px; border-radius: 10px;
  }

  /* ---- MAIN AREA ---- */
  .desktop-main {
    grid-area: main;
    background: var(--bg-tertiary);
    overflow-y: auto;
    padding: 20px;
    display: flex !important;
    flex-direction: column;
    gap: 20px;
  }

  /* ---- DESKTOP SEARCH ---- */
  .desktop-search {
    flex: 1; max-width: 420px;
    display: flex !important;
    align-items: center; gap: 8px;
    background: var(--bg-secondary); border: 0.5px solid var(--border-strong);
    border-radius: var(--radius-sm); padding: 8px 14px;
    margin: 0 auto;
  }
  .desktop-search i { font-size: 16px; color: var(--text-hint); }
  .desktop-search input {
    flex: 1; border: none; outline: none; background: transparent;
    font-size: 14px; color: var(--text);
  }

  /* ---- DESKTOP EVENT GRID ---- */
  .desktop-event-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .desktop-event-grid .event-card { margin: 0; }
  .desktop-event-grid .event-img { height: 170px; }

  /* ---- RIGHT PANEL ---- */
  .desktop-panel {
    grid-area: panel;
    background: var(--bg);
    border-left: 0.5px solid var(--border);
    overflow-y: auto;
    padding: 16px;
    display: flex !important;
    flex-direction: column;
    gap: 4px;
    contain: layout style;
  }
  .panel-section { margin-bottom: 16px; }
  .panel-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
  .panel-mini-card {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-radius: var(--radius-md);
    background: var(--bg-secondary); margin-bottom: 7px;
    cursor: pointer; transition: background var(--transition);
  }
  .panel-mini-card:hover { background: var(--bg-tertiary); }
  .panel-mini-icon {
    width: 38px; height: 38px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0; overflow: hidden;
  }
  .panel-mini-icon img { width: 100%; height: 100%; object-fit: cover; }
  .panel-mini-title { font-size: 11px; font-weight: 600; color: var(--text); margin-bottom: 2px; line-height: 1.3; }
  .panel-mini-sub { font-size: 10px; color: var(--text-muted); }
  .panel-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .panel-stat { background: var(--bg-secondary); border-radius: var(--radius-sm); padding: 10px; text-align: center; }
  .panel-stat-num { font-size: 20px; font-weight: 700; color: var(--blue); }
  .panel-stat-label { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

  /* ---- DETAIL — modal overlay ---- */
  #screen-detail, #screen-biz-profile {
    position: fixed; inset: 0; z-index: 500;
    background: rgba(0,0,0,0.55);
    display: none; align-items: center; justify-content: center;
  }
  #screen-detail.active, #screen-biz-profile.active { display: flex !important; }
  #biz-profile-content {
    background: var(--bg);
    border-radius: var(--radius-lg);
    width: 100%; max-width: 580px; max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,0.25);
    padding-bottom: 0 !important;
  }
  #detail-content {
    background: var(--bg);
    border-radius: var(--radius-lg);
    width: 100%; max-width: 580px; max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,0.25);
  }
  .detail-cta { position: sticky; bottom: 0; left: 0; right: 0; max-width: 100%; transform: none; }

  /* ---- FILTERS — slide-in drawer ---- */
  #screen-filters {
    position: fixed; inset: 0; z-index: 500;
    background: rgba(0,0,0,0.4);
    display: none; align-items: flex-start; justify-content: flex-end;
    flex-direction: row; overflow: hidden;
    will-change: transform;
  }
  #screen-filters.active { display: flex !important; }
  #screen-filters > .app-header,
  #screen-filters > .filter-panel,
  #screen-filters > .apply-btn { max-width: 380px; width: 380px; }
  #screen-filters .app-header { position: relative; border-radius: 0; height: var(--header-h); flex-shrink: 0; }
  #screen-filters::before { content: ''; flex: 1; }
  #screen-filters > * { background: var(--bg); }

  /* ---- MODALS — onboard / prefs / saved / account / events ---- */
  #screen-onboard, #screen-prefs,
  #screen-saved, #screen-account, #screen-events {
    position: fixed; inset: 0; z-index: 500;
    background: rgba(0,0,0,0.45);
    display: none; align-items: center; justify-content: center;
  }
  #screen-onboard.active, #screen-prefs.active,
  #screen-saved.active, #screen-account.active,
  #screen-events.active { display: flex !important; }

  #screen-onboard, #screen-prefs { flex-direction: column; }
  #screen-onboard .app-header, #screen-prefs .app-header { display: none; }
  #screen-onboard .progress-bar { margin: 0 0 8px; border-radius: var(--radius-sm); }
  #screen-onboard .onboard-wrap,
  #screen-prefs .onboard-wrap {
    background: var(--bg); border-radius: var(--radius-lg);
    max-width: 480px; width: 100%; max-height: 86vh;
    overflow-y: auto; padding: 28px 24px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.2);
  }

  #screen-saved > div,
  #screen-account > div,
  #screen-events > div {
    background: var(--bg); border-radius: var(--radius-lg);
    max-width: 600px; width: 100%; max-height: 86vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,0.2);
  }

  .notif-banner { margin: 0 0 4px; }

  /* Tabs + chips in desktop main */
  .tab-bar { background: transparent; border: none; padding: 0; gap: 8px; display: flex; }
  .tab-item { padding: 8px 16px; border-radius: 20px; border: 0.5px solid var(--border-strong); background: var(--bg); font-size: 13px; }
  .tab-item.active { background: var(--blue); color: #fff; border-color: var(--blue); }
}

/* ---- Large desktop (1200px+) ---- */
@media (min-width: 1200px) {
  .app-shell { grid-template-columns: 260px 1fr 320px; }
  .desktop-event-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .desktop-event-grid .event-img { height: 150px; }
}

/* ---- Extra large (1600px+) ---- */
@media (min-width: 1600px) {
  .app-shell { grid-template-columns: 280px 1fr 360px; }
}

/* ===== IMAGE UPLOAD ===== */
.img-upload-wrap { display: flex; flex-direction: column; gap: 8px; }
.img-drop-zone {
  border: 2px dashed var(--border); border-radius: var(--radius-md);
  padding: 22px 16px; text-align: center; cursor: pointer;
  transition: all 0.15s; background: #F8FAFD; position: relative;
}
.img-drop-zone:hover, .img-drop-zone.drag-over { border-color: var(--blue); background: #EBF4FF; }
.img-drop-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.img-drop-zone i { font-size: 30px; color: var(--text-muted); display: block; margin-bottom: 8px; pointer-events: none; }
.img-drop-zone p { font-size: 13px; color: var(--text-muted); pointer-events: none; line-height: 1.5; }
.img-drop-zone p strong { color: var(--blue); }
.img-preview-wrap { display: none; position: relative; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border); }
.img-preview-wrap img { width: 100%; height: 180px; object-fit: cover; display: block; }
.img-remove-btn { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,0.6); color: #fff; border: none; border-radius: 6px; padding: 5px 12px; font-size: 12px; cursor: pointer; font-family: inherit; display: flex; align-items: center; gap: 5px; }
.img-or-divider { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.img-or-divider::before, .img-or-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ===== DATE-GROUPED FEED ===== */
.date-group { margin-bottom: 4px; }
.date-group-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 6px; position: sticky; top: 0; background: var(--bg); z-index: 2; border-bottom: 1px solid var(--border); margin-bottom: 2px; }
.date-group-label { font-size: 15px; font-weight: 700; color: var(--text); }
.date-group-label.today { color: var(--blue); }
.date-group-label.tomorrow { color: #059669; }
.date-group-count { font-size: 12px; color: var(--text-muted); background: var(--bg-secondary); padding: 2px 8px; border-radius: 10px; }

/* ===== LANGUAGE SWITCHER ===== */
.lang-btn { background: var(--bg); border: 1px solid var(--border); border-radius: 20px; padding: 6px 14px; font-size: 13px; cursor: pointer; font-family: inherit; color: var(--text); transition: all 0.15s; }
.lang-btn:hover { border-color: var(--primary); color: var(--primary); }
.lang-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }

/* ===== BIZ PROFILE SCREEN ===== */
.biz-profile-hero { position: relative; background: linear-gradient(135deg, var(--primary) 0%, #6d28d9 100%); padding: 24px 16px 20px; color: #fff; }
.biz-profile-back { background: rgba(255,255,255,0.2); border: none; color: #fff; border-radius: 10px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 18px; margin-bottom: 14px; }
.biz-profile-logo { width: 72px; height: 72px; border-radius: 16px; background: rgba(255,255,255,0.2); object-fit: cover; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 700; color: #fff; margin-bottom: 10px; }
.biz-profile-logo img { width: 100%; height: 100%; border-radius: 16px; object-fit: cover; }
.biz-profile-name { font-size: 22px; font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.biz-verified-badge { background: rgba(255,255,255,0.25); border-radius: 20px; padding: 2px 10px; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.biz-profile-meta { font-size: 13px; opacity: 0.85; margin-top: 2px; }
.biz-profile-body { padding: 16px; }
.biz-info-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.biz-info-row i { font-size: 16px; color: var(--primary); flex-shrink: 0; }
.biz-info-row a { color: var(--primary); text-decoration: none; }
.biz-events-section { margin-top: 4px; }
.biz-events-title { font-size: 15px; font-weight: 700; color: var(--text); padding: 12px 0 8px; border-top: 1px solid var(--border); margin-top: 12px; }
