/**
 * Explorer shell — main index page.
 * Supports: collapsible sidebar, auth-gated menu, accordion right panel.
 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f3;
  --bg-tertiary: #ededea;
  --text-primary: #1a1a18;
  --text-secondary: #5c5c58;
  --text-tertiary: #9c9c96;
  --border: rgba(0,0,0,0.1);
  --border-strong: rgba(0,0,0,0.18);
  --blue: #185FA5;
  --blue-light: #EFF6FF;
  --blue-mid: #B5D4F4;
  --green: #0F6E56;
  --green-light: #E1F5EE;
  --coral: #993C1D;
  --coral-light: #FAECE7;
  --amber: #BA7517;
  --amber-light: #FAEEDA;
  --radius-sm: 7px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.07);
  --shadow-md: 0 2px 12px rgba(0,0,0,0.09);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.12);
  --sidebar-w: 258px;
  --sidebar-collapsed-w: 56px;
  --sidebar-transition: 0.26s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: 'DM Sans', sans-serif;
  --font-display: 'Playfair Display', serif;
  --z-modal: 10000;
  --z-user-menu: 10050;
  --z-tooltip: 9000;
}

html, body { height: 100%; }
body.shell-explorer { overflow: hidden; }
body.shell-page { overflow: hidden; }
body { font-family: var(--font-sans); background: var(--bg-secondary); color: var(--text-primary); font-size: 14px; line-height: 1.5; }

/* ── APP SHELL ── */
.app { display: flex; height: 100vh; overflow: hidden; }

/* ══════════════════════════════════════
   SIDEBAR
══════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-primary);
  border-right: 0.5px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
  transition: width var(--sidebar-transition), min-width var(--sidebar-transition);
}

/* ── Collapsed state ── */
.sidebar.collapsed {
  width: var(--sidebar-collapsed-w);
  min-width: var(--sidebar-collapsed-w);
  overflow: visible;
}

/* ── Header ── */
.sidebar-header {
  padding: 18px 16px 14px;
  border-bottom: 0.5px solid var(--border);
  flex-shrink: 0;
}
.sidebar.collapsed .sidebar-header {
  padding: 14px 8px;
}

/* ── Brand ── */
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
}
.sidebar.collapsed .brand {
  justify-content: center;
  margin-bottom: 0;
}

.brand-icon {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--blue);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}
.brand-icon:hover {
  background: #1568b8;
  box-shadow: 0 0 0 4px rgba(24,95,165,0.15);
  transform: scale(1.06);
}
.brand-icon:active { transform: scale(0.95); }
.brand-icon svg { width: 16px; height: 16px; fill: white; }
.brand-name {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--sidebar-transition), max-width var(--sidebar-transition);
  max-width: 160px;
  opacity: 1;
}
.sidebar.collapsed .brand-name {
  max-width: 0;
  opacity: 0;
  pointer-events: none;
}

/* ── CT branded nav toggle (topbar) ── */
.ct-nav-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px 7px 9px;
  background: var(--blue);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(24,95,165,0.3), 0 3px 10px rgba(24,95,165,0.15);
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}
.ct-nav-btn:hover {
  background: #1568b8;
  box-shadow: 0 2px 6px rgba(24,95,165,0.4), 0 5px 16px rgba(24,95,165,0.2);
  transform: scale(1.03);
}
.ct-nav-btn:active { transform: scale(0.96); }

.ct-nav-pin {
  width: 15px;
  height: 15px;
  fill: white;
  flex-shrink: 0;
}

.ct-nav-lines {
  display: flex;
  flex-direction: column;
  gap: 3.5px;
}
.ct-nav-lines span {
  display: block;
  height: 1.5px;
  background: rgba(255,255,255,0.88);
  border-radius: 1px;
  transition: width 0.22s ease;
}
.ct-nav-lines span:nth-child(1) { width: 12px; }
.ct-nav-lines span:nth-child(2) { width: 7px; }
.ct-nav-lines span:nth-child(3) { width: 12px; }

/* When sidebar is open — middle line extends to full width */
.ct-nav-btn.open .ct-nav-lines span:nth-child(2) { width: 12px; }

