/* Smart-Cam Support-Chat — Farben von smart-cam.de (Woodmart: Primärfarbe #001a5b, Akzent #fbbc34). */
#scsc-root {
	--scsc-primary: #001a5b;
	--scsc-primary-2: #0b2d80;
	--scsc-accent: #fbbc34;
	--scsc-text: #242424;
	--scsc-muted: #6b7280;
	--scsc-line: #e5e7eb;
	--scsc-bg: #ffffff;
	--scsc-staff-bg: #f1f3f7;
	--scsc-radius: 14px;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.45;
	color: var(--scsc-text);
}
/* Тема (Woodmart) стилизует button/input/textarea с высокой специфичностью — внутри чата всё сбрасываем */
#scsc-root button, #scsc-root input, #scsc-root textarea {
	all: unset; box-sizing: border-box; font-family: inherit; font-size: inherit; line-height: inherit; color: inherit;
	text-transform: none; letter-spacing: normal;
}
#scsc-root svg { display: block; flex: none; }
#scsc-root *, #scsc-root *::before, #scsc-root *::after { box-sizing: border-box; }
#scsc-root [hidden] { display: none !important; }
#scsc-root button { font: inherit; cursor: pointer; }

/* Knopf unten rechts (über dem «nach oben»-Pfeil der Theme) */
#scsc-root .scsc-button {
	position: fixed; right: 20px; bottom: 20px; z-index: 99990;
	width: 60px; height: 60px; border-radius: 50%; border: 0; padding: 0;
	background: var(--scsc-primary); color: #fff;
	display: flex; align-items: center; justify-content: center;
	box-shadow: 0 6px 20px rgba(0, 26, 91, .35);
	transition: transform .15s ease, background .15s ease;
}
#scsc-root .scsc-button:hover { background: var(--scsc-primary-2); transform: translateY(-2px); }
#scsc-root .scsc-button:focus-visible, #scsc-root button:focus-visible, #scsc-root a:focus-visible, #scsc-root .scsc-input:focus-visible, #scsc-root .scsc-field:focus-visible {
	outline: 3px solid var(--scsc-accent); outline-offset: 2px;
}
#scsc-root .scsc-badge {
	position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px;
	border-radius: 11px; background: var(--scsc-accent); color: #1b1b1b;
	font-size: 12px; font-weight: 700; line-height: 22px; text-align: center; box-shadow: 0 0 0 2px #fff;
}
body .scrollToTop { bottom: 92px !important; }

/* Fenster */
#scsc-root .scsc-panel {
	position: fixed; right: 20px; bottom: 92px; z-index: 99991;
	width: 380px; height: min(620px, calc(100vh - 120px));
	background: var(--scsc-bg); border-radius: var(--scsc-radius);
	box-shadow: 0 16px 48px rgba(0, 0, 0, .22);
	display: flex; flex-direction: column; overflow: hidden;
	animation: scsc-in .18s ease-out;
}
@keyframes scsc-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

#scsc-root .scsc-head {
	position: relative; display: flex; align-items: center; gap: 4px;
	padding: 14px 10px 14px 18px; background: var(--scsc-primary); color: #fff;
}
#scsc-root .scsc-titles { flex: 1; min-width: 0; }
#scsc-root .scsc-title { font-weight: 700; font-size: 16px; }
#scsc-root .scsc-sub { font-size: 12px; opacity: .8; }
#scsc-root .scsc-icon-btn {
	width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; color: inherit;
	display: inline-flex; align-items: center; justify-content: center; padding: 0; flex: none;
}
#scsc-root .scsc-head .scsc-icon-btn:hover { background: rgba(255, 255, 255, .14); }
#scsc-root .scsc-menu {
	position: absolute; right: 52px; top: 52px; z-index: 2; min-width: 220px;
	background: #fff; color: var(--scsc-text); border-radius: 10px; padding: 6px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
}
#scsc-root .scsc-menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 8px; }
#scsc-root .scsc-menu button:hover { background: var(--scsc-staff-bg); }

