.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: rgba(247, 243, 234, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(15, 107, 76, 0.08);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.app-brand img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold-soft);
  box-shadow: 0 4px 12px rgba(15, 107, 76, 0.15);
}

.app-brand-text {
  min-width: 0;
}

.app-brand-text strong {
  display: block;
  font-size: 1rem;
  color: var(--emerald-deep);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-brand-text span {
  display: block;
  font-size: 0.75rem;
  color: var(--ink-muted);
  font-family: var(--font-en);
}

#app-outlet {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 1rem 1rem 1.5rem;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  padding: 0.35rem 0.5rem calc(0.35rem + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.15rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(15, 107, 76, 0.1);
  box-shadow: 0 -8px 24px rgba(28, 42, 36, 0.06);
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-height: var(--touch);
  border-radius: 1rem;
  color: var(--ink-muted);
  font-size: 0.72rem;
  font-weight: 600;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.bottom-nav a .nav-ico {
  width: 1.35rem;
  height: 1.35rem;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
}

.bottom-nav a.active {
  color: var(--emerald-deep);
  background: var(--emerald-soft);
  transform: translateY(-2px);
}

.offline-banner {
  display: none;
  background: #fff4e5;
  color: #8a4b08;
  text-align: center;
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.offline-banner.is-visible {
  display: block;
}

.toast-stack {
  position: fixed;
  top: calc(var(--header-height) + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  width: min(420px, calc(100% - 1.5rem));
  display: grid;
  gap: 0.5rem;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  background: var(--white);
  border: 1px solid rgba(15, 107, 76, 0.12);
  border-left: 4px solid var(--emerald-deep);
  border-radius: 0.9rem;
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow-soft);
}

@media (min-width: 992px) {
  .bottom-nav {
    left: 50%;
    transform: translateX(-50%);
    width: min(720px, 100%);
    border-radius: 1.25rem 1.25rem 0 0;
  }

  #app-outlet {
    padding-top: 1.5rem;
  }
}