/* ── Search ── */
.search-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-secondary);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 11px;
  transition: border-color 0.15s, box-shadow 0.15s, opacity var(--sidebar-transition), max-height var(--sidebar-transition);
  overflow: hidden;
  max-height: 44px;
  opacity: 1;
}
.search-wrap:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(24,95,165,0.1); }
.search-wrap svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--text-tertiary); }
.search-wrap input {
  background: none; border: none; outline: none;
  font-size: 13px; font-family: var(--font-sans);
  color: var(--text-primary); width: 100%;
}
.search-wrap input::placeholder { color: var(--text-tertiary); }
.sidebar.collapsed .search-wrap {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
  border: none;
}

/* ── Scroll area ── */
.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: visible;
  scrollbar-width: none;
  padding-bottom: 8px;
}
.sidebar-scroll::-webkit-scrollbar { display: none; }
.sidebar.collapsed .sidebar-scroll { overflow-x: visible; }

/* ── Nav sections ── */
.nav-section { padding: 14px 16px 0; }
.sidebar.collapsed .nav-section { padding: 14px 8px 0; }

.nav-label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--text-tertiary);
  margin-bottom: 5px;
  overflow: hidden;
  transition: opacity var(--sidebar-transition), max-height var(--sidebar-transition);
  max-height: 20px;
  opacity: 1;
}
.sidebar.collapsed .nav-label {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
  pointer-events: none;
}

/* ── Nav buttons ── */
.nav-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 10px;
  border-radius: var(--radius-md);
  border: none; background: none; cursor: pointer;
  font-size: 13px; font-family: var(--font-sans);
  color: var(--text-secondary); text-align: left;
  transition: background 0.13s, color 0.13s, padding 0.13s, justify-content 0.13s;
  margin-bottom: 1px;
  position: relative;
}
.nav-btn:hover { background: var(--bg-secondary); color: var(--text-primary); }
.nav-btn.active { background: var(--blue-light); color: var(--blue); }

.sidebar.collapsed .nav-btn {
  justify-content: center;
  padding: 8px 0;
  gap: 0;
}

.nav-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
  background: var(--bg-secondary);
  transition: background 0.13s;
}
.nav-btn.active .nav-icon { background: var(--blue); }

.nav-text {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity var(--sidebar-transition), max-width var(--sidebar-transition);
  opacity: 1;
  max-width: 160px;
}
.sidebar.collapsed .nav-text {
  opacity: 0;
  max-width: 0;
  pointer-events: none;
}

.nav-badge {
  margin-left: auto;
  font-size: 10px; font-weight: 500;
  background: var(--bg-secondary);
  color: var(--text-tertiary);
  border-radius: 10px; padding: 2px 7px;
  transition: opacity var(--sidebar-transition);
}
.nav-btn.active .nav-badge { background: var(--blue-mid); color: var(--blue); }
.badge-live { background: #EAF3DE !important; color: #3B6D11 !important; }
.sidebar.collapsed .nav-badge {
  display: none;
}

.nav-lock {
  font-size: 11px;
  margin-left: auto;
  opacity: 0.6;
  transition: opacity var(--sidebar-transition);
}
.sidebar.collapsed .nav-lock { display: none; }

/* ── Floating tooltip (JS-injected) ── */
.sidebar-tooltip {
  position: fixed;
  background: var(--text-primary);
  color: #fff;
  font-size: 12px;
  font-family: var(--font-sans);
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 7px;
  white-space: nowrap;
  pointer-events: none;
  z-index: var(--z-tooltip);
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
  animation: tipFadeIn 0.12s ease forwards;
}
@keyframes tipFadeIn { from { opacity: 0; transform: translateX(-4px); } to { opacity: 1; transform: translateX(0); } }

/* ── Footer ── */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 0.5px solid var(--border);
  flex-shrink: 0;
}
.sidebar.collapsed .sidebar-footer { padding: 10px 8px; }

