/* RSL Digital Music Player – News / Voice note / Live chat sections */
.rsl-sections {
	--dmp-accent: #22d3ee;
	--rsl-bg: #0f1216;
	--rsl-panel: #171b21;
	--rsl-inset: #05080a;
	--rsl-text: #e6edf3;
	--rsl-muted: #8b949e;
	--rsl-border: #2a313a;
	--rsl-ok: #2bd96b;
	--rsl-err: #ffb020;
	box-sizing: border-box;
	max-width: 100%;
	margin: -0.6em 0 1.5em;
	display: flex;
	flex-direction: column;
	gap: 14px;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	color: var(--rsl-text);
}
.rsl-sections *, .rsl-sections *::before, .rsl-sections *::after { box-sizing: border-box; }
.rsl-sections [hidden] { display: none !important; }
.rsl-sections.dmp-align-center { margin-left: auto; margin-right: auto; }
.rsl-sections.dmp-align-right { margin-left: auto; margin-right: 0; }
.rsl-sections.rsl-theme-light {
	--rsl-bg: #f4f5f7; --rsl-panel: #fff; --rsl-inset: #f0f2f5; --rsl-text: #1b1f24; --rsl-muted: #5c6670; --rsl-border: #d6dae0;
	--rsl-ok: #138a3e; --rsl-err: #a35b00;
}

.rsl-section {
	background: linear-gradient(180deg, var(--rsl-panel), var(--rsl-bg));
	border: 1px solid var(--rsl-border);
	border-radius: 14px;
	padding: 14px 16px 16px;
	box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}
.rsl-section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 10px;
}
.rsl-section-head h3 {
	margin: 0 !important;
	padding: 0 !important;
	font-size: 13px !important;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--dmp-accent) !important;
	font-weight: 700;
	font-family: ui-monospace, Menlo, Consolas, monospace;
}
.rsl-section-head > span { font-size: 12px; color: var(--rsl-muted); }

