/* Layout base */
.app-header {
  position: fixed; inset: 0 0 auto 0; height: var(--hdr-h); z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px; background: var(--accent); color: var(--accent-fg);
  box-shadow: var(--shadow);
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: 0; color: inherit; font-size: 18px; font-weight: 800;
}
.brand span { font-size: 22px; }
.header-actions { display: flex; gap: 6px; align-items: center; }
.icon-btn, .lang-btn {
  position: relative; height: 34px; min-width: 34px; padding: 0 8px;
  border-radius: 10px; border: 0; background: rgba(255,255,255,.14);
  color: var(--accent-fg); font-size: 14px; font-weight: 700;
}
.icon-btn:active, .lang-btn:active { transform: scale(.94); }
.badge {
  position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px; padding: 0 3px;
  border-radius: 8px; background: var(--accent2); color: #14100a; font-size: 10px; font-weight: 800;
  line-height: 16px; text-align: center;
}
.view {
  padding: calc(var(--hdr-h) + var(--gap)) 12px calc(var(--nav-h) + var(--gap) + 36px);
  max-width: 720px; margin: 0 auto; min-height: 100dvh;
}
.bottom-nav {
  position: fixed; inset: auto 0 0 0; height: var(--nav-h); z-index: 40;
  display: flex; background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav button {
  flex: 1; background: none; border: 0; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px;
}
.bottom-nav button .ic { font-size: 20px; line-height: 1; }
.bottom-nav button.active { color: var(--accent); font-weight: 700; }
.bottom-nav button.active .ic { color: var(--accent2); }

/* Modal */
.modal { border: 0; padding: 0; background: transparent; max-width: 720px; width: 100%; margin: auto; }
.modal::backdrop { background: rgba(0,0,0,.5); }
.modal-card {
  background: var(--surface); border-radius: 16px; padding: 16px; color: var(--text);
  max-height: 82dvh; overflow: auto; box-shadow: var(--shadow);
}
/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 14px); transform: translateX(-50%);
  background: var(--accent); color: var(--accent-fg); padding: 10px 16px; border-radius: 12px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow); z-index: 90; max-width: 90%;
}
.toast.error { background: var(--danger); }
/* skeleton */
.skeleton { color: var(--muted); text-align: center; padding: 60px 0; }
/* Input editability safety (Telegram WebView) */
input, textarea, select { -webkit-user-select: text; user-select: text; pointer-events: auto; }
input[type="text"], textarea { -webkit-appearance: none; appearance: none; }
/* Academic, larger nav icons */
.bottom-nav button .ic { font-size: 24px; line-height: 1; filter: drop-shadow(0 1px 0 rgba(0,0,0,.05)); }
.bottom-nav button span:last-child { letter-spacing: .2px; font-weight: 700; }
.app-header .icon-btn, .app-header .lang-btn { font-size: 16px; min-width: 38px; height: 38px; border-radius: 12px; }
.brandmark{width:42px;height:42px;border-radius:12px;display:block;object-fit:contain}
.brand{display:inline-flex;align-items:center;gap:10px}

/* Header Wallet Pill */
.wallet-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 38px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid rgba(201, 163, 74, 0.45);
  background: rgba(15, 27, 45, 0.7);
  color: var(--accent2, #C9A34A);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.1s ease, background 0.2s ease;
}
.wallet-pill:active { transform: scale(0.95); }
.wallet-pill .w-ic { font-size: 14px; line-height: 1; }
@media (max-width: 380px) {
  .wallet-pill { padding: 0 7px; font-size: 11px; gap: 4px; height: 34px; border-radius: 10px; }
  .app-header .icon-btn, .app-header .lang-btn { min-width: 34px; height: 34px; border-radius: 10px; font-size: 14px; }
  .header-actions { gap: 4px; }
}
@media (max-width: 330px) {
  .wallet-pill .w-ic { display: none; }
}