.user-row { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--blue-light); border: 1.5px solid var(--blue-mid);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: var(--blue); flex-shrink: 0;
}
.user-info {
  overflow: hidden;
  transition: opacity var(--sidebar-transition), max-width var(--sidebar-transition);
  max-width: 160px;
  opacity: 1;
}
.sidebar.collapsed .user-info {
  max-width: 0;
  opacity: 0;
  pointer-events: none;
}
.user-name { font-size: 13px; font-weight: 500; color: var(--text-primary); white-space: nowrap; }
.user-trip { font-size: 11px; color: var(--text-tertiary); white-space: nowrap; }

.icon-btn {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: var(--text-tertiary); padding: 4px; border-radius: 6px;
  transition: background 0.13s, color 0.13s, opacity var(--sidebar-transition);
}
.icon-btn:hover { background: var(--bg-secondary); color: var(--text-primary); }
.sidebar.collapsed .icon-btn {
  display: none;
}

/* Sign-in footer button */
.signin-footer-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 9px 12px;
  background: var(--blue-light);
  border: 0.5px solid var(--blue-mid);
  border-radius: var(--radius-md);
  font-size: 13px; font-weight: 500;
  font-family: var(--font-sans);
  color: var(--blue); cursor: pointer;
  transition: background 0.13s, box-shadow 0.13s;
}
.signin-footer-btn:hover { background: var(--blue-mid); box-shadow: var(--shadow-sm); }
.sidebar.collapsed .signin-footer-btn { justify-content: center; padding: 9px 0; }

/* ══════════════════════════════════════
   AUTH STATE
══════════════════════════════════════ */
/* auth-only: shown only when authenticated */
.auth-only { display: flex; flex-direction: column; }
.auth-limited .auth-only { display: none !important; }

/* auth-guest: shown only when not authenticated */
.auth-guest { display: flex; flex-direction: column; }
.auth-guest.guest-cta-wrap { display: block; }
body:not(.auth-limited) .auth-guest { display: none !important; }

/* auth-locked: visible but non-interactive when not authenticated */
.auth-limited .auth-locked {
  opacity: 0.45;
  pointer-events: none;
  cursor: default;
}

/* ── Guest CTA card ── */
.guest-cta-wrap {
  padding: 14px 16px 0;
}
.sidebar.collapsed .guest-cta-wrap { display: none !important; }

