.kz24-reader-widget.kz24-is-loading {
	opacity: 0;
	pointer-events: none;
}

.kz24-reader-widget.kz24-ready {
	opacity: 1;
	pointer-events: auto;
	transition: opacity 0.25s ease;
}

.kz24-reader-widget {
	--kz24-primary: #002e70;
	--kz24-accent: #0056c3;
	--kz24-accent-soft: rgba(0, 86, 195, 0.12);
	--kz24-primary-soft: rgba(0, 46, 112, 0.08);
	--kz24-gold: #d4a017;
	--kz24-gold-light: #f5d76e;
	--kz24-gold-dark: #9a7209;
	--kz24-gold-text: #5c4208;
	--kz24-bubble-size: 56px;
	--kz24-radius: 12px;
	position: fixed;
	z-index: 99990;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 12px;
	line-height: 1.35;
	color: #1a2a3a;
	-webkit-font-smoothing: antialiased;
}

@media (min-width: 768px) {
	.kz24-reader-widget {
		left: 20px !important;
		right: auto !important;
		bottom: 24px !important;
		top: auto !important;
	}
}

.kz24-pos-bottom-right { right: 16px; bottom: 16px; }
.kz24-pos-bottom-left { left: 16px; bottom: 16px; }
.kz24-pos-top-right { right: 16px; top: 80px; }
.kz24-pos-top-left { left: 16px; top: 80px; }

/* ——— Кружок (режим по умолчанию) ——— */

.kz24-bubble {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--kz24-bubble-size);
	height: var(--kz24-bubble-size);
	padding: 0;
	border: none;
	border-radius: 50%;
	background: #fff;
	box-shadow:
		0 2px 10px rgba(0, 46, 112, 0.1),
		0 0 0 1px rgba(0, 46, 112, 0.06);
	cursor: pointer;
	color: var(--kz24-accent);
	transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.25s ease;
}

.kz24-bubble:hover {
	transform: scale(1.05);
	box-shadow:
		0 4px 16px rgba(0, 86, 195, 0.18),
		0 0 0 1px rgba(0, 86, 195, 0.1);
}

.kz24-bubble:active {
	transform: scale(0.97);
}

.kz24-reader-widget.kz24-mode-expanded .kz24-bubble {
	display: none;
}

