/* Базовые токены, обложка приложения клинера, кнопки, шторка, центрированная модалка и лайтбокс */
: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-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --tma-vvh: 100dvh;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body.tma-body {
  background: 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; }
.leaflet-control-attribution, .leaflet-control-zoom { display: none !important; }

@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; }
.lh-center-spinner-box { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 18px 12px; text-align: center; }
.lh-center-spinner-ring { color: var(--tma-text); display: inline-flex; }
.lh-center-spinner-title { font-size: 14px; font-weight: 600; color: var(--tma-text); }

.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%); }

.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: pointer; }
.tma-search-ico { color: var(--tma-muted); font-size: 20px; flex-shrink: 0; }
.tma-search-inp { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 500; color: var(--tma-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.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-fullpage-screen { position: absolute; inset: 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-page-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding: calc(68px + env(safe-area-inset-top, 0px)) 16px calc(96px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 12px; overscroll-behavior-y: contain; }

.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; }
.tma-tab.is-active { 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-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-snap-mode-lbl { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; color: var(--tma-text); }
.tma-compact-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tma-compact-card { background: var(--tma-card-bg); border-radius: 18px; padding: 14px 15px; display: flex; flex-direction: column; gap: 8px; }
.tma-stat-grid-4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tma-stat-box { background: var(--tma-surface); border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.tma-stat-val { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.tma-profile-id-texts { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tma-profile-name { font-size: 17px; line-height: 21px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tma-lock-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tma-lock-tile { border: 0; background: var(--tma-card-bg); border-radius: 16px; padding: 12px 14px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 3px; font-family: inherit; }
.tma-lock-code { font-size: 17px; font-weight: 700; color: var(--tma-text); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tma-center-modal-backdrop { position: fixed; inset: 0; z-index: 560; background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(12px); display: flex; align-items: center; justify-content: center; padding: 16px; }
.tma-center-modal-card { width: min(440px, 95vw); max-height: 88dvh; overflow-y: auto; background: var(--tma-surface); border-radius: 26px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.tma-sheet-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.44); backdrop-filter: blur(6px); z-index: 600; display: flex; align-items: flex-end; justify-content: center; }
.tma-sheet-panel { position: relative; width: 100%; max-width: 500px; background: var(--tma-surface); border-radius: 26px 26px 0 0; padding: 8px 18px calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 8px; overflow-x: hidden; transition: transform 260ms cubic-bezier(0.2, 0.85, 0.25, 1); will-change: transform; }
.tma-sheet-panel::after { content: ""; position: absolute; left: 0; right: 0; top: 99%; height: 260px; background: var(--tma-surface); pointer-events: none; }
.tma-sheet-panel.is-dragging { transition: none !important; }
.tma-sheet-handle-zone { width: 100%; padding: 6px 0 2px; display: flex; justify-content: center; cursor: grab; touch-action: none; }
.tma-sheet-pill { width: 40px; height: 5px; border-radius: 99px; background: rgba(60, 60, 67, 0.2); }
.tma-sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 2px; }
.tma-sheet-body, .tma-sheet-form { display: flex; flex-direction: column; gap: 12px; max-height: 78dvh; overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tma-sheet-body::-webkit-scrollbar, .tma-sheet-form::-webkit-scrollbar { display: none; }

.tma-lightbox { position: fixed; inset: 0; background: rgba(10, 12, 18, 0.95); backdrop-filter: blur(12px); z-index: 680; display: flex; flex-direction: column; justify-content: space-between; }
.tma-lightbox-top { padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 10px; display: flex; justify-content: space-between; align-items: center; color: #fff; font-weight: 600; }
.tma-lightbox-stage { flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 12px; }
.tma-lightbox-img { max-width: 100%; max-height: 82dvh; border-radius: 14px; object-fit: contain; }
.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: 750; }
.is-hidden { display: none !important; }