.guest-cta-card {
  background: linear-gradient(135deg, var(--blue-light) 0%, #e8f3ff 100%);
  border: 0.5px solid var(--blue-mid);
  border-radius: var(--radius-md);
  padding: 12px 13px;
}
.guest-cta-title { font-size: 12px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.guest-cta-sub { font-size: 11px; color: var(--text-secondary); margin-bottom: 10px; line-height: 1.4; }
.guest-cta-btn {
  width: 100%;
  padding: 7px;
  background: var(--blue);
  border: none; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 500;
  font-family: var(--font-sans);
  color: #fff; cursor: pointer;
  transition: opacity 0.13s;
}
.guest-cta-btn:hover { opacity: 0.88; }

/* ══════════════════════════════════════
   MAIN
══════════════════════════════════════ */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

/* TOP BAR */
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--bg-primary);
  border-bottom: 0.5px solid var(--border);
  z-index: 5; flex-shrink: 0;
}
.tab-pill {
  display: flex; background: var(--bg-secondary);
  border-radius: 22px; padding: 3px; gap: 2px;
}
.tab-btn {
  padding: 5px 14px; border-radius: 18px;
  border: none; background: none;
  font-size: 12px; font-family: var(--font-sans); cursor: pointer;
  color: var(--text-secondary); transition: all 0.13s;
}
.tab-btn.active {
  background: var(--bg-primary); color: var(--text-primary);
  font-weight: 500; box-shadow: var(--shadow-sm);
  border: 0.5px solid var(--border);
}
.topbar-filters { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.filter-chip {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 16px;
  border: 0.5px solid var(--border);
  background: var(--bg-primary);
  font-size: 12px; font-family: var(--font-sans);
  color: var(--text-secondary); cursor: pointer;
  transition: all 0.13s;
}
.filter-chip:hover { background: var(--bg-secondary); }
.filter-chip.active { background: var(--blue-light); color: var(--blue); border-color: var(--blue-mid); }
.filter-chip .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* MAP AREA */
.map-area { flex: 1; position: relative; overflow: hidden; }

.map-bg {
  width: 100%; height: 100%;
  background: linear-gradient(160deg, #dbeafe 0%, #d1fae5 40%, #e0f2fe 70%, #dcfce7 100%);
  position: relative;
}
.map-grid {
  position: absolute; inset: 0; opacity: 0.14;
  background-image: linear-gradient(#475569 1px, transparent 1px),
                    linear-gradient(90deg, #475569 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
}
.road-h { position: absolute; background: rgba(255,255,255,0.75); pointer-events: none; }
.road-v { position: absolute; background: rgba(255,255,255,0.75); pointer-events: none; }

/* MAP PINS */
.map-pin { position: absolute; cursor: pointer; z-index: 3; }
.pin-wrap { display: flex; flex-direction: column; align-items: center; }
.pin-head {
  width: 34px; height: 34px;
  border-radius: 50% 50% 50% 3px;
  transform: rotate(-45deg);
  display: flex; align-items: center; justify-content: center;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  transition: transform 0.15s, box-shadow 0.15s;
}
.pin-head:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.25); transform: rotate(-45deg) scale(1.1); }
.pin-head .pi { transform: rotate(45deg); font-size: 14px; }
.pin-hotel .pin-head { background: var(--blue); }
.pin-sight .pin-head { background: var(--green); }
.pin-food .pin-head { background: var(--coral); }

.pin-label {
  margin-top: 6px;
  background: var(--bg-primary);
  border: 0.5px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 10px; font-weight: 500;
  white-space: nowrap;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* MAP CONTROLS */
.map-controls {
  position: absolute; top: 12px; left: 12px;
  display: flex; flex-direction: column; gap: 5px; z-index: 5;
}
.mc-btn {
  width: 34px; height: 34px;
  background: var(--bg-primary);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 17px; color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  transition: background 0.13s;
}
.mc-btn:hover { background: var(--bg-secondary); }

/* MAP LEGEND */
.map-legend {
  position: absolute; top: 12px; right: 12px; z-index: 5;
  background: var(--bg-primary);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  box-shadow: var(--shadow-sm);
}
.legend-row {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; color: var(--text-secondary); margin-bottom: 4px;
}
.legend-row:last-child { margin-bottom: 0; }
.ldot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

/* EVENT BUBBLE */
.event-bubble {
  position: absolute; bottom: 148px; left: 12px; z-index: 5;
  background: var(--bg-primary);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  max-width: 162px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow 0.13s;
}
.event-bubble:hover { box-shadow: var(--shadow-md); }
.eb-city { font-size: 12px; font-weight: 500; color: var(--text-primary); margin-bottom: 2px; }
.eb-sub { font-size: 11px; color: var(--text-secondary); }
.eb-link { font-size: 11px; color: var(--blue); margin-top: 5px; cursor: pointer; }

/* BOTTOM CARDS */
.bottom-tray {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 5;
  background: linear-gradient(to top, rgba(255,255,255,0.98) 70%, transparent);
  padding: 8px 0 10px;
}
.cards-scroll {
  display: flex; gap: 10px;
  padding: 0 12px;
  overflow-x: auto; scrollbar-width: none;
}
.cards-scroll::-webkit-scrollbar { display: none; }

.place-card {
  min-width: 175px; max-width: 175px;
  background: var(--bg-primary);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 11px 13px;
  cursor: pointer; flex-shrink: 0;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.13s;
}
.place-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); transform: translateY(-1px); }
.place-card.featured { border-color: var(--blue-mid); }

.card-cat { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--text-tertiary); margin-bottom: 5px; }
.cat-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.card-name { font-size: 13px; font-weight: 500; color: var(--text-primary); margin-bottom: 4px; }
.card-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-secondary); }
.star-icon { color: #BA7517; font-size: 11px; }
.card-price { font-size: 11px; font-weight: 500; color: var(--blue); margin-top: 5px; }

/* ══════════════════════════════════════
   RIGHT PANEL — slide toggle + tabs
══════════════════════════════════════ */
.right-panel {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 254px; /* 16px handle + 238px content */
  min-width: 254px;
  background: var(--bg-primary);
  border-left: 0.5px solid var(--border);
  z-index: 5;
  transition: width var(--sidebar-transition), min-width var(--sidebar-transition);
}

.right-panel.collapsed {
  width: 16px;
  min-width: 16px;
}

/* Pull-tab handle */
.rp-handle {
  width: 16px;
  flex-shrink: 0;
  background: none;
  border: none;
  border-right: 0.5px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  transition: background 0.13s, color 0.13s;
}
.rp-handle:hover { background: var(--bg-secondary); color: var(--text-primary); }

.rp-handle-icon {
  transition: transform var(--sidebar-transition);
}
.right-panel:not(.collapsed) .rp-handle-icon { transform: rotate(180deg); }

/* Content wrapper */
.rp-inner {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: opacity var(--sidebar-transition);
}
.right-panel.collapsed .rp-inner {
  opacity: 0;
  pointer-events: none;
}

/* Tabs row */
.rp-tabs {
  display: flex;
  border-bottom: 0.5px solid var(--border);
  flex-shrink: 0;
}
.rp-tab {
  flex: 1; padding: 9px 4px;
  font-size: 11px; font-family: var(--font-sans);
  font-weight: 500; text-align: center;
  cursor: pointer; color: var(--text-tertiary);
  border-bottom: 2px solid transparent;
  transition: color 0.13s, border-color 0.13s;
  user-select: none;
}
.rp-tab:hover { color: var(--text-secondary); }
.rp-tab.active { color: var(--blue); border-bottom-color: var(--blue); }

/* Scrollable body */
.rp-body {
  flex: 1; overflow-y: auto;
  padding: 12px 12px 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* ── Weather panel ── */
.weather-card {
  background: linear-gradient(135deg, #EFF6FF 0%, #E1F5EE 100%);
  border: 0.5px solid var(--blue-mid);
  border-radius: var(--radius-md);
  padding: 12px; margin-bottom: 10px;
}
.wc-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.wc-temp { font-size: 30px; font-weight: 500; color: var(--text-primary); line-height: 1; }
.wc-desc { font-size: 11px; color: var(--text-secondary); margin-top: 3px; }
.wc-icon { font-size: 30px; line-height: 1; }
.wc-stats { display: flex; gap: 0; }
.wc-stat { flex: 1; text-align: center; }
.wc-stat-val { font-size: 12px; font-weight: 500; color: var(--text-primary); display: block; }
.wc-stat-lbl { font-size: 10px; color: var(--text-tertiary); display: block; }

.forecast-label { font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 7px; }
.forecast-row { display: flex; gap: 5px; margin-bottom: 12px; }
.fc-day {
  flex: 1; text-align: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm); padding: 7px 3px;
  border: 0.5px solid var(--border);
}
.fc-day-name { font-size: 9px; color: var(--text-tertiary); }
.fc-day-icon { font-size: 15px; margin: 3px 0; display: block; }
.fc-day-temp { font-size: 11px; font-weight: 500; color: var(--text-primary); }

.weather-alert {
  background: var(--amber-light);
  border: 0.5px solid #EF9F27;
  border-radius: var(--radius-md);
  padding: 9px 10px;
  display: flex; gap: 8px; align-items: flex-start;
}
.alert-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.alert-title { font-size: 11px; font-weight: 500; color: #633806; }
.alert-sub { font-size: 10px; color: #854F0B; margin-top: 1px; }

/* ── News panel ── */
.news-item {
  padding: 9px 0;
  border-bottom: 0.5px solid var(--border);
  cursor: pointer;
  transition: opacity 0.13s;
}
.news-item:hover { opacity: 0.8; }
.news-item:last-child { border-bottom: none; }
.news-src { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--text-tertiary); margin-bottom: 4px; }
.news-src-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.news-headline { font-size: 12px; color: var(--text-primary); line-height: 1.45; }
.news-time { font-size: 10px; color: var(--text-tertiary); margin-top: 3px; }

/* ── Costs panel ── */
.costs-summary {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 11px; margin-bottom: 12px;
}
.costs-summary-label { font-size: 10px; color: var(--text-tertiary); margin-bottom: 2px; }
.costs-summary-val { font-size: 22px; font-weight: 500; color: var(--text-primary); }
.costs-summary-sub { font-size: 11px; color: var(--text-secondary); margin-top: 1px; }

.afford-section-label { font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 8px; }
.afford-item { margin-bottom: 10px; }
.afford-row { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-secondary); margin-bottom: 4px; }
.afford-row span:last-child { font-weight: 500; }
.bar-track { height: 5px; background: var(--bg-tertiary); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; }

.budget-grid { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.budget-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 9px;
  background: var(--bg-secondary); border-radius: var(--radius-sm);
}
.budget-tier { font-size: 12px; color: var(--text-secondary); }
.budget-amount { font-size: 12px; font-weight: 500; color: var(--text-primary); }

.exchange-box {
  background: var(--blue-light);
  border: 0.5px solid var(--blue-mid);
  border-radius: var(--radius-md);
  padding: 9px 10px;
}
.exchange-title { font-size: 11px; font-weight: 500; color: var(--blue); margin-bottom: 3px; }
.exchange-rates { font-size: 11px; color: #185FA5; }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 900px) {
  /* Collapse right panel to handle-only on smaller screens */
  .right-panel { width: 16px; min-width: 16px; }
  .right-panel .rp-inner { opacity: 0; pointer-events: none; }
}
@media (max-width: 640px) {
  .sidebar { width: var(--sidebar-collapsed-w); min-width: var(--sidebar-collapsed-w); overflow: visible; }
  .sidebar .brand-name,
  .sidebar .search-wrap,
  .sidebar .nav-label,
  .sidebar .nav-text,
  .sidebar .nav-badge { display: none; }
}

/* ══════════════════════════════════════
   NAV LINKS (sidebar admin items)
══════════════════════════════════════ */
a.nav-btn {
  text-decoration: none;
  color: inherit;
}
.nav-btn.nav-signout:hover {
  background: #fce8e6;
  color: #993c1d;
}

/* ══════════════════════════════════════
   TOPBAR AUTH
══════════════════════════════════════ */
.topbar-auth {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
  flex-shrink: 0;
}
.topbar-signin-btn {
  min-height: 2rem;
  padding: 0.35rem 0.85rem;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.topbar-signin-btn:hover { background: #0b5a46; }
.topbar-signin-btn[hidden],
.topbar-avatar-btn[hidden] { display: none; }
.topbar-avatar-btn {
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-weight: 600;
  font-size: 11px;
  font-family: var(--font-sans);
  cursor: pointer;
  flex-shrink: 0;
}

/* ══════════════════════════════════════
   USER MENU (login-modal.js)
══════════════════════════════════════ */
.user-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: var(--z-user-menu);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 3.25rem 1rem 1rem;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: visibility 0.2s, opacity 0.25s ease;
}
.user-menu-backdrop.user-menu--open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
.user-menu-panel {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  max-width: 380px;
  width: 100%;
  padding: 1.5rem;
  position: relative;
}
.user-menu-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  border: none;
  background: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: #5f6368;
}
.user-menu-header {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-right: 2rem;
}
.user-menu-avatar-wrap {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}
.user-menu-display-name { font-weight: 500; color: #202124; }
.user-menu-username { font-size: 0.875rem; color: #5f6368; word-break: break-all; }
.user-menu-divider { height: 1px; background: #eee; margin: 0.5rem 0; }
.user-menu-list { list-style: none; }
.user-menu-list a,
.user-menu-list button {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.65rem 0.75rem;
  text-align: left;
  font-size: 1rem;
  color: #202124;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  border-radius: 8px;
  font-family: var(--font-sans);
}
.user-menu-list a:hover,
.user-menu-list button:hover { background: #f1f3f4; }
.topbar--page .topbar-page-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main-body--page {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.main-body--page.app-hub-page,
.main-body--page.account-page {
  padding: 1.25rem 1.5rem 2rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
  padding: 4px;
}
.icon-btn:hover { background: var(--bg-secondary); }