/* ---------- shared form bits ---------- */
.rsl-section label { display: block; font-size: 13px; color: var(--rsl-muted); margin: 0 0 8px; }
.rsl-section label small { opacity: 0.8; }
.rsl-section input[type=text], .rsl-section input[type=email], .rsl-section input[type=tel], .rsl-section textarea {
	display: block;
	width: 100%;
	margin-top: 3px;
	padding: 8px 10px;
	font: inherit;
	font-size: 15px;
	color: var(--rsl-text);
	background: var(--rsl-inset);
	border: 1px solid var(--rsl-border);
	border-radius: 8px;
	box-shadow: none;
}
.rsl-section textarea { resize: vertical; min-height: 2.6em; }
.rsl-section input:focus, .rsl-section textarea:focus { outline: 2px solid var(--dmp-accent); outline-offset: 0; border-color: transparent; }
.rsl-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 520px) { .rsl-row { grid-template-columns: 1fr; } }
.rsl-section .rsl-check { display: flex; gap: 8px; align-items: flex-start; color: var(--rsl-text); font-size: 13px; }
.rsl-section .rsl-check input { margin-top: 3px; accent-color: var(--dmp-accent); }
.rsl-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.rsl-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	padding: 9px 18px;
	font: inherit; font-weight: 700; font-size: 14px; letter-spacing: 0.04em;
	color: #001014; background: var(--dmp-accent);
	border: 0; border-radius: 999px; cursor: pointer;
}
.rsl-btn:disabled { opacity: 0.4; cursor: default; }
.rsl-btn-link { background: none; border: 0; padding: 0; color: var(--dmp-accent); text-decoration: underline; cursor: pointer; font: inherit; font-size: 13px; }
.rsl-status { margin: 8px 0 0; font-size: 13px; min-height: 1em; color: var(--rsl-muted); }
.rsl-status.is-ok { color: var(--rsl-ok); }
.rsl-status.is-error { color: var(--rsl-err); }
.rsl-admin-hint { padding: 8px 12px; border-left: 4px solid #2271b1; background: #fff; color: #1d2327; font-size: 13px; }

/* ---------- news ---------- */
.rsl-news-list { list-style: none; margin: 0 !important; padding: 0 !important; max-height: 520px; overflow-y: auto; }
.rsl-news-item { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--rsl-border); margin: 0 !important; }
.rsl-news-item:first-child { border-top: 0; padding-top: 2px; }
.rsl-news-img { flex: 0 0 84px; height: 60px; border-radius: 8px; overflow: hidden; background: var(--rsl-inset); }
.rsl-news-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rsl-news-body { min-width: 0; }
.rsl-news-meta { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rsl-muted); }
.rsl-news-source { color: var(--dmp-accent); font-weight: 700; }
.rsl-news-title { display: block; color: var(--rsl-text) !important; text-decoration: none !important; font-weight: 600; font-size: 15px; line-height: 1.3; margin-top: 2px; }
.rsl-news-title:hover { color: var(--dmp-accent) !important; }
.rsl-news-excerpt { margin: 4px 0 0 !important; font-size: 13px; color: var(--rsl-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rsl-news-empty { color: var(--rsl-muted); font-size: 13px; padding: 6px 0; }

/* ---------- voice notes ---------- */
.rsl-voice-intro, .rsl-chat-intro { margin: -2px 0 12px !important; font-size: 14px; color: var(--rsl-muted); }
.rsl-rec {
	display: flex; align-items: center; gap: 12px;
	background: var(--rsl-inset); border: 1px solid var(--rsl-border); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px;
}
.rsl-rec-btn {
	flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px;
	padding: 9px 16px 9px 12px; border-radius: 999px; border: 1px solid var(--rsl-border);
	background: var(--rsl-panel); color: var(--rsl-text); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer;
}
.rsl-rec-dot { width: 14px; height: 14px; border-radius: 50%; background: #ff3b3b; box-shadow: 0 0 8px rgba(255, 59, 59, 0.6); }
.rsl-voice.is-recording .rsl-rec-dot { border-radius: 3px; animation: rsl-pulse 1s ease-in-out infinite; }
.rsl-voice.is-recording .rsl-rec-btn { border-color: #ff3b3b; }
@keyframes rsl-pulse { 50% { opacity: 0.4; } }
.rsl-rec-meter { flex: 1; height: 8px; border-radius: 8px; background: rgba(127, 127, 127, 0.18); overflow: hidden; }
.rsl-rec-meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #2bd96b 0%, #2bd96b 60%, #ffc53d 80%, #ff3b3b 100%); background-size: 300px 100%; transition: width 0.08s linear; }
.rsl-rec-time { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; color: var(--dmp-accent); white-space: nowrap; }
.rsl-rec-review { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; flex-wrap: wrap; }
.rsl-rec-review audio { flex: 1; min-width: 200px; height: 36px; }
.rsl-progress { height: 6px; border-radius: 6px; background: rgba(127, 127, 127, 0.2); margin-top: 10px; overflow: hidden; }
.rsl-progress span { display: block; height: 100%; width: 0; background: var(--dmp-accent); transition: width 0.2s; }

/* ---------- chat ---------- */
.rsl-chat-state { display: inline-flex; align-items: center; gap: 6px; }
.rsl-chat-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #8b949e; }
.rsl-chat-state.is-online { color: var(--rsl-ok) !important; }
.rsl-chat-state.is-online::before { background: var(--rsl-ok); box-shadow: 0 0 6px var(--rsl-ok); }
.rsl-chat-log {
	height: 280px; overflow-y: auto; padding: 10px; margin-bottom: 10px;
	background: var(--rsl-inset); border: 1px solid var(--rsl-border); border-radius: 12px;
	display: flex; flex-direction: column; gap: 8px;
}
.rsl-msg { max-width: 82%; }
.rsl-msg-meta { font-size: 11px; color: var(--rsl-muted); margin: 0 4px 2px; }
.rsl-msg-body { padding: 8px 12px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; font-size: 14px; }
.rsl-msg.from-visitor { align-self: flex-end; text-align: right; }
.rsl-msg.from-visitor .rsl-msg-body { background: var(--dmp-accent); color: #001014; border-bottom-right-radius: 4px; text-align: left; }
.rsl-msg.from-admin { align-self: flex-start; }
.rsl-msg.from-admin .rsl-msg-body { background: var(--rsl-panel); border: 1px solid var(--rsl-border); border-bottom-left-radius: 4px; }
.rsl-msg.from-system { align-self: center; max-width: 92%; text-align: center; }
.rsl-msg.from-system .rsl-msg-body { background: none; color: var(--rsl-muted); font-size: 12px; padding: 2px 8px; }
.rsl-chat-send { display: flex; gap: 8px; }
.rsl-chat-send input { margin: 0 !important; flex: 1; }
.rsl-chat-new { margin-top: 4px; }

/* ---------- news: standard list vs scrolling marquee ---------- */
.rsl-news-tools { display: inline-flex; align-items: center; gap: 10px; }
.rsl-news-switch { display: inline-flex; }
.rsl-sections .rsl-news-switch button {
	font: 700 10px/1 ui-monospace, Menlo, Consolas, monospace;
	letter-spacing: 0.12em;
	padding: 5px 8px;
	border: 1px solid var(--rsl-border);
	background: transparent;
	color: var(--rsl-muted);
	cursor: pointer;
}
.rsl-sections .rsl-news-switch button:first-child { border-radius: 6px 0 0 6px; }
.rsl-sections .rsl-news-switch button:last-child { border-radius: 0 6px 6px 0; border-left: 0; }
.rsl-sections .rsl-news-switch button.is-active { background: var(--dmp-accent); color: #001014; border-color: transparent; }
.rsl-news .rsl-ticker { display: none; }
.rsl-news[data-display="ticker"] .rsl-news-list { display: none; }
.rsl-news[data-display="ticker"] .rsl-ticker { display: flex; }

.rsl-ticker {
	align-items: stretch;
	background: var(--rsl-inset);
	border: 1px solid var(--rsl-border);
	border-radius: 10px;
	overflow: hidden;
	height: 44px;
}
.rsl-ticker-label {
	flex: 0 0 auto;
	display: flex; align-items: center;
	padding: 0 12px;
	background: var(--dmp-accent);
	color: #001014;
	font: 800 12px/1 ui-monospace, Menlo, Consolas, monospace;
	letter-spacing: 0.16em;
	position: relative;
}
.rsl-ticker-label::after {
	content: ""; position: absolute; right: -10px; top: 0; bottom: 0; width: 10px;
	background: linear-gradient(90deg, var(--dmp-accent), transparent);
}
.rsl-ticker-viewport {
	flex: 1; min-width: 0; overflow: hidden; position: relative;
	-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
	mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
}
.rsl-ticker-track {
	display: inline-flex;
	height: 100%;
	align-items: center;
	white-space: nowrap;
	animation: rsl-ticker var(--rsl-ticker-time, 40s) linear infinite;
	will-change: transform;
}
.rsl-ticker:hover .rsl-ticker-track, .rsl-ticker:focus-within .rsl-ticker-track { animation-play-state: paused; }
@keyframes rsl-ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.rsl-ticker-group { display: inline-flex; align-items: center; padding-left: 18px; }
.rsl-ticker-item {
	display: inline-flex; align-items: baseline; gap: 8px;
	color: var(--rsl-text) !important; text-decoration: none !important;
	font-size: 15px; font-weight: 600;
	padding-right: 18px; margin-right: 18px;
	border-right: 1px solid var(--rsl-border);
}
.rsl-ticker-item:hover { color: var(--dmp-accent) !important; }
.rsl-ticker-src { color: var(--dmp-accent); font: 700 11px/1 system-ui, sans-serif; letter-spacing: 0.08em; text-transform: uppercase; }
.rsl-ticker-time { color: var(--rsl-muted); font-size: 11px; font-weight: 500; }
@media (prefers-reduced-motion: reduce) {
	.rsl-ticker-track { animation: none; }
	.rsl-ticker-viewport { overflow-x: auto; }
	.rsl-ticker-group[aria-hidden="true"] { display: none; }
}

/* ---------- chat refresh ---------- */
.rsl-chat-tools { display: inline-flex; align-items: center; gap: 10px; }
.rsl-sections .rsl-chat-refresh {
	width: 26px; height: 26px; padding: 4px; border-radius: 50%;
	border: 1px solid var(--rsl-border); background: transparent; color: var(--dmp-accent); cursor: pointer;
	display: inline-flex; align-items: center; justify-content: center;
}
.rsl-chat-refresh svg { width: 100%; height: 100%; fill: currentColor; }
.rsl-chat-refresh.is-spinning svg { animation: rsl-spin 0.8s linear infinite; }
@keyframes rsl-spin { to { transform: rotate(360deg); } }
.rsl-chat-checked { font-size: 11px; color: var(--rsl-muted); }

/* ---------- voice note form fields ---------- */
.rsl-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.rsl-fields .rsl-field.is-wide { grid-column: 1 / -1; }
@media (max-width: 520px) { .rsl-fields { grid-template-columns: 1fr; } }
.rsl-req { color: var(--dmp-accent); }
.rsl-section input.is-invalid { outline: 2px solid var(--rsl-err); border-color: transparent; }
.rsl-section input::placeholder, .rsl-section textarea::placeholder { color: var(--rsl-muted); opacity: 0.7; }

/* ---------- voice note: Record again / Clear ---------- */
.rsl-rec-actions { display: inline-flex; align-items: center; gap: 14px; }
.rsl-btn-ghost {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 6px 12px; border-radius: 999px;
	border: 1px solid var(--rsl-border); background: transparent;
	color: var(--rsl-text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.rsl-btn-ghost:hover { border-color: #ff5a4a; color: #ff5a4a; }
.rsl-btn-ghost svg { width: 15px; height: 15px; fill: currentColor; }
