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

html, body {
  height: 100%;
}

body {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-body);
  color: var(--text-dark);
  background-color: var(--content-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

input, textarea, select, button {
  font-family: var(--font-primary);
  font-size: 16px;
}

a {
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

.screen {
  display: none;
  min-height: 100%;
}

.screen.active {
  display: block;
}

.hidden {
  display: none !important;
}

/* ---------- Top nav (desktop) ---------- */
.top-nav {
  display: none;
  height: var(--nav-height-desktop);
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-nav button {
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: var(--font-weight-label);
  color: var(--text-gray);
  transition: background 0.2s ease, color 0.2s ease;
}

.top-nav button.active {
  background: var(--accent-blue-glass);
  color: var(--text-dark);
}

/* ---------- Bottom tab bar (mobile) ---------- */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--nav-height-mobile);
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: #fff;
  border-top: 1px solid rgba(0,0,0,0.08);
  z-index: 200;
}

.bottom-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  color: var(--text-gray);
  font-weight: var(--font-weight-label);
  flex: 1;
}

.bottom-nav button.active {
  color: var(--accent-blue);
}

.bottom-nav .nav-icon {
  font-size: 20px;
  line-height: 1;
}

@media (min-width: 900px) {
  .top-nav { display: flex; }
  .bottom-nav { display: none; }
  .app-content { padding-bottom: 0; }
}

@media (max-width: 899px) {
  .app-content { padding-bottom: var(--nav-height-mobile); }
}

/* ---------- Glass opacity control ---------- */
.glass-control {
  position: fixed;
  top: 10px;
  right: 12px;
  z-index: 300;
}

.glass-control-toggle {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  color: var(--text-gray);
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
  transition: color 0.2s ease;
}

.glass-control-toggle:hover,
.glass-control-toggle[aria-expanded="true"] {
  color: var(--accent-blue);
}

.glass-control-popover {
  position: absolute;
  top: 42px;
  right: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.16);
  padding: 14px 16px;
  width: 200px;
}

.glass-control-popover label {
  display: block;
  font-size: 12px;
  font-weight: var(--font-weight-label);
  color: var(--text-gray);
  margin-bottom: 8px;
}

.glass-control-popover input[type="range"] {
  width: 100%;
}

@media (min-width: 900px) {
  .glass-control {
    top: 11px;
    right: 16px;
  }
}

/* ---------- Placeholder screens ---------- */
.placeholder-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
}

.placeholder-screen h2 {
  font-weight: var(--font-weight-heading);
  font-size: 24px;
  margin-bottom: 8px;
}

.placeholder-screen p {
  color: var(--text-gray);
}

/* ---------- Generic content card (Pattern B) ---------- */
.content-card {
  background: #fff;
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  margin-bottom: var(--card-gap);
}

.card-title {
  font-weight: var(--font-weight-heading);
  font-size: 16px;
  margin-bottom: 12px;
}