.kz24-bubble-ring {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	transform: rotate(-90deg);
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.kz24-bubble-ring-bg {
	fill: none;
	stroke: #e8edf3;
	stroke-width: 3;
}

.kz24-bubble-ring-fill {
	fill: none;
	stroke: var(--kz24-accent);
	stroke-width: 3;
	stroke-linecap: round;
	stroke-dasharray: 119.38;
	stroke-dashoffset: 119.38;
	transition: stroke-dashoffset 0.5s ease;
}

.kz24-bubble-timer {
	position: relative;
	z-index: 1;
	font-size: 12px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.02em;
	line-height: 1;
	color: var(--kz24-accent);
	text-align: center;
	max-width: 40px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.kz24-bubble-prize {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	pointer-events: none;
}

.kz24-bubble-prize svg {
	display: block;
	width: 22px;
	height: 22px;
}

.kz24-bubble-prize[hidden],
.kz24-bubble-timer[hidden] {
	display: none !important;
}

.kz24-bubble.kz24-has-prize {
	background: linear-gradient(180deg, #1a73e8 0%, var(--kz24-accent) 55%, #0048a8 100%);
	color: #fff;
	box-shadow:
		0 4px 14px rgba(0, 86, 195, 0.35),
		0 0 0 1px rgba(255, 255, 255, 0.15);
	animation: kz24-prize-glow-pulse 30s ease-in-out infinite;
}

.kz24-bubble.kz24-has-prize .kz24-bubble-prize {
	animation: kz24-prize-shake 30s ease-in-out infinite;
}

.kz24-bubble.kz24-has-prize .kz24-bubble-ring {
	opacity: 0;
}

.kz24-bubble.kz24-has-prize:hover {
	box-shadow:
		0 6px 20px rgba(0, 86, 195, 0.45),
		0 0 0 1px rgba(255, 255, 255, 0.2);
}

/* Вспышка + дрожание раз в 30 с */
@keyframes kz24-prize-shake {
	0%, 96.5%, 100% {
		transform: translate(0, 0) rotate(0);
	}
	97% {
		transform: translate(-2px, 0) rotate(-5deg);
	}
	97.6% {
		transform: translate(2px, -1px) rotate(5deg);
	}
	98.2% {
		transform: translate(-2px, 1px) rotate(-4deg);
	}
	98.8% {
		transform: translate(2px, 0) rotate(4deg);
	}
	99.4% {
		transform: translate(-1px, 0) rotate(-2deg);
	}
}

@keyframes kz24-prize-glow-pulse {
	0%, 96.5%, 100% {
		box-shadow:
			0 4px 14px rgba(0, 86, 195, 0.35),
			0 0 0 1px rgba(255, 255, 255, 0.15);
	}
	97%, 99.5% {
		box-shadow:
			0 8px 26px rgba(0, 86, 195, 0.55),
			0 0 0 8px rgba(0, 86, 195, 0.14);
	}
}

@media (prefers-reduced-motion: reduce) {
	.kz24-bubble.kz24-has-prize,
	.kz24-bubble.kz24-has-prize .kz24-bubble-prize {
		animation: none;
	}
}

/* ——— Полная панель ——— */

.kz24-reader-panel {
	position: relative;
	background: #fff;
	border: 1px solid rgba(0, 46, 112, 0.1);
	border-radius: 16px;
	box-shadow:
		0 4px 12px rgba(0, 46, 112, 0.06),
		0 16px 40px rgba(0, 46, 112, 0.12);
	width: 312px;
	max-width: calc(100vw - 24px);
	padding: 0;
	overflow: visible;
	animation: kz24-panel-in 0.22s ease;
}

@keyframes kz24-panel-in {
	from { opacity: 0; transform: translateY(8px) scale(0.96); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

.kz24-reader-panel[hidden] {
	display: none !important;
}

.kz24-btn-collapse-tab {
	position: absolute;
	right: -13px;
	top: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 44px;
	padding: 0;
	margin: 0;
	border: 1px solid rgba(0, 46, 112, 0.12);
	border-left: none;
	border-radius: 0 22px 22px 0;
	background: #fff;
	box-shadow: 2px 0 10px rgba(0, 46, 112, 0.08);
	color: var(--kz24-accent);
	cursor: pointer;
	transform: translateY(-50%);
	transition: background 0.15s, color 0.15s;
}

.kz24-btn-collapse-tab:hover {
	background: #f7faff;
	color: var(--kz24-primary);
}

.kz24-panel-body {
	padding: 16px 18px 14px;
}

/* ——— Контент панели ——— */

.kz24-reader-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 6px 8px;
	margin-bottom: 12px;
	min-width: 0;
	min-height: 24px;
}

.kz24-chip {
	display: inline-flex;
	align-items: center;
	font-weight: 600;
	line-height: 1.2;
	min-width: 0;
	max-width: 100%;
}

.kz24-chip-name {
	flex: 1 1 auto;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	gap: 5px;
	padding: 5px 10px 5px 8px;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--kz24-primary), var(--kz24-accent));
	color: #fff;
	font-size: 12px;
}

.kz24-chip-icon {
	flex-shrink: 0;
	opacity: 0.95;
}

.kz24-chip-name-text {
	overflow: hidden;
	text-overflow: ellipsis;
}

.kz24-chip-status {
	flex: 0 1 auto;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	padding: 5px 10px;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--kz24-gold-light), var(--kz24-gold) 55%, var(--kz24-gold-dark));
	color: var(--kz24-gold-text);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
	font-size: 12px;
}

