:root {
  font-family: -apple-system, system-ui, sans-serif;
  --topbar-height: 60px;
  --facility-image-width: 220px;
}
body {
  margin: 0;
  padding: 0;
  background: #f3f4f6;
  overflow-x: hidden;
}
body.nav-active {
  overflow: hidden;
  height: 100vh;
}
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 16px 8px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  z-index: 1000;
  gap: 16px;
}
.app-title {
  font-size: 18px;
  font-weight: 700;
  color: #111;
}
.icon-btn {
  background: none;
  border: none;
  font-size: 30px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 10px;
  color: #111;
  transition: background 0.2s;
}
.icon-btn:hover {
  background: #f3f4f6;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.theme-toggle {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 12px;
  color: #111;
  user-select: none;
  margin-top: 4px;
}
.theme-toggle input {
  display: none;
}
.theme-toggle .slider {
  width: 36px;
  height: 20px;
  background: #e5e7eb;
  border-radius: 999px;
  position: relative;
  transition: background 0.2s ease;
}
.theme-toggle .slider::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 2px;
  left: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.theme-toggle input:checked + .slider {
  background: #3b82f6;
}
.theme-toggle input:checked + .slider::after {
  transform: translateX(16px);
}
.theme-toggle .theme-label {
  font-weight: 600;
  line-height: 1;
}

body.dark {
  background: #0b0f14;
  color: #e5e7eb;
}
body.dark .topbar {
  background: #0f1520;
  border-bottom-color: #1f2937;
}
body.dark .app-title {
  color: #e5e7eb;
}
body.dark .icon-btn {
  color: #e5e7eb;
}
body.dark .icon-btn:hover {
  background: #1f2937;
}
body.dark .card {
  background: #0b0f14;
}
body.dark .tab-btn {
  color: #9ca3af;
}
body.dark .tab-btn:hover {
  background: #1f2937;
  color: #e5e7eb;
}
body.dark .tab-btn.active {
  background: #111827;
  color: #f9fafb;
}
body.dark .btn {
  background: #1f2937;
  color: #f9fafb;
  border-color: #374151;
}
body.dark .btn.secondary {
  background: #0f1520;
  color: #e5e7eb;
  border-color: #374151;
}
body.dark input,
body.dark select,
body.dark textarea {
  background: #0f1520;
  color: #e5e7eb;
  border-color: #374151;
}
body.dark label,
body.dark .muted {
  color: #9ca3af;
}
body.dark .value {
  color: #f9fafb;
}
body.dark .route-panel {
  background: #0f1520;
}
body.dark .map-route-fab {
  background: #111827 !important;
  color: #f9fafb !important;
  box-shadow: 0 6px 18px rgba(0,0,0,0.45);
}
body.dark .live-nav {
  background: #0f1520;
  border-color: #1f2937;
}
body.dark .live-nav-item {
  background: #111827;
  border-color: #1f2937;
}
body.dark .live-nav-title {
  color: #f9fafb;
}
body.dark .live-nav-item span {
  color: #9ca3af;
}
body.dark .modal-content {
  background: #0f1520;
  color: #e5e7eb;
}
body.dark .theme-toggle {
  color: #e5e7eb;
}
body.dark .theme-toggle .slider {
  background: #374151;
}
body.dark .theme-toggle input:checked + .slider {
  background: #2563eb;
}
body.dark .leaflet-bar a,
body.dark .leaflet-control-zoom-in,
body.dark .leaflet-control-zoom-out {
  background: #0f1520;
  color: #e5e7eb;
  border-color: #1f2937;
}
body.dark .leaflet-bar a:hover {
  background: #1f2937;
}
body.dark .leaflet-bar {
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}
body.dark .bottom-sheet {
  background: #0f1520;
}
body.dark .sheet-handle {
  background: #4b5563;
}
body.dark .nav-search-results {
  background: #0f1520;
  border-color: #1f2937;
  color: #e5e7eb;
}
body.dark .nav-search-results div {
  border-bottom-color: #1f2937;
}
body.dark .nav-search-results div:hover {
  background: #111827;
}
body.dark .route-info {
  background: #0f1520;
  border-color: #1f2937;
  color: #e5e7eb;
}
body.dark .map-fab,
body.dark .map-fab.btn {
  background: transparent !important;
  box-shadow: none !important;
}
body.dark .leaflet-popup-content-wrapper {
  background: #0f1520;
  color: #e5e7eb;
}
body.dark .leaflet-popup-tip {
  background: #0f1520;
}
body.dark .live-nav-compact {
  background: #0f1520;
  border: 1px solid #1f2937;
}
body.dark .live-nav-compact-label {
  color: #9ca3af;
}
body.dark .live-nav-compact-value {
  color: #f9fafb;
}
.card {
  max-width: none;
  margin: 0;
  background: white;
  border-radius: 0;
  padding: calc(var(--topbar-height) + 16px + env(safe-area-inset-top, 0px)) 16px 16px;
  box-shadow: none;
  min-height: 100vh;
  overflow: auto;
}
body.nav-active .card {
  overflow: hidden;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  margin: 0;
  margin-left: 12px;
  border-bottom: none;
  padding: 0;
}
.tab-btn {
  background: none;
  border: none;
  padding: 8px 12px;
  margin-left: -10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: #6b7280;
  border-radius: 10px;
  transition: all 0.2s;
}
.tab-btn:hover {
  background: #f3f4f6;
  color: #111;
}
.tab-btn.active {
  color: #111;
  background: #f1f5f9;
}
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* Map and Navigation */
.map-container {
  position: fixed;
  top: calc(var(--topbar-height) + env(safe-area-inset-top, 0px));
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100vh; /* changed from auto */
  border-radius: 0;
  margin: 0;
  border: none;
  z-index: 1;
  transform-origin: center center;
}