#scsc-root .scsc-list { flex: 1; overflow-y: auto; padding: 16px 14px 8px; background: #fafbfc; overscroll-behavior: contain; }
#scsc-root .scsc-day { text-align: center; font-size: 12px; color: var(--scsc-muted); margin: 10px 0 8px; }
#scsc-root .scsc-msg { display: flex; flex-direction: column; margin: 0 0 10px; max-width: 86%; }
#scsc-root .scsc-user { margin-left: auto; align-items: flex-end; }
#scsc-root .scsc-staff { margin-right: auto; align-items: flex-start; }
#scsc-root .scsc-name { font-size: 12px; color: var(--scsc-muted); margin: 0 0 3px 4px; }
#scsc-root .scsc-bubble { padding: 9px 12px 6px; border-radius: 16px; word-wrap: break-word; overflow-wrap: anywhere; }
#scsc-root .scsc-user .scsc-bubble { background: var(--scsc-primary); color: #fff; border-bottom-right-radius: 4px; }
#scsc-root .scsc-staff .scsc-bubble { background: var(--scsc-staff-bg); border-bottom-left-radius: 4px; }
#scsc-root .scsc-user .scsc-bubble a { color: #fff; }
#scsc-root .scsc-staff .scsc-bubble a { color: var(--scsc-primary-2); }
#scsc-root .scsc-bubble a { text-decoration: underline; }
#scsc-root .scsc-text ul, #scsc-root .scsc-text ol { margin: 4px 0 4px 18px; padding: 0; }
#scsc-root .scsc-text li { margin: 0; padding: 0; line-height: inherit; }
#scsc-root .scsc-text blockquote { margin: 4px 0; padding-left: 8px; border-left: 3px solid currentColor; opacity: .85; }
#scsc-root .scsc-text code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; background: rgba(0, 0, 0, .08); padding: 0 4px; border-radius: 4px; }
#scsc-root .scsc-user .scsc-text code { background: rgba(255, 255, 255, .18); }
#scsc-root .scsc-spoiler { background: currentColor; border-radius: 3px; cursor: pointer; }
#scsc-root .scsc-spoiler.open { background: transparent; }
#scsc-root .scsc-meta { font-size: 11px; opacity: .7; text-align: right; margin-top: 2px; white-space: nowrap; }
#scsc-root .scsc-deleted .scsc-bubble { opacity: .6; }
#scsc-root .scsc-greeting .scsc-meta { display: none; }
#scsc-root .scsc-retry { border: 0; background: none; color: #b42318; font-size: 12px; padding: 4px 2px; text-decoration: underline; }

#scsc-root .scsc-files { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 6px; }
#scsc-root .scsc-img img { display: block; max-width: 220px; max-height: 220px; border-radius: 10px; background: #fff; }
#scsc-root .scsc-doc {
	display: flex; align-items: center; gap: 8px; max-width: 260px; padding: 8px 10px; border-radius: 10px;
	background: rgba(255, 255, 255, .9); color: var(--scsc-text) !important; text-decoration: none !important;
}
#scsc-root .scsc-doc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
#scsc-root .scsc-doc-size { font-size: 12px; color: var(--scsc-muted); flex: none; }

#scsc-root .scsc-typing { padding: 4px 18px 6px; font-size: 12px; color: var(--scsc-muted); background: #fafbfc; display: flex; align-items: center; gap: 6px; }
#scsc-root .scsc-dots { display: inline-flex; gap: 3px; }
#scsc-root .scsc-dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: scsc-dot 1.2s infinite ease-in-out; }
#scsc-root .scsc-dots i:nth-child(2) { animation-delay: .15s; }
#scsc-root .scsc-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes scsc-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

#scsc-root .scsc-notice { margin: 0 12px 6px; padding: 8px 10px; border-radius: 8px; font-size: 13px; background: #eef2ff; color: #1e3a8a; }
#scsc-root .scsc-notice.scsc-error { background: #fef3f2; color: #b42318; }

