*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #F7F7FC;
  --bg-card: #FFFFFF;
  --bg-surface: #EEECF8;
  --bg-elevated: #E3E1EF;
  --primary: #00C8B8;
  --primary-rgb: 0, 200, 184;
  --primary-dim: rgba(0, 200, 184, 0.1);
  --primary-border: rgba(0, 200, 184, 0.25);
  --primary-glow: 0 4px 24px rgba(0, 200, 184, 0.28);
  --gold: #D4890A;
  --gold-dim: rgba(212, 137, 10, 0.1);
  --gold-border: rgba(212, 137, 10, 0.25);
  --text: #0E0D1C;
  --text-2: #6060A0;
  --text-3: #A0A0C0;
  --error: #D63250;
  --error-dim: rgba(214, 50, 80, 0.08);
  --border: rgba(0, 0, 0, 0.07);
  --border-2: rgba(0, 0, 0, 0.11);
  --navbar-bg: rgba(247, 247, 252, 0.96);
  --r-xs: 10px;
  --r-sm: 14px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 28px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Plus Jakarta Sans', sans-serif;
  --nav-h: 74px;
  --px: 20px;
  --card-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.05);
}

html { height: 100%; }

body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
  overflow-x: hidden;
}

#app-layout {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

#app {
  flex: 1;
  padding-bottom: calc(var(--nav-h) + 8px);
}

a { color: inherit; text-decoration: none; }

button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
  -webkit-tap-highlight-color: transparent;
}

input, textarea {
  font-family: var(--font);
  outline: none;
  border: none;
  background: none;
}

img { max-width: 100%; display: block; }

::selection { background: var(--primary-dim); color: var(--primary); }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 2px; }

.hidden { display: none !important; }

@media (min-width: 480px) {
  :root { --px: 24px; }
}

@media (min-width: 960px) {
  #app-layout {
    max-width: 430px;
    margin: 0 auto;
    min-height: 100dvh;
    box-shadow: 0 0 80px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.06);
  }
  #navbar {
    max-width: 430px;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 430px !important;
  }
}

/* PWA install banner */
.pwa-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  transform: translateY(-100%);
  transition: transform 0.3s cubic-bezier(0.32,0,0.67,0);
  padding-top: max(10px, env(safe-area-inset-top));
}
.pwa-banner.visible { transform: translateY(0); }

.pwa-banner-logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  flex-shrink: 0;
  object-fit: contain;
}
.pwa-banner-text {
  flex: 1;
  min-width: 0;
}
.pwa-banner-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pwa-banner-sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pwa-banner-sub svg {
  vertical-align: middle;
  display: inline-block;
}
.pwa-banner-btn {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 10px;
  background: var(--primary);
  color: #05201D;
  font-size: 12px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  white-space: nowrap;
}
.pwa-banner-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg-surface);
  border: none;
  cursor: pointer;
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pwa-banner-close:hover { background: var(--bg-elevated); color: var(--text); }