.kz24-reader-widget:not(.kz24-has-meta-name) .kz24-chip-status {
	flex: 1 1 100%;
}

.kz24-chip-status[hidden] {
	display: none !important;
}

.kz24-hero-stat {
	text-align: center;
	margin-bottom: 10px;
}

.kz24-hero-num {
	display: block;
	font-size: 36px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.03em;
	line-height: 1;
	color: #0d1f33;
}

.kz24-hero-label {
	display: block;
	margin-top: 5px;
	font-size: 13px;
	font-weight: 600;
	color: var(--kz24-accent);
	letter-spacing: 0;
	line-height: 1.35;
	white-space: normal;
}

.kz24-progress {
	height: 6px;
	background: #e8edf3;
	border-radius: 99px;
	overflow: hidden;
	margin: 0;
}

.kz24-progress[hidden] {
	display: none !important;
}

.kz24-progress-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--kz24-primary), var(--kz24-accent));
	border-radius: 99px;
	transition: width 0.5s ease;
}

.kz24-sub-stat {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding-top: 10px;
	margin-top: 10px;
	border-top: 1px solid #e8edf3;
}

.kz24-sub-icon {
	flex-shrink: 0;
	color: var(--kz24-accent);
}

.kz24-sub-num {
	font-size: 15px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: var(--kz24-primary);
}

.kz24-sub-label {
	font-size: 13px;
	font-weight: 500;
	color: #7a8fa8;
}

.kz24-panel-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	margin-top: 12px;
}

.kz24-panel-actions[hidden] {
	display: none !important;
}

.kz24-action-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 56px;
	padding: 8px 6px;
	border: 1px solid #dce4ed;
	border-radius: 12px;
	background: #fff;
	color: var(--kz24-primary);
	font-family: inherit;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.25;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s;
	-webkit-tap-highlight-color: transparent;
}

.kz24-action-btn:hover,
.kz24-action-btn:focus-visible {
	border-color: var(--kz24-accent);
	background: #f7faff;
	outline: none;
}

.kz24-action-btn svg {
	flex-shrink: 0;
	color: var(--kz24-accent);
}

.kz24-action-btn[hidden] {
	display: none !important;
}

.kz24-panel-actions:has(.kz24-btn-profile[hidden]) .kz24-btn-table:not([hidden]),
.kz24-panel-actions:has(.kz24-btn-table[hidden]) .kz24-btn-profile:not([hidden]) {
	grid-column: 1 / -1;
}

/* ——— Формы ——— */

.kz24-reader-form {
	display: flex;
	flex-direction: column;
	gap: 5px;
	margin-top: 0;
	padding: 10px 18px 14px;
	border-top: 1px solid rgba(0, 46, 112, 0.08);
}

.kz24-reader-form[hidden] {
	display: none !important;
}

.kz24-form-title {
	font-size: 11px;
	font-weight: 600;
	margin: 0;
	color: #3d5166;
}

.kz24-form-hint {
	font-size: 10px;
	color: #8a9baa;
	margin: 0;
}

.kz24-reader-form input[type="text"],
.kz24-reader-form input[type="tel"] {
	width: 100%;
	box-sizing: border-box;
	padding: 7px 9px;
	border: 1px solid #e2e8ee;
	border-radius: 8px;
	font-size: 13px;
	background: #fafbfc;
}

.kz24-reader-form input:focus {
	outline: none;
	border-color: var(--kz24-accent);
	box-shadow: 0 0 0 3px var(--kz24-accent-soft);
	background: #fff;
}

.kz24-checkbox-label {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	font-size: 10px;
	color: #6b7c8a;
	cursor: pointer;
}

.kz24-btn {
	display: inline-block;
	padding: 7px 12px;
	border-radius: 8px;
	font-size: 11px;
	font-weight: 600;
	cursor: pointer;
	border: none;
}

.kz24-btn-primary {
	background: linear-gradient(135deg, var(--kz24-primary), var(--kz24-accent));
	color: #fff;
	width: 100%;
}

