/* ============================================================
 *  КАЛЬКУЛЯТОР АЛКОГОЛЯ — стили frontend + admin
 * ========================================================== */

.ac-wrapper {
	max-width: 640px;
	margin: 0 auto;
	padding: 16px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	color: #1f2937;
	box-sizing: border-box;
}
.ac-wrapper * { box-sizing: border-box; }

.ac-title {
	font-size: 26px;
	font-weight: 800;
	text-align: center;
	margin: 0 0 20px;
	color: #1f2937;
}

/* ===== Карточки ===== */
.ac-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	padding: 18px 20px;
	margin-bottom: 16px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}
.ac-card-title {
	font-size: 17px;
	font-weight: 700;
	margin: 0 0 14px;
	color: #1f2937;
}

/* ===== Поля ===== */
.ac-field {
	margin-bottom: 14px;
}
.ac-field:last-child { margin-bottom: 0; }
.ac-field > label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 6px;
	color: #374151;
}
.ac-field input[type="number"],
.ac-field input[type="text"] {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 15px;
	transition: border-color .15s, box-shadow .15s;
}
.ac-field input:focus {
	outline: none;
	border-color: #6366f1;
	box-shadow: 0 0 0 3px rgba(99, 102, 241, .15);
}

/* ===== Пол (радио) ===== */
.ac-gender {
	display: flex;
	gap: 20px;
}
.ac-radio {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
}

