/* ============================================================
   Top Bar
============================================================ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  row-gap: 10px;
  min-height: 56px;
}

.topbar__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.3px;
  white-space: nowrap;
  flex-shrink: 0;
}

.token-section {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex: 1;
  min-width: 240px;
  max-width: 500px;
}

.token-section__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  white-space: nowrap;
  padding-top: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.token-section__field { flex: 1; }

#bearer-token {
  font-family: var(--font-mono);
  font-size: 11px;
  width: 100%;
  resize: none;
  padding: 5px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--transition-fast);
  line-height: 1.4;
}
#bearer-token::placeholder { color: var(--color-text-muted); }
#bearer-token:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgb(37 99 235 / 0.12); }

/* ============================================================
   View System
============================================================ */
.view { display: none; padding-top: 56px; padding-bottom: 72px; min-height: 100vh; }
.view.view-active { display: block; }

/* ============================================================
   View Topbar (per-view header bar below global topbar)
============================================================ */
.view-topbar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.view-topbar__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
}

/* Controls bar (devotionals status tabs) */
.controls-bar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ============================================================
   Main Content
============================================================ */
.main-content {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ============================================================
   Bottom Nav
============================================================ */
#bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 16px rgb(0 0 0 / 0.06);
  display: flex;
  align-items: stretch;
  height: 60px;
  padding: 0 8px;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  padding: 0 8px;
  border-radius: var(--radius-md);
  transition: color var(--transition-fast), background var(--transition-fast);
  position: relative;
}
.nav-btn:hover { color: var(--color-text); }
.nav-btn.nav-active { color: var(--color-primary); }
.nav-btn.nav-active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px 2px 0 0;
}

/* ============================================================
   Responsive
============================================================ */
@media (max-width: 640px) {
  .topbar { padding: 10px 16px; }
  .main-content { padding: 16px; }
  .controls-bar, .view-topbar { padding: 10px 16px; }
}
