/* ============================================================
   App shell & layout
   ============================================================ */

.app {
  max-width: var(--max-w);
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: calc(var(--nav-h) + var(--safe-b));
}

.viewport {
  flex: 1;
}

.tab-panel {
  display: none;
  padding: var(--sp-5) var(--sp-4) var(--sp-8);
}

.tab-panel.is-active {
  display: block;
}

/* ============================================================
   Top bar
   ============================================================ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-4) var(--sp-3);
  background: linear-gradient(180deg, var(--bg) 55%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--grad-cone);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-cone);
}

.brand-mark svg {
  width: 20px;
  height: 20px;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.brand-name em {
  font-style: normal;
  color: var(--cone);
}

.topbar__sub {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}

.topbar__right {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  color: var(--text-2);
  padding: 7px 12px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
}

/* ============================================================
   Bottom navigation
   ============================================================ */

.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-w);
  height: calc(var(--nav-h) + var(--safe-b));
  padding: 8px var(--sp-3) calc(8px + var(--safe-b));
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  z-index: 50;
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-3);
  border-radius: var(--r-md);
  position: relative;
  transition: color 0.2s ease;
  padding: 4px 2px;
}

.tab-btn svg {
  width: 24px;
  height: 24px;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.tab-btn span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.tab-btn.is-active {
  color: var(--text);
}

.tab-btn.is-active svg {
  transform: translateY(-1px);
}

.tab-btn.is-active::before {
  content: "";
  position: absolute;
  top: -9px;
  width: 26px;
  height: 3px;
  border-radius: var(--r-pill);
  background: var(--grad-cone);
}

.tab-btn.is-active .dot-reminder {
  animation: pulse-dot 1.6s ease-in-out infinite;
}

.tab-btn--capture {
  margin-top: -22px;
  height: 62px;
  background: var(--grad-cone);
  border-radius: 20px;
  box-shadow: var(--shadow-cone);
  color: var(--cone-ink);
  border: 3px solid var(--surface);
}

.tab-btn--capture svg {
  width: 26px;
  height: 26px;
}

.tab-btn--capture span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tab-btn--capture.is-active {
  color: var(--cone-ink);
}

.tab-btn--capture.is-active::before {
  display: none;
}

.tab-btn.is-active .dot-reminder {
  display: block;
}

.dot-reminder {
  display: none;
  position: absolute;
  top: 2px;
  right: 22%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--signal);
  border: 2px solid var(--surface);
}