:root {
  --bg: #FFFFFF;
  --surface: #F6F6F6;
  --text: #000000;
  --muted: #6B6B6B;
  --line: #E2E2E2;
  --brand: #000000;
  --ok: #05A357;
  --danger: #E11900;
  --radius: 12px;
  --radius-lg: 24px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; outline: none; }
html { background: var(--bg); font-size: 16px; }
body { margin: 0; min-height: 100svh; background: var(--bg); color: var(--text); font-family: 'Inter', system-ui, -apple-system, sans-serif; overflow-x: hidden; }
button, input, select { font: inherit; border: none; background: none; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { width: 1.5rem; height: 1.5rem; display: block; stroke-width: 1.5; }

/* SHELL & ANIMATIONS */
.native-shell { min-height: 100svh; width: 100vw; display: flex; flex-direction: column; animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* TYPOGRAPHY */
h1 { font-size: 2.25rem; font-weight: 700; letter-spacing: -0.04em; margin: 0 0 12px 0; line-height: 1.1; }
h2 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 8px 0; }
p { margin: 0 0 16px 0; color: var(--muted); line-height: 1.5; font-size: 1rem; }

/* BUTTONS */
.primary-action, .secondary-action { width: 100%; height: 56px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 1.05rem; transition: transform 0.1s, opacity 0.2s; }
.primary-action { background: var(--brand); color: #fff; }
.primary-action:active { transform: scale(0.98); }
.primary-action:disabled { opacity: 0.5; }
.secondary-action { background: var(--surface); color: var(--text); }
.secondary-action.danger { color: var(--danger); background: #FFF0F0; }

/* ONBOARDING SLIDER (SWIPE) */
.onboarding-screen { flex: 1; display: flex; flex-direction: column; }
.slider-container { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; flex: 1; scrollbar-width: none; }
.slider-container::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; width: 100vw; scroll-snap-align: start; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px 24px; text-align: center; }
.slide-image { width: 160px; height: 160px; object-fit: contain; margin-bottom: 32px; filter: drop-shadow(0 12px 24px rgba(0,0,0,0.06)); }
.onboarding-footer { padding: 24px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.dots { display: flex; justify-content: center; gap: 8px; margin-bottom: 24px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); transition: background 0.3s, width 0.3s; }
.dot.active { background: var(--brand); width: 24px; border-radius: 4px; }

/* AUTH SCREENS & HERO */
.screen-pad { padding: 24px; padding-top: calc(40px + env(safe-area-inset-top)); flex: 1; display: flex; flex-direction: column; }
.back-btn { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: var(--surface); border-radius: 50%; margin-bottom: 24px; margin-left: -8px; }

.auth-choice-container { display: flex; flex-direction: column; height: 100%; }
.auth-hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.hero-image { width: 140px; height: 140px; object-fit: contain; margin-bottom: 24px; animation: float 4s ease-in-out infinite; filter: drop-shadow(0 16px 32px rgba(0,0,0,0.08)); }
@keyframes float { 0% { transform: translateY(0px); } 50% { transform: translateY(-12px); } 100% { transform: translateY(0px); } }

.auth-choice-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding-bottom: env(safe-area-inset-bottom); }

.native-form { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }
.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-group label { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.native-form input, .native-form select { width: 100%; height: 56px; background: var(--surface); border-radius: var(--radius); padding: 0 16px; font-size: 1rem; color: var(--text); transition: box-shadow 0.2s; }
.native-form input:focus, .native-form select:focus { background: #fff; box-shadow: 0 0 0 2px var(--brand); }

/* CIRCUIT PICKER */
.search-wrapper { position: relative; margin-bottom: 16px; }
.search-wrapper svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-wrapper input { padding-left: 48px; background: var(--bg); border: 2px solid var(--line); }
.search-wrapper input:focus { border-color: var(--brand); box-shadow: none; }
.circuit-list { display: flex; flex-direction: column; gap: 8px; max-height: 40vh; overflow-y: auto; margin-bottom: 24px; }
.circuit-chip { display: flex; justify-content: space-between; align-items: center; padding: 16px; background: var(--surface); border-radius: var(--radius); text-align: left; transition: background 0.2s; border: 2px solid transparent; }
.circuit-chip strong { font-weight: 600; font-size: 1rem; color: var(--text); }
.circuit-chip span { font-size: 0.85rem; color: var(--muted); }
.circuit-chip.selected { border-color: var(--brand); background: #fff; }

/* ANIMATION SCREEN (CHECKOUT VERDE) */
.anim-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100svh; text-align: center; padding: 24px; }
.pulse-ring { width: 100px; height: 100px; border-radius: 50%; background: var(--surface); display: flex; align-items: center; justify-content: center; position: relative; margin-bottom: 32px; }
.pulse-ring::after { content: ''; position: absolute; width: 100%; height: 100%; border-radius: 50%; border: 2px solid var(--brand); animation: pulse 1.5s infinite ease-out; }
@keyframes pulse { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
.success-ring { width: 100px; height: 100px; border-radius: 50%; background: var(--ok); color: #fff; display: flex; align-items: center; justify-content: center; margin-bottom: 32px; animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.success-ring svg { width: 48px; height: 48px; }
@keyframes popIn { 0% { transform: scale(0); } 100% { transform: scale(1); } }

/* DASHBOARD */
.dashboard-layout { padding: 24px; padding-top: calc(40px + env(safe-area-inset-top)); padding-bottom: 100px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.topbar p { margin: 0; text-transform: uppercase; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; color: var(--muted); }
.topbar h1 { font-size: 1.75rem; margin: 4px 0 0 0; }
.icon-btn { width: 44px; height: 44px; background: var(--surface); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--brand); }

.status-card { background: var(--surface); border-radius: var(--radius-lg); padding: 24px; position: relative; overflow: hidden; margin-bottom: 16px; }
.status-card.danger { background: var(--brand); color: #fff; }
.status-card.ok { background: var(--ok); color: #fff; }
.status-card p { color: inherit; opacity: 0.8; }
.status-label { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; display: flex; align-items: center; gap: 8px; margin-bottom: 16px; opacity: 0.9; }
.status-label span { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.telegram-msg { background: rgba(0,0,0,0.05); padding: 16px; border-radius: var(--radius); font-family: monospace; font-size: 0.9rem; margin-top: 16px; white-space: pre-wrap; line-height: 1.4; }
.status-card.danger .telegram-msg, .status-card.ok .telegram-msg { background: rgba(255,255,255,0.1); }

.panel { margin-top: 24px; }
.panel h2 { font-size: 1.5rem; margin-bottom: 4px; }
.timeline { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.timeline-item { padding: 16px; background: var(--surface); border-radius: var(--radius); border-left: 4px solid var(--muted); }
.timeline-item.danger { border-left-color: var(--danger); }
.timeline-item.ok { border-left-color: var(--ok); }
.timeline-date { font-size: 0.8rem; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.timeline-item p { margin: 0; color: var(--text); font-size: 0.95rem; }

/* TABBAR */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; height: calc(70px + env(safe-area-inset-bottom)); background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); border-top: 1px solid var(--line); display: flex; justify-content: space-around; align-items: flex-start; padding-top: 12px; }
.tab-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.tab-btn.active { color: var(--brand); }
.tab-btn svg { width: 24px; height: 24px; }

/* NOTICES & LOADERS */
.notice { margin-top: 16px; padding: 16px; border-radius: var(--radius); font-size: 0.9rem; font-weight: 500; display: none; }
.notice.info { display: block; background: var(--surface); color: var(--text); }
.notice.bad { display: block; background: #FFF0F0; color: var(--danger); }
.notice.ok { display: block; background: #EAF7F1; color: var(--ok); }
.loader-spinner { width: 32px; height: 32px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.8s linear infinite; margin: auto; }
@keyframes spin { to { transform: rotate(360deg); } }