#scsc-root .scsc-card { margin: 0 12px 8px; padding: 12px; border: 1px solid var(--scsc-line); border-radius: 12px; background: #fff; }
#scsc-root .scsc-card-title { font-weight: 700; margin-bottom: 2px; }
#scsc-root .scsc-card-text { font-size: 12px; color: var(--scsc-muted); margin-bottom: 8px; }
#scsc-root .scsc-field { display: block; width: 100%; margin: 0 0 6px; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 8px; font: inherit; background: #fff; color: inherit; min-height: 0; height: auto; cursor: text; }
#scsc-root .scsc-card-row { display: flex; gap: 8px; }
#scsc-root .scsc-btn { flex: 1; border: 0; border-radius: 8px; padding: 9px 10px; background: var(--scsc-primary); color: #fff; font-weight: 600; }
#scsc-root .scsc-btn-ghost { background: var(--scsc-staff-bg); color: var(--scsc-text); }

#scsc-root .scsc-form { border-top: 1px solid var(--scsc-line); padding: 8px 10px 8px; background: #fff; }
#scsc-root .scsc-row { display: flex; align-items: flex-end; gap: 6px; }
#scsc-root .scsc-attach { color: var(--scsc-muted); }
#scsc-root .scsc-attach:hover { background: var(--scsc-staff-bg); color: var(--scsc-primary); }
#scsc-root .scsc-input {
	flex: 1; resize: none; border: 1px solid #d1d5db; border-radius: 20px; padding: 9px 14px; margin: 0;
	font: inherit; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; overflow-y: auto; cursor: text; display: block; max-height: 120px; min-height: 40px; height: 40px; background: #fff; color: inherit; box-shadow: none;
}
#scsc-root .scsc-input:focus { border-color: var(--scsc-primary); }
#scsc-root .scsc-send {
	width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; padding: 0;
	background: var(--scsc-accent); color: #1b1b1b; display: inline-flex; align-items: center; justify-content: center;
}
#scsc-root .scsc-send:disabled { opacity: .5; cursor: default; }
#scsc-root .scsc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
#scsc-root .scsc-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 4px 4px 4px 10px; border-radius: 14px; background: var(--scsc-staff-bg); font-size: 12px; }
#scsc-root .scsc-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
#scsc-root .scsc-chip button { border: 0; background: none; width: 22px; height: 22px; border-radius: 50%; padding: 0; line-height: 1; font-size: 16px; }
#scsc-root .scsc-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
#scsc-root .scsc-privacy { font-size: 11px; color: var(--scsc-muted); margin: 6px 4px 0; }
#scsc-root .scsc-privacy a { color: inherit; text-decoration: underline; }

#scsc-root .scsc-viewer { position: fixed; inset: 0; z-index: 99999; background: rgba(0, 0, 0, .9); display: flex; align-items: center; justify-content: center; }
#scsc-root .scsc-viewer img { max-width: 96vw; max-height: 92vh; object-fit: contain; }
#scsc-root .scsc-viewer-close { position: absolute; top: 12px; right: 12px; color: #fff; }

/* Handy: Fenster über den ganzen Bildschirm */
@media (max-width: 600px) {
	#scsc-root .scsc-button { right: 16px; bottom: 16px; width: 56px; height: 56px; }
	#scsc-root .scsc-panel { inset: 0; width: auto; height: 100%; height: 100dvh; border-radius: 0; right: 0; bottom: 0; }
	#scsc-root .scsc-input { font-size: 16px; }   /* iOS zoomt sonst beim Tippen */
	#scsc-root .scsc-msg { max-width: 90%; }
	html.scsc-locked, html.scsc-locked body { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
	#scsc-root .scsc-panel, #scsc-root .scsc-dots i, #scsc-root .scsc-button { animation: none; transition: none; }
}
@media print { #scsc-root { display: none; } }
