/* Tanga Mini App — umumiy uslublar.
 * Rang tokenlari app.js dagi themeVars() da (light/dark), bu yerda —
 * qobiq, xavfsiz hudud va qayta ishlatiladigan bloklar. Ekranlarning
 * o'z uslublari dizayn prototipidagidek elementlarning o'zida turadi. */

:root {
  --safe-top: max(var(--tg-safe-area-inset-top, 0px), env(safe-area-inset-top, 0px));
  --safe-bottom: max(var(--tg-safe-area-inset-bottom, 0px), env(safe-area-inset-bottom, 0px));
  --content-top: var(--tg-content-safe-area-inset-top, 0px);
  --nav-pad: max(22px, var(--safe-bottom));
}

* { -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  overscroll-behavior: none;
}

body {
  background: #F8FAFC;
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
}

input, textarea { -webkit-user-select: text; user-select: text; }

.boot {
  margin: 40vh 0 0;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #64748B;
}

button { -webkit-appearance: none; appearance: none; touch-action: manipulation; }
button:disabled { cursor: default !important; }
button:focus-visible, input:focus-visible {
  outline: 2px solid #10B981;
  outline-offset: 2px;
}
input:focus { border-color: #10B981 !important; outline: none; }
input::placeholder { color: var(--muted); opacity: .7; font-weight: 600; }
input[type="date"] { -webkit-appearance: none; appearance: none; min-height: 48px; }

/* Ilova qobig'i: mobil kenglik, markazda, Telegram viewport balandligi. */
.shell {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  max-width: 480px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-variant-numeric: tabular-nums;
  transition: background-color 300ms ease;
}

.scroll {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: calc(14px + var(--safe-top) + var(--content-top)) 16px 28px;
}
.scroll::-webkit-scrollbar, .hscroll::-webkit-scrollbar, .sheet::-webkit-scrollbar { display: none; }

.nav {
  position: relative;
  z-index: 10;
  flex: none;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding: 8px 4px var(--nav-pad);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 30px -18px rgba(15, 23, 42, .18);
}

.seg {
  display: grid;
  gap: 4px;
  background: var(--track);
  border-radius: 14px;
  padding: 4px;
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 94%;
  box-sizing: border-box;
  overflow-y: auto;
  scrollbar-width: none;
  overscroll-behavior: contain;
  background: var(--card);
  border-radius: 28px 28px 0 0;
  padding: 8px 16px calc(18px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 -12px 40px rgba(15, 23, 42, .2);
  transition: transform 420ms cubic-bezier(.32, .72, 0, 1);
}

.field {
  height: 48px;
  width: 100%;
  box-sizing: border-box;
  border-radius: 14px;
  border: 1px solid var(--line2);
  background: var(--bg);
  padding: 0 14px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  transition: border-color 150ms ease;
}

.label {
  font-size: 12px;
  font-weight: 700;
  color: var(--sub);
}

.ellipsis {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skel {
  background: var(--line);
  border-radius: 22px;
  animation: skel 1.2s ease-in-out infinite;
}

@keyframes skel {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
  }
}