/* Rotate mode: Make map huge to cover corners without scaling artifacts */
.map-container.map-rotating {
  width: 150vmax;
  height: 150vmax;
  left: 50%;
  top: 50%;
  /* Combine centering translate with rotation */
  transform: translate(-50%, -50%) rotate(var(--map-rotation, 0deg));
  /* Override top offset since we center absolutely */
  margin-top: 0; 
  /* Z-index adjustments */
  z-index: 1;
}

/* Hide navigation controls when rotating (they would be off-screen) */
.map-container.map-rotating .leaflet-control-container {
  display: none;
}

/* Rotate content inside markers to keep them upright */
.map-container.map-rotating .temple-marker img {
  transform: rotate(var(--map-rotation-inverse, 0deg));
  transform-origin: center center;
}
.map-container.map-rotating .facility-marker .marker-icon {
  transform: rotate(var(--map-rotation-inverse, 0deg));
  transform-origin: center center;
  display: block;
}

/* Rotate the WHOLE popup (box + tip) using modern rotate property to compose with Leaflet's transform */
.map-container.map-rotating .leaflet-popup {
  rotate: var(--map-rotation-inverse, 0deg);
  transform-origin: center bottom;
  /* Visual adjustments: Move up to clear marker, move right to center */
  margin-bottom: 30px; 
  margin-left: 1px;
}

/* Reset inner parts to default */
.map-container.map-rotating .leaflet-popup-content-wrapper,
.map-container.map-rotating .leaflet-popup-tip-container {
  transform: none;
  display: block; 
}
.map-container.map-rotating .leaflet-popup-content-wrapper {
  transform-origin: center bottom;
}

