:root {
  --tma-bg: #f5f5f7;
  --tma-surface: #ffffff;
  --tma-card-bg: #f2f3f7;
  --tma-field: #ededf2;
  --tma-hover: #e5e6ec;
  --tma-text: #1d1d1f;
  --tma-muted: #6e6e73;
  --tma-primary: #1d1d1f;
  --tma-primary-text: #ffffff;
  --tma-accent: #007aff;
  --tma-accent-bg: rgba(0, 122, 255, 0.1);
  --tma-warn: #d97706;
  --tma-ok: #16a34a;
  --tma-divider: rgba(60, 60, 67, 0.08);
  --tma-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --tma-vvh: 100dvh;
  --tma-sheet-pad: 38dvh;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body.tma-body {
  background-color: var(--tma-bg); color: var(--tma-text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  font-size: 14.5px; line-height: 20px; letter-spacing: -0.01em;
  height: var(--tma-vvh, 100dvh); width: 100vw; max-width: 100vw;
  overflow: hidden !important; overscroll-behavior: none; user-select: none;
  -webkit-font-smoothing: antialiased;
}
.material-symbols-outlined { font-size: 20px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }

/* Монохромный круговой SVG-спиннер (SpinnerEngine) для кнопок и контейнеров TMA */
@keyframes lhGSpinRotate { 100% { transform: rotate(360deg); } }
@keyframes lhGSpinDash {
  0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
  50% { stroke-dasharray: 92, 150; stroke-dashoffset: -35; }
  100% { stroke-dasharray: 92, 150; stroke-dashoffset: -124; }
}
.lh-gspinner { animation: lhGSpinRotate 1.45s linear infinite; display: inline-block; vertical-align: middle; flex-shrink: 0; color: currentColor; }
.lh-gspinner-arc { animation: lhGSpinDash 1.2s ease-in-out infinite; }

.has-scroll-fade-bottom { -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 calc(100% - 26px), transparent 100%); mask-image: linear-gradient(to bottom, #000 0%, #000 calc(100% - 26px), transparent 100%); }
.has-scroll-fade-top { -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 22px, #000 100%); mask-image: linear-gradient(to bottom, transparent 0%, #000 22px, #000 100%); }
.has-scroll-fade-both { -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 22px, #000 calc(100% - 26px), transparent 100%); mask-image: linear-gradient(to bottom, transparent 0%, #000 22px, #000 calc(100% - 26px), transparent 100%); }
.has-hscroll-fade-right { -webkit-mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 24px), transparent 100%); mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 24px), transparent 100%); }
.has-hscroll-fade-left { -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 24px, #000 100%); mask-image: linear-gradient(to right, transparent 0%, #000 24px, #000 100%); }
.has-hscroll-fade-both { -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 20px, #000 calc(100% - 20px), transparent 100%); mask-image: linear-gradient(to right, transparent 0%, #000 20px, #000 calc(100% - 20px), transparent 100%); }

.tma-loader { position: fixed; top: 0; left: 0; right: 0; height: 2.5px; background: var(--tma-primary); z-index: 600; }
.tma-app { position: relative; width: 100%; max-width: 540px; margin: 0 auto; height: var(--tma-vvh, 100dvh); overflow: hidden !important; background: var(--tma-bg); }

.tma-floating-top { position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); left: 14px; right: 14px; z-index: 40; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.tma-top-bar { display: flex; align-items: center; gap: 10px; }
.tma-search-pill {
  pointer-events: auto; flex: 1; height: 46px; padding: 0 14px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08); display: flex; align-items: center; gap: 8px; cursor: text;
}
.tma-search-ico { color: var(--tma-muted); font-size: 20px; flex-shrink: 0; }
.tma-search-inp { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 14.5px; font-weight: 500; color: var(--tma-text); font-family: inherit; }
.tma-search-inp::placeholder { color: var(--tma-muted); font-weight: 400; }
.tma-search-clear { width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--tma-card-bg); color: var(--tma-muted); font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }

.tma-notif-bell-btn {
  pointer-events: auto; position: relative; width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  color: var(--tma-text); box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform 140ms var(--tma-ease);
}
.tma-notif-bell-btn:active { transform: scale(0.92); }
.tma-notif-count { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #ff3b30; color: #ffffff; font-size: 10.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

.tma-countdown-banner { pointer-events: auto; background: rgba(29, 29, 31, 0.92); backdrop-filter: blur(18px); color: #ffffff; padding: 10px 16px; border-radius: 16px; font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tma-fullpage-screen { position: absolute; inset: 0; bottom: 0; z-index: 55; background: var(--tma-bg); display: flex; flex-direction: column; padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); overflow: hidden; }

.tma-bottom-nav {
  position: absolute; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); left: 16px; right: 16px;
  height: 58px; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-radius: 999px; box-shadow: 0 8px 28px rgba(15, 23, 42, 0.1);
  display: grid; grid-template-columns: repeat(4, 1fr); padding: 4px; gap: 4px; z-index: 90;
}
.tma-tab { background: transparent; color: var(--tma-muted); border: 0; outline: 0; height: 50px; border-radius: 999px; font-size: 11px; font-weight: 500; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; transition: background 160ms var(--tma-ease), color 160ms var(--tma-ease); }
.tma-tab.is-active { background: rgba(29, 29, 31, 0.08); color: var(--tma-text); font-weight: 600; }

.tma-btn { width: 100%; height: 46px; padding: 0 18px; border-radius: 16px; border: 0; outline: 0; font-weight: 600; font-size: 14.5px; font-family: inherit; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: transform 120ms var(--tma-ease), background 140ms ease; }
.tma-btn:active { transform: scale(0.98); }
.tma-btn:disabled, .tma-btn.is-busy { opacity: 0.72; cursor: wait; transform: none; }
.tma-btn-primary { background: var(--tma-primary); color: var(--tma-primary-text); }
.tma-btn-accent { background: var(--tma-accent); color: #ffffff; }
.tma-btn-secondary { background: var(--tma-card-bg); color: var(--tma-text); }
.tma-btn-danger { background: rgba(255, 59, 48, 0.12); color: #ff3b30; }
.tma-btn-sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 999px; width: auto; }
.tma-icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--tma-card-bg); color: var(--tma-text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.tma-input, .tma-select { width: 100%; background: var(--tma-card-bg); color: var(--tma-text); border: 0; outline: 0; border-radius: 14px; height: 44px; padding: 0 14px; font-size: 14.5px; font-family: inherit; }
.tma-sub { font-size: 13px; color: var(--tma-muted); line-height: 18px; }
.tma-pill { background: var(--tma-card-bg); color: var(--tma-text); padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.tma-toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); background: rgba(29, 29, 31, 0.94); backdrop-filter: blur(16px); color: #fff; font-weight: 500; padding: 10px 18px; border-radius: 999px; font-size: 13.5px; z-index: 650; }
.is-hidden { display: none !important; }