/* ===== Список напитков (frontend) ===== */
.ac-drink-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 0;
	border-bottom: 1px solid #f3f4f6;
}
.ac-drink-item:last-child { border-bottom: none; }
.ac-drink-item select,
.ac-drink-item input {
	padding: 8px 10px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 14px;
}
.ac-drink-item select { flex: 1; }
.ac-drink-item input { width: 90px; }
.ac-drink-remove {
	background: #fee2e2;
	color: #dc2626;
	border: none;
	border-radius: 8px;
	width: 34px;
	height: 34px;
	font-size: 18px;
	cursor: pointer;
	line-height: 1;
	transition: background .15s;
}
.ac-drink-remove:hover { background: #fecaca; }

/* ============================================================
 *  СЦЕНАРИИ (аккуратная сетка)
 * ========================================================== */
.ac-hint {
	font-size: 13px;
	color: #6b7280;
	margin: 0 0 12px;
}
.ac-presets {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 16px;
}
.ac-preset-btn {
	background: #eef2ff;
	color: #4338ca;
	border: 1px solid #c7d2fe;
	border-radius: 20px;
	padding: 7px 14px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s;
}
.ac-preset-btn:hover { background: #e0e7ff; }

.ac-scenario-item {
	position: relative;
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-left: 4px solid #6366f1;
	border-radius: 10px;
	padding: 14px 14px 14px 16px;
	margin-bottom: 12px;
}

/* Заголовок сценария: имя + кнопка удаления */
.ac-scenario-head {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
}
.ac-scenario-name {
	flex: 1;
	padding: 8px 11px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	color: #1f2937;
	background: #fff;
}
.ac-scenario-name:focus {
	outline: none;
	border-color: #6366f1;
	box-shadow: 0 0 0 3px rgba(99, 102, 241, .15);
}
.ac-scenario-remove {
	flex: 0 0 auto;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fee2e2;
	color: #dc2626;
	border: none;
	border-radius: 8px;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	transition: background .15s;
}
.ac-scenario-remove:hover { background: #fecaca; }

/* Сетка параметров сценария */
.ac-scenario-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px 14px;
}
.ac-scenario-param {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}
.ac-scenario-param > label {
	font-size: 12px;
	font-weight: 600;
	color: #6b7280;
	white-space: nowrap;
}
.ac-scenario-param select,
.ac-scenario-param input {
	width: 100%;
	padding: 7px 10px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 14px;
	background: #fff;
	color: #1f2937;
}
.ac-scenario-param select:focus,
.ac-scenario-param input:focus {
	outline: none;
	border-color: #6366f1;
	box-shadow: 0 0 0 3px rgba(99, 102, 241, .15);
}

/* ===== Кнопки ===== */
.ac-add-btn {
	background: #f3f4f6;
	color: #374151;
	border: 1px dashed #9ca3af;
	border-radius: 8px;
	padding: 10px 16px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	width: 100%;
	margin-top: 10px;
	transition: background .15s;
}
.ac-add-btn:hover { background: #e5e7eb; }

.ac-calc-btn {
	background: linear-gradient(135deg, #6366f1, #8b5cf6);
	color: #fff;
	border: none;
	border-radius: 12px;
	padding: 15px;
	font-size: 17px;
	font-weight: 700;
	cursor: pointer;
	width: 100%;
	margin: 8px 0 20px;
	box-shadow: 0 4px 12px rgba(99, 102, 241, .3);
	transition: transform .1s, box-shadow .15s;
}
.ac-calc-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(99, 102, 241, .4);
}
.ac-calc-btn:active { transform: translateY(0); }

/* ============================================================
 *  РЕЗУЛЬТАТ (горизонтальные карточки)
 * ========================================================== */
.ac-result {
	animation: acFadeIn .3s ease;
}
@keyframes acFadeIn {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: translateY(0); }
}
.ac-result-cards {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 20px;
}

/* Горизонтальная карточка результата */
.ac-rc {
	display: flex;
	align-items: stretch;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}

/* Левая цветная колонка с промилле */
.ac-rc-left {
	flex: 0 0 120px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 14px 10px;
	color: #fff;
	text-align: center;
}
.ac-rc-value {
	font-size: 28px;
	font-weight: 800;
	line-height: 1;
}
.ac-rc-unit {
	font-size: 13px;
	font-weight: 600;
	opacity: .9;
	margin-top: 2px;
}

/* Правая часть с деталями */
.ac-rc-right {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	padding: 14px 16px;
	min-width: 0;
}
.ac-rc-name {
	font-size: 13px;
	font-weight: 700;
	color: #6b7280;
	text-transform: uppercase;
	letter-spacing: .3px;
}
.ac-rc-state {
	font-size: 15px;
	font-weight: 700;
	color: #1f2937;
	line-height: 1.3;
}
.ac-rc-time {
	font-size: 13px;
	color: #6b7280;
}
.ac-rc-time strong {
	color: #374151;
	font-weight: 700;
}

/* Цвета левой колонки по состоянию */
.ac-left-low  { background: linear-gradient(135deg, #10b981, #059669); }
.ac-left-mid  { background: linear-gradient(135deg, #f59e0b, #d97706); }
.ac-left-high { background: linear-gradient(135deg, #f97316, #ea580c); }
.ac-left-crit { background: linear-gradient(135deg, #ef4444, #dc2626); }

/* Точка-индикатор состояния перед текстом */
.ac-rc-state::before {
	content: '';
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	margin-right: 7px;
	vertical-align: middle;
}
.ac-state-low  .ac-rc-state::before { background: #059669; }
.ac-state-mid  .ac-rc-state::before { background: #d97706; }
.ac-state-high .ac-rc-state::before { background: #ea580c; }
.ac-state-crit .ac-rc-state::before { background: #dc2626; }

/* Информационная карточка (чистый алкоголь) — нейтральная */
.ac-rc-info .ac-rc-left {
	background: linear-gradient(135deg, #818cf8, #6366f1);
}
.ac-rc-info .ac-rc-value {
	font-size: 24px;
}

/* ===== График ===== */
.ac-chart-box {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	padding: 18px;
	margin-bottom: 16px;
}
.ac-chart-title {
	font-size: 16px;
	font-weight: 700;
	margin: 0 0 14px;
}
#ac_chart {
	width: 100%;
	max-width: 100%;
}
.ac-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 12px;
	justify-content: center;
}
.ac-legend-item {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: #4b5563;
}
.ac-legend-color {
	width: 14px;
	height: 14px;
	border-radius: 3px;
}

/* ===== Экспорт ===== */
.ac-export {
	display: flex;
	gap: 10px;
	margin-bottom: 16px;
}
.ac-export-btn {
	flex: 1;
	background: #fff;
	border: 1px solid #d1d5db;
	border-radius: 10px;
	padding: 11px;
	font-size: 14px;
	font-weight: 600;
	color: #374151;
	cursor: pointer;
	transition: background .15s, border-color .15s;
}
.ac-export-btn:hover {
	background: #f9fafb;
	border-color: #9ca3af;
}

/* ===== Дисклеймер ===== */
.ac-disclaimer {
	background: #fffbeb;
	border: 1px solid #fde68a;
	border-radius: 10px;
	padding: 14px 16px;
	font-size: 13px;
	color: #92400e;
	line-height: 1.6;
}

/* ============================================================
 *  SEO-КОНТЕНТ (frontend)
 * ========================================================== */
.ac-seo-content {
	max-width: 640px;
	margin: 32px auto 0;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	color: #374151;
	line-height: 1.7;
}
.ac-article h2,
.ac-faq h2 {
	font-size: 22px;
	font-weight: 800;
	color: #1f2937;
	margin: 28px 0 14px;
}
.ac-article h3 {
	font-size: 18px;
	font-weight: 700;
	color: #1f2937;
	margin: 22px 0 10px;
}
.ac-article p {
	margin: 0 0 14px;
	font-size: 15px;
}
.ac-article ul,
.ac-article ol {
	margin: 0 0 16px;
	padding-left: 22px;
}
.ac-article li {
	margin-bottom: 8px;
	font-size: 15px;
}
.ac-article strong {
	color: #1f2937;
	font-weight: 600;
}

/* ===== FAQ (аккордеон) ===== */
.ac-faq {
	margin-top: 28px;
}
.ac-faq-item {
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	margin-bottom: 10px;
	overflow: hidden;
}
.ac-faq-item summary {
	padding: 15px 44px 15px 16px;
	font-size: 15px;
	font-weight: 600;
	color: #1f2937;
	cursor: pointer;
	position: relative;
	list-style: none;
	transition: background .15s;
}
.ac-faq-item summary::-webkit-details-marker { display: none; }
.ac-faq-item summary::after {
	content: '+';
	position: absolute;
	right: 16px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 22px;
	font-weight: 400;
	color: #6366f1;
	transition: transform .2s;
}
.ac-faq-item[open] summary::after {
	transform: translateY(-50%) rotate(45deg);
}
.ac-faq-item summary:hover { background: #eef2ff; }
.ac-faq-answer {
	padding: 0 16px 16px;
}
.ac-faq-answer p {
	margin: 0;
	font-size: 14px;
	color: #4b5563;
	line-height: 1.7;
}

/* ============================================================
 *  SEO-ПРЕДПРОСМОТР (admin)
 * ========================================================== */
.ac-seo-preview {
	max-width: 600px;
	margin: 20px 0;
}
.ac-seo-preview h3 {
	font-size: 14px;
	color: #50575e;
	margin-bottom: 10px;
}
.ac-snippet {
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 8px;
	padding: 16px 18px;
	font-family: Arial, sans-serif;
	max-width: 600px;
}
.ac-snippet-url {
	font-size: 13px;
	color: #0b8043;
	margin-bottom: 4px;
}
.ac-snippet-title {
	font-size: 18px;
	color: #1a0dab;
	font-weight: 400;
	line-height: 1.3;
	margin-bottom: 4px;
	cursor: pointer;
}
.ac-snippet-title:hover { text-decoration: underline; }
.ac-snippet-desc {
	font-size: 13px;
	color: #4d5156;
	line-height: 1.5;
}

/* ============================================================
 *  АДАПТИВ
 * ========================================================== */
@media (max-width: 480px) {
	.ac-title { font-size: 22px; }
	.ac-export { flex-direction: column; }
	.ac-gender { flex-direction: column; gap: 10px; }
	.ac-drink-item {
		flex-wrap: wrap;
	}
	.ac-drink-item select { flex: 1 1 100%; }

	.ac-scenario-grid {
		grid-template-columns: 1fr;
	}

	.ac-rc-left {
		flex: 0 0 96px;
	}
	.ac-rc-value { font-size: 24px; }
	.ac-rc-info .ac-rc-value { font-size: 20px; }
}
.ac-legend-now {
	width: 14px;
	height: 14px;
	border-radius: 3px;
	display: inline-block;
	background: repeating-linear-gradient(
		to bottom,
		#64748b 0,
		#64748b 3px,
		transparent 3px,
		transparent 6px
	);
}