.kz24-btn-link {
	background: none;
	color: var(--kz24-accent);
	padding: 0;
	font-size: 10px;
	font-weight: 500;
}

.kz24-form-error {
	color: #c0392b;
	font-size: 10px;
	margin: 0;
}

.kz24-form-error[hidden] {
	display: none !important;
}

.kz24-suggestions {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 10px;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.kz24-suggestions[hidden] {
	display: none !important;
}

.kz24-restore-link-wrap {
	margin: 0;
	padding: 0 18px 14px;
}

.kz24-restore-link-wrap[hidden] {
	display: none !important;
}

@media (max-width: 767px) {
	.kz24-reader-widget {
		--kz24-bubble-size: 39px;
		top: auto !important;
		left: max(12px, env(safe-area-inset-left)) !important;
		right: auto !important;
		bottom: max(12px, env(safe-area-inset-bottom)) !important;
	}

	.kz24-bubble-timer {
		font-size: 9px;
		max-width: 28px;
	}

	.kz24-bubble-prize svg {
		width: 15px;
		height: 15px;
	}

	.kz24-reader-widget.kz24-mode-expanded {
		left: 0 !important;
		right: 0 !important;
		bottom: 0 !important;
		width: 100%;
	}

	.kz24-reader-widget.kz24-mode-expanded .kz24-reader-panel {
		width: 100%;
		max-width: 100%;
		border-radius: 16px 16px 0 0;
		border-left: none;
		border-right: none;
		border-bottom: none;
		box-shadow: 0 -8px 32px rgba(0, 46, 112, 0.14);
		padding-bottom: env(safe-area-inset-bottom, 0);
		animation: kz24-panel-in-mobile 0.28s ease;
	}

	@keyframes kz24-panel-in-mobile {
		from { opacity: 0; transform: translateY(100%); }
		to { opacity: 1; transform: translateY(0); }
	}

	.kz24-reader-widget.kz24-mode-expanded .kz24-btn-collapse-tab {
		top: 14px;
		right: 14px;
		bottom: auto;
		transform: none;
		width: 34px;
		height: 34px;
		border: 1px solid rgba(0, 46, 112, 0.12);
		border-radius: 8px;
		box-shadow: none;
	}

	.kz24-reader-panel {
		width: min(300px, calc(100vw - 32px));
		border-radius: 14px;
	}

	.kz24-panel-body {
		padding: 14px 16px 12px;
	}

	.kz24-reader-widget.kz24-mode-expanded .kz24-panel-body {
		padding: 14px 52px max(14px, env(safe-area-inset-bottom)) 16px;
	}

	.kz24-hero-num {
		font-size: 30px;
	}

	.kz24-hero-label {
		font-size: 12px;
	}

	.kz24-chip-name {
		font-size: 24px;
		padding: 10px 20px 10px 16px;
	}

	.kz24-chip-name .kz24-chip-icon {
		width: 20px;
		height: 20px;
	}

	.kz24-chip-status {
		font-size: 26px;
		padding: 12px 24px;
	}

	.kz24-reader-widget:not(.kz24-has-meta-name) .kz24-chip-status {
		font-size: 28px;
		padding: 14px 24px;
	}

	.kz24-btn-collapse-tab {
		width: 28px;
		height: 48px;
		right: -14px;
	}

	.kz24-action-btn {
		min-height: 48px;
		font-size: 10px;
		padding: 6px 4px;
	}

	.kz24-reader-form {
		padding: 10px 16px max(12px, env(safe-area-inset-bottom));
	}

	.kz24-reader-widget.kz24-mode-expanded .kz24-reader-form {
		padding-left: 16px;
		padding-right: 16px;
	}
}

@media (max-width: 359px) {
	.kz24-panel-actions {
		grid-template-columns: 1fr;
	}

	.kz24-panel-actions .kz24-action-btn {
		grid-column: auto;
		flex-direction: row;
		justify-content: center;
		min-height: 44px;
	}
}