.facility-marker .facility-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.facility-marker .facility-icon--image {
  overflow: visible;
  width: 32px;
  height: 32px;
  background-color: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
.facility-marker .facility-icon-image {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}
.facility-marker .marker-icon {
  font-size: 16px;
  line-height: 1;
}
.nav-container {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.map-container.map-rotating .facility-marker img {
  transform: rotate(var(--map-rotation-inverse, 0deg));
  transform-origin: center center;
  display: block;
}

.map-fab {
  padding: 0;
  border: none;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
#getCurrentLocation {
  position: fixed;
  bottom: calc(280px + 16px);
  left: 16px;
  z-index: 900;
  width: 48px;
  height: 48px;
  padding: 0;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.map-fab.btn {
  border: none;
  background: transparent;
  box-shadow: none;
}
.map-fab-icon {
  width: 40px;
  height: 40px;
  display: block;
  background: transparent;
}
.map-route-fab {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 300px);
  right: 16px;
  z-index: 900;
  background: #fff !important;
  color: #111 !important;
  border: none !important;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 14px;
}

.compass-fab {
  position: fixed;
  top: calc(var(--topbar-height) + env(safe-area-inset-top, 0px) + 25px);
  right: 10px;
  z-index: 900;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
  width: 48px;
  height: 48px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.compass-fab.hidden {
  display: none;
}

.compass-fab:active {
  transform: scale(0.95);
}

.compass-fab.active {
  background: #fff;
  color: #111;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15), 0 0 0 3px rgba(59, 130, 246, 0.35);
}

.compass-icon {
  width: 42px;
  height: 42px;
  transition: transform 0.3s ease;
  transform: translate(-9.7px, -8.3px);
  display: block;
  object-fit: contain;
}

.compass-fab.active .compass-icon {
  color: white;
}

.compass-icon-dark {
  display: none;
}

body.dark .compass-fab {
  background: #0f1520;
  box-shadow: 0 6px 18px rgba(0,0,0,0.45);
}

body.dark .compass-fab.active {
  background: #0f1520;
  box-shadow: 0 6px 18px rgba(0,0,0,0.45), 0 0 0 3px rgba(59, 130, 246, 0.35);
}

body.dark .compass-icon-light {
  display: none;
}

body.dark .compass-icon-dark {
  display: block;
}

.leaflet-top {
  top: 20px;
}
.leaflet-top .leaflet-control {
  margin-top: 0;
}
.bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 24px rgba(0,0,0,0.15);
  height: 280px;
  overflow: hidden;
  z-index: 900;
  transition: height 0.2s ease;
  will-change: height;
}

.bottom-sheet.live-nav-hidden {
  display: none;
}
.bottom-sheet.dragging {
  transition: none;
  user-select: none;
}
.sheet-content {
  overflow-y: auto;
  max-height: calc(100% - 24px);
  padding-bottom: 8px;
  scrollbar-width: none;
}
.sheet-content::-webkit-scrollbar {
  width: 0;
  height: 0;
}
.bottom-sheet.open {
  max-height: 80vh;
}
.sheet-handle {
  width: 44px;
  height: 5px;
  background: #d1d5db;
  border-radius: 999px;
  margin: 10px auto -9px;
}
.sheet-content {
  padding: 0 16px 16px;
}
.bottom-sheet .route-panel h3 {
  margin-top: 4px;
}
.bottom-sheet .route-actions,
.bottom-sheet .sheet-extra {
  display: none;
}
.bottom-sheet.open .route-actions,
.bottom-sheet.open .sheet-extra {
  display: block;
}
.route-panel {
  background: transparent;
  padding: 0;
  border-radius: 0;
  margin-top: 0;
}
.nav-controls {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.nav-start-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.live-nav {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
}
.live-nav-title {
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 14px;
  color: #0f172a;
}
.live-nav-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #334155;
  margin-bottom: 10px;
}
.live-nav-toggle input {
  width: 16px;
  height: 16px;
}
.nav-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #334155;
}
.nav-toggle input {
  width: 16px;
  height: 16px;
}
.live-nav-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.live-nav-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
}
.live-nav-item span {
  font-size: 12px;
  color: #64748b;
}
.live-nav-item strong {
  font-size: 16px;
  color: #0f172a;
}
.nav-controls .btn {
  padding: 8px 12px;
  font-size: 14px;
}
.route-panel {
  background: #fafafa;
  padding: 0px 16px 16px 16px;
  border-radius: 12px;
  margin-top: 16px;
}
.route-panel h3 {
  margin: 0 0 12px;
  font-size: 16px;
}
.route-panel select {
  margin-bottom: 12px;
}
.nav-hidden-select {
  display: none;
}
.nav-search-results {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: white;
  margin: 6px 0 12px;
  display: none;
}
.nav-search-results.active {
  display: block;
}
.nav-search-results div {
  padding: 10px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}
