:root {
	--lk-primary: #007AFF;
	--lk-primary-hover: #0056CC;
	--lk-bg: #F2F2F7;
	--lk-card-bg: #FFFFFF;
	--lk-text: #1C1C1E;
	--lk-text-secondary: #8E8E93;
	--lk-border: #E5E5EA;
	--lk-success: #34C759;
	--lk-warning: #FF9500;
	--lk-danger: #FF3B30;
	--lk-accent-gradient: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
	--lk-shadow: 0 1px 3px rgba(0,0,0,0.08);
	--lk-shadow-md: 0 4px 12px rgba(0,0,0,0.1);
	--lk-radius: 16px;
	--lk-radius-sm: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body.lk-page {
	font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
	background-color: var(--lk-bg);
	color: var(--lk-text);
	line-height: 1.5;
	min-height: 100vh;
	-webkit-font-smoothing: antialiased;
}

.lk-wrap {
	max-width: 480px;
	margin: 0 auto;
	padding: 0 16px 32px;
}

/* ── Header ── */
.lk-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px 0;
	position: sticky;
	top: 0;
	background: var(--lk-bg);
	z-index: 10;
}

.lk-logo {
	font-size: 20px;
	font-weight: 700;
	color: var(--lk-text);
	text-decoration: none;
}

.lk-logo span { color: var(--lk-primary); }

.lk-header-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

.lk-header-btn {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: none;
	background: var(--lk-card-bg);
	box-shadow: var(--lk-shadow);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 18px;
	color: var(--lk-text-secondary);
	transition: background .2s;
}

.lk-header-btn:hover { background: var(--lk-border); }

/* ── Alert banner ── */
.lk-alert {
	background: #FFF3CD;
	border: 1px solid #FFE69C;
	border-radius: var(--lk-radius-sm);
	padding: 12px 16px;
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 20px;
	font-size: 13px;
	color: #664D03;
}

.lk-alert-icon { font-size: 20px; flex-shrink: 0; }

.lk-alert-close {
	margin-left: auto;
	background: none;
	border: none;
	font-size: 18px;
	cursor: pointer;
	color: #664D03;
	opacity: .6;
	padding: 0;
	line-height: 1;
}

.lk-alert-close:hover { opacity: 1; }

/* ── Balance ── */
.lk-balance-card {
	background: var(--lk-card-bg);
	border-radius: var(--lk-radius);
	padding: 24px;
	text-align: center;
	box-shadow: var(--lk-shadow);
	margin-bottom: 12px;
}

.lk-balance-label {
	font-size: 14px;
	font-weight: 600;
	color: var(--lk-text-secondary);
	text-transform: uppercase;
	letter-spacing: .5px;
}

.lk-balance-value {
	font-size: 48px;
	font-weight: 700;
	color: var(--lk-primary);
	margin: 4px 0 0;
	line-height: 1.1;
}

.lk-balance-currency {
	font-size: 24px;
	font-weight: 400;
	color: var(--lk-text-secondary);
	margin-left: 4px;
}

.lk-balance-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-bottom: 16px;
}

.lk-balance-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	background: var(--lk-card-bg);
	border-radius: var(--lk-radius-sm);
	padding: 16px;
	box-shadow: var(--lk-shadow);
	cursor: pointer;
	border: none;
	font-size: 13px;
	font-weight: 600;
	color: var(--lk-text);
	transition: transform .15s, box-shadow .15s;
	text-decoration: none;
}

.lk-balance-btn:hover {
	transform: translateY(-1px);
	box-shadow: var(--lk-shadow-md);
}

.lk-balance-btn:active { transform: translateY(0); }

.lk-balance-btn-icon {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
}

.lk-balance-btn-icon.topup { background: #E8F5E9; color: var(--lk-success); }
.lk-balance-btn-icon.history { background: #E3F2FD; color: var(--lk-primary); }

/* ── Devices / Keys ── */
.lk-section {
	background: var(--lk-card-bg);
	border-radius: var(--lk-radius);
	padding: 20px;
	box-shadow: var(--lk-shadow);
	margin-bottom: 16px;
}

.lk-section-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
}

.lk-section-title {
	font-size: 18px;
	font-weight: 700;
}

.lk-section-subtitle {
	font-size: 13px;
	color: var(--lk-text-secondary);
	margin-top: 2px;
}

.lk-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 20px;
	border-radius: 10px;
	border: none;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background .2s, transform .1s;
	text-decoration: none;
}