.nav-search-results div:hover {
  background: #f9f9f9;
}
.nav-search-results div:last-child {
  border-bottom: none;
}
.route-info {
  margin-top: 12px;
  padding: 12px;
  background: white;
  border-radius: 8px;
  border: 1px solid #ddd;
}
.route-info:empty {
  display: none;
}

label { display:block; margin: 12px 0 6px; font-weight: 600; }
input, select {
  width: 100%; padding: 12px; font-size: 16px;
  border: 1px solid #ddd; border-radius: 12px;
}
.grid { display:grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chips { display:flex; flex-wrap:wrap; gap:8px; }
.chip {
  border: 1px solid #ddd; background:#fff; border-radius: 999px;
  padding: 8px 10px; font-size: 13px; cursor:pointer; user-select:none;
}
.chip.active { border-color:#111; }
.facilities-container { display: block; }
.facilities-container.hidden { display: none; }
.hidden { display: none !important; }

.route-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.route-header h3 {
  margin: 0;
  flex: 1;
}

.input-with-clear {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-clear input {
  flex: 1;
  padding-right: 40px;
}

.clear-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}

.clear-btn:hover {
  color: #333;
}

.clear-btn:active {
  color: #111;
}

.detail { margin-top: 14px; padding: 12px; background:#fafafa; border-radius: 12px; border:1px solid #eee; }
.temple-image-container { display: none; }
.facility-popup-image {
  width: var(--facility-image-width);
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  margin: 8px 0;
}
.muted { color:#6b7280; }
.value { font-size: 18px; font-weight: 800; margin-top: 4px; }
.actions { margin-top: 10px; }
.btn {
  display:inline-block; padding: 10px 12px; border-radius: 12px;
  border: 1px solid #111; text-decoration:none; color:#111;
}
.dropdown {
  max-height: 200px; overflow-y: auto; border: 1px solid #ddd; border-radius: 12px; background: white; margin-top: 4px;
}
.dropdown div {
  padding: 10px; cursor: pointer; border-bottom: 1px solid #eee;
}
.dropdown div:hover { background: #f9f9f9; }
.dropdown div:last-child { border-bottom: none; }

.note textarea {
  width: 100%; padding: 8px; font-size: 14px; border: 1px solid #ddd; border-radius: 8px;
}
.note-actions { margin-top: 6px; display: flex; gap: 8px; align-items: center; }
.btn.secondary { border-color: #ccc; color: #333; background: #fff; }
.location-icon { display: inline-block; transform: translateX(-12px); }
.sync-config { display: none; }

.app-version {
  position: fixed;
  right: 12px;
  bottom: 296px;
  background: rgba(0,0,0,0.72);
  color: #fff;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
  z-index: 850;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  display: flex;
  align-items: center;
  gap: 8px;
}

.impressum-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.impressum-btn:hover {
  border-color: #fff;
  background: rgba(255,255,255,0.1);
}

.impressum-btn:active {
  background: rgba(255,255,255,0.2);
}

.search-bar {
  display: flex;
  gap: 8px;
  margin: 6px 0;
}

.search-bar input {
  flex: 1;
}

.search-bar .btn {
  padding: 12px 12px;
  font-size: 14px;
  white-space: nowrap;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #eee;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
}

.close-btn:hover {
  color: #333;
}

.modal-body {
  padding: 16px;
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-item {
  width: 100%;
  text-align: left;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
  cursor: pointer;
}

.settings-item:hover {
  background: #f9fafb;
}

.settings-toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.settings-toggle-item input {
  width: 18px;
  height: 18px;
}

.dev-debug-fab {
  position: fixed;
  top: calc(var(--topbar-height) + env(safe-area-inset-top, 0px) + 20px);
  right: 12px;
  z-index: 901;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  border: none;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

body.dark .dev-debug-fab {
  background: #0f1520;
  box-shadow: 0 6px 18px rgba(0,0,0,0.45);
}

.settings-version {
  margin-top: 12px;
  font-size: 12px;
  color: #6b7280;
}

.modal-body label {
  display: block;
  margin: 12px 0 6px;
  font-weight: 600;
}

.modal-body select,
.modal-body input {
  width: 100%;
  padding: 10px;
  margin-bottom: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
}

.modal-body select[multiple] {
  min-height: 100px;
}

.modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px;
  border-top: 1px solid #eee;
}

.modal-footer .btn {
  padding: 10px 12px;
  font-size: 14px;
}

/* Toast notifications */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
}

/* Pulse animation for map markers */
@keyframes pulse {
  0% {
    r: 12px;
    opacity: 0.8;
  }
  100% {
    r: 30px;
    opacity: 0;
  }
}

/* Live Navigation Compact Panel (Google Maps style) */
.live-nav-compact {
  position: fixed;
  bottom: 20px;
  left: 12px;
  right: 12px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 950;
  transition: opacity 0.3s ease;
}

.live-nav-compact.hidden {
  display: none;
}

.live-nav-compact-stats {
  display: flex;
  flex: 1;
  gap: 8px;
  overflow-x: auto;
}

.live-nav-compact-item {
  flex: 1;
  min-width: 70px;
  text-align: center;
}

.live-nav-compact-label {
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 2px;
}

.live-nav-compact-value {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}

.live-nav-stop-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ef4444;
  color: white;
  border: none;
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
  transition: background 0.2s ease;
}

.live-nav-stop-btn:hover {
  background: #dc2626;
}

.live-nav-stop-btn:active {
  transform: scale(0.95);
}
/* Account & Statistics Styles */

#accountBtn {
  position: relative;
  padding: 6px 8px !important;
  font-size: 20px !important;
  background: none !important;
  border: none !important;
  color: #6b7280 !important;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s ease !important;
}

#accountBtn:hover {
  background: #f3f4f6 !important;
  color: #111 !important;
}

#accountBtn.logged-in {
  color: #10b981 !important;
}

#accountBtn.logged-in::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  border: 2px solid white;
}

#accountBtn.logged-out {
  color: #9ca3af !important;
}