.lk-btn:active { transform: scale(.97); }

.lk-btn-primary {
	background: var(--lk-primary);
	color: #fff;
}

.lk-btn-primary:hover { background: var(--lk-primary-hover); }

.lk-btn-outline {
	background: transparent;
	border: 1.5px solid var(--lk-primary);
	color: var(--lk-primary);
}

.lk-btn-outline:hover { background: rgba(0,122,255,.06); }

.lk-btn-sm {
	padding: 8px 14px;
	font-size: 13px;
	border-radius: 8px;
}

.lk-btn-block {
	width: 100%;
	justify-content: center;
}

.lk-btn-success {
	background: var(--lk-success);
	color: #fff;
}

.lk-btn-success:hover { background: #2DB84D; }

/* ── Subscription card ── */
.lk-sub-card {
	border: 1px solid var(--lk-border);
	border-radius: var(--lk-radius-sm);
	padding: 16px;
	margin-bottom: 12px;
}

.lk-sub-card:last-child { margin-bottom: 0; }

.lk-sub-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 10px;
}

.lk-sub-name {
	font-weight: 600;
	font-size: 15px;
}

.lk-sub-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 10px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
}

.lk-sub-badge.active {
	background: #E8F5E9;
	color: var(--lk-success);
}

.lk-sub-badge.expired {
	background: #FFEBEE;
	color: var(--lk-danger);
}

.lk-sub-info {
	font-size: 13px;
	color: var(--lk-text-secondary);
	margin-bottom: 12px;
}

.lk-sub-info span { display: block; margin-bottom: 4px; }

.lk-sub-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.lk-sub-url {
	background: var(--lk-bg);
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 12px;
	font-family: 'SF Mono', 'Menlo', monospace;
	word-break: break-all;
	color: var(--lk-text-secondary);
	margin-bottom: 10px;
	cursor: pointer;
	position: relative;
	transition: background .2s;
}

.lk-sub-url:hover { background: var(--lk-border); }

.lk-sub-url::after {
	content: 'Скопировано!';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: var(--lk-success);
	color: #fff;
	padding: 4px 12px;
	border-radius: 6px;
	font-size: 12px;
	font-family: -apple-system, sans-serif;
	opacity: 0;
	transition: opacity .2s;
	pointer-events: none;
}

.lk-sub-url.copied::after { opacity: 1; }

/* ── Tariff hint ── */
.lk-tariff-hint {
	text-align: center;
	font-size: 13px;
	color: var(--lk-text-secondary);
	margin-bottom: 16px;
}

/* ── Referral ── */
.lk-referral-card {
	background: var(--lk-accent-gradient);
	border-radius: var(--lk-radius);
	padding: 24px;
	text-align: center;
	color: #fff;
	margin-bottom: 16px;
	box-shadow: var(--lk-shadow-md);
}

.lk-referral-emoji { font-size: 36px; margin-bottom: 8px; }

.lk-referral-title {
	font-size: 17px;
	font-weight: 700;
	margin-bottom: 6px;
}

.lk-referral-desc {
	font-size: 13px;
	opacity: .85;
	margin-bottom: 16px;
	line-height: 1.4;
}

.lk-referral-stats {
	display: flex;
	justify-content: center;
	gap: 24px;
	margin-bottom: 16px;
}

.lk-referral-stat { text-align: center; }

.lk-referral-stat-value {
	font-size: 22px;
	font-weight: 700;
}

.lk-referral-stat-label {
	font-size: 11px;
	opacity: .75;
	text-transform: uppercase;
}

.lk-referral-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 14px;
	border-radius: 12px;
	border: none;
	background: rgba(255,255,255,.2);
	backdrop-filter: blur(10px);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: background .2s;
}

.lk-referral-btn:hover { background: rgba(255,255,255,.3); }

/* ── Instructions ── */
.lk-instructions {
	background: var(--lk-card-bg);
	border-radius: var(--lk-radius);
	overflow: hidden;
	box-shadow: var(--lk-shadow);
	margin-bottom: 16px;
}

.lk-instructions-title {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: var(--lk-text-secondary);
	padding: 16px 20px 8px;
}

.lk-instruction-item {
	display: flex;
	align-items: center;
	padding: 14px 20px;
	border-top: 1px solid var(--lk-border);
	cursor: pointer;
	text-decoration: none;
	color: var(--lk-text);
	transition: background .15s;
}

.lk-instruction-item:first-of-type { border-top: none; }
.lk-instruction-item:hover { background: var(--lk-bg); }

.lk-instruction-icon {
	width: 36px;
	height: 36px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	margin-right: 14px;
	flex-shrink: 0;
}

.lk-instruction-icon.ios { background: #F2F2F7; }
.lk-instruction-icon.android { background: #E8F5E9; }
.lk-instruction-icon.windows { background: #E3F2FD; }

.lk-instruction-name {
	flex: 1;
	font-size: 15px;
	font-weight: 500;
}

.lk-instruction-arrow {
	color: var(--lk-text-secondary);
	font-size: 18px;
}

/* ── Empty state ── */
.lk-empty {
	text-align: center;
	padding: 32px 16px;
}

.lk-empty-icon { font-size: 48px; margin-bottom: 12px; }

.lk-empty-title {
	font-size: 17px;
	font-weight: 600;
	margin-bottom: 6px;
}

.lk-empty-desc {
	font-size: 14px;
	color: var(--lk-text-secondary);
	margin-bottom: 20px;
}

/* ── Modal ── */
.lk-modal-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.4);
	z-index: 100;
	align-items: flex-end;
	justify-content: center;
}

.lk-modal-overlay.active { display: flex; }

.lk-modal {
	background: var(--lk-card-bg);
	border-radius: 20px 20px 0 0;
	width: 100%;
	max-width: 480px;
	max-height: 85vh;
	overflow-y: auto;
	padding: 24px;
	animation: lk-modal-slide .3s ease;
}

@keyframes lk-modal-slide {
	from { transform: translateY(100%); }
	to { transform: translateY(0); }
}

.lk-modal-handle {
	width: 36px;
	height: 4px;
	background: var(--lk-border);
	border-radius: 2px;
	margin: 0 auto 16px;
}

.lk-modal-title {
	font-size: 20px;
	font-weight: 700;
	margin-bottom: 20px;
	text-align: center;
}

/* ── Form ── */
.lk-form-group {
	margin-bottom: 16px;
}

.lk-form-label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--lk-text-secondary);
	margin-bottom: 6px;
}

.lk-form-input {
	width: 100%;
	padding: 14px 16px;
	border: 1.5px solid var(--lk-border);
	border-radius: 12px;
	font-size: 16px;
	background: var(--lk-bg);
	color: var(--lk-text);
	transition: border-color .2s;
	outline: none;
}

.lk-form-input:focus { border-color: var(--lk-primary); }

.lk-form-input::placeholder { color: var(--lk-text-secondary); }

/* ── Topup amounts ── */
.lk-topup-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
	margin-bottom: 16px;
}

.lk-topup-option {
	padding: 14px 8px;
	border: 1.5px solid var(--lk-border);
	border-radius: 12px;
	text-align: center;
	cursor: pointer;
	font-size: 16px;
	font-weight: 600;
	background: var(--lk-card-bg);
	color: var(--lk-text);
	transition: border-color .2s, background .2s;
}

.lk-topup-option:hover { border-color: var(--lk-primary); }
.lk-topup-option.selected {
	border-color: var(--lk-primary);
	background: rgba(0,122,255,.06);
	color: var(--lk-primary);
}

/* ── Plans grid ── */
.lk-plans-grid {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 16px;
}

.lk-plan-option {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px;
	border: 1.5px solid var(--lk-border);
	border-radius: 12px;
	cursor: pointer;
	transition: border-color .2s, background .2s;
}

.lk-plan-option:hover { border-color: var(--lk-primary); }
.lk-plan-option.selected {
	border-color: var(--lk-primary);
	background: rgba(0,122,255,.06);
}

.lk-plan-name { font-weight: 600; font-size: 15px; }
.lk-plan-price { font-weight: 700; color: var(--lk-primary); font-size: 16px; }

/* ── History list ── */
.lk-history-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 14px 0;
	border-bottom: 1px solid var(--lk-border);
}

.lk-history-item:last-child { border-bottom: none; }

.lk-history-desc { font-size: 14px; font-weight: 500; }
.lk-history-date { font-size: 12px; color: var(--lk-text-secondary); }
.lk-history-amount { font-weight: 600; font-size: 15px; }
.lk-history-amount.credit { color: var(--lk-success); }
.lk-history-amount.debit { color: var(--lk-danger); }

/* ── Landing page ── */
.lk-landing {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	padding: 40px 16px;
	text-align: center;
}

.lk-landing-logo {
	font-size: 32px;
	font-weight: 800;
	margin-bottom: 12px;
}

.lk-landing-logo span { color: var(--lk-primary); }

.lk-landing-tagline {
	font-size: 17px;
	color: var(--lk-text-secondary);
	margin-bottom: 40px;
	max-width: 320px;
}

.lk-landing-card {
	background: var(--lk-card-bg);
	border-radius: var(--lk-radius);
	padding: 32px 24px;
	width: 100%;
	max-width: 400px;
	box-shadow: var(--lk-shadow-md);
	margin-bottom: 20px;
}

.lk-landing-card h2 {
	font-size: 20px;
	font-weight: 700;
	margin-bottom: 20px;
}

.lk-landing-features {
	list-style: none;
	padding: 0;
	margin: 24px 0;
	text-align: left;
}

.lk-landing-features li {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 0;
	font-size: 14px;
	border-bottom: 1px solid var(--lk-border);
}

.lk-landing-features li:last-child { border-bottom: none; }

.lk-landing-features .feat-icon {
	width: 32px;
	height: 32px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	flex-shrink: 0;
	background: var(--lk-bg);
}

.lk-landing-or {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 20px 0;
	color: var(--lk-text-secondary);
	font-size: 13px;
}

.lk-landing-or::before,
.lk-landing-or::after {
	content: '';
	flex: 1;
	height: 1px;
	background: var(--lk-border);
}

.lk-landing-footer {
	font-size: 13px;
	color: var(--lk-text-secondary);
}

.lk-landing-footer a {
	color: var(--lk-primary);
	text-decoration: none;
}

/* ── Toast ── */
.lk-toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%) translateY(100px);
	background: var(--lk-text);
	color: #fff;
	padding: 12px 24px;
	border-radius: 12px;
	font-size: 14px;
	font-weight: 500;
	z-index: 200;
	opacity: 0;
	transition: transform .3s, opacity .3s;
	white-space: nowrap;
}

.lk-toast.show {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* ── Loading ── */
.lk-spinner {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 2px solid rgba(255,255,255,.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: lk-spin .6s linear infinite;
}

@keyframes lk-spin {
	to { transform: rotate(360deg); }
}

.lk-btn.loading {
	pointer-events: none;
	opacity: .7;
}

/* ── Flash messages ── */
.lk-flash {
	padding: 12px 16px;
	border-radius: var(--lk-radius-sm);
	margin-bottom: 16px;
	font-size: 14px;
	font-weight: 500;
}

.lk-flash.success {
	background: #E8F5E9;
	color: #1B5E20;
}

.lk-flash.error {
	background: #FFEBEE;
	color: #B71C1C;
}

.lk-flash.info {
	background: #E3F2FD;
	color: #0D47A1;
}

@media (min-width: 481px) {
	.lk-modal {
		border-radius: 20px;
		margin-bottom: 40px;
	}

	.lk-modal-overlay {
		align-items: center;
	}
}