body.dark #accountBtn {
  color: #6b7280 !important;
}

body.dark #accountBtn:hover {
  background: #374151 !important;
  color: #f3f4f6 !important;
}

body.dark #accountBtn.logged-in::after {
  border-color: #0f1520;
}

body.dark #accountBtn.logged-out {
  color: #6b7280 !important;
}

body.dark #accountBtn {
  color: #6b7280;
}

body.dark #accountBtn:hover {
  background: #374151;
  color: #f3f4f6;
}

Body.dark #accountBtn.logged-in::after {
  border-color: #0f1520;
}

.account-modal, .stats-modal {
  max-width: 500px !important;
  max-height: 85vh !important;
  overflow-y: auto !important;
}

.account-auth {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid #e5e7eb;
}

.auth-tab {
  flex: 1;
  padding: 12px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s;
}

.auth-tab.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form.hidden {
  display: none;
}

.auth-form input {
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

.auth-form input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.account-profile, .statistics-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-header {
  padding: 16px;
  background: #f3f4f6;
  border-radius: 8px;
}

.profile-header h3 {
  margin: 0 0 4px 0;
  font-size: 18px;
}

.profile-header p {
  margin: 0;
}

.profile-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-section h4 {
  margin: 12px 0 8px 0;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.profile-input {
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

.profile-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.profile-actions .btn {
  width: 100%;
}

/* Statistics Styles */

.stats-header {
  text-align: center;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.stat-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.stat-label {
  font-size: 12px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  line-height: 1;
}

.stat-unit {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

.stats-history {
  margin-top: 16px;
}

.stats-history h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
}

.session-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.session-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 13px;
}

.session-date {
  color: #6b7280;
  font-weight: 500;
}

.session-stats {
  display: flex;
  gap: 12px;
  color: #374151;
}

.session-stats span {
  font-weight: 500;
}

.modal-footer {
  display: flex;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
  margin-top: 16px;
}

.modal-footer .btn {
  flex: 1;
}