/*
 * Site Feedback widget — fully self-contained, scoped under .sf-widget.
 * All accent colors come from CSS variables the script sets from the site's
 * own brand config, so the widget looks native to THIS site.
 */
.sf-widget, .sf-widget *, .sf-widget *::before, .sf-widget *::after { box-sizing: border-box; }

.sf-widget {
	--sf-primary: #2f6feb;
	--sf-primary-d: #1f54c0;
	--sf-ink: #1f2430;
	--sf-muted: #6b7280;
	--sf-bg: #ffffff;
	--sf-subtle: #f6f7f9;
	--sf-line: #e6e8ec;
	--sf-line-2: #d8dbe0;
	--sf-danger: #c2403a;
	--sf-good: #1f9d6b;
	--sf-radius: 14px;
	--sf-shadow: 0 18px 48px -12px rgba(20,24,33,.32), 0 4px 12px -4px rgba(20,24,33,.14);
	--sf-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	position: fixed; right: 20px; bottom: 20px; z-index: 2147483000;
	font-family: var(--sf-sans); font-size: 14px; line-height: 1.5; color: var(--sf-ink);
	-webkit-font-smoothing: antialiased;
}
.sf-widget button { font-family: inherit; cursor: pointer; }
.sf-hidden { display: none !important; }

/* Bubble */
.sf-bubble {
	position: relative; display: inline-flex; align-items: center; gap: 8px;
	height: 48px; padding: 0 18px 0 16px; border-radius: 999px;
	background: var(--sf-primary); color: #fff; font-size: 14px; font-weight: 650; letter-spacing: .2px;
	border: 1px solid var(--sf-primary-d); box-shadow: var(--sf-shadow);
	transition: transform .12s ease, background .12s ease;
}
.sf-bubble:hover { background: var(--sf-primary-d); transform: translateY(-1px); color: #fff; }
.sf-bubble:focus-visible { outline: 3px solid rgba(47,111,235,.4); outline-offset: 2px; }
.sf-bubble svg { width: 18px; height: 18px; flex: 0 0 auto; }

/* Popup */
.sf-popup {
	position: absolute; right: 0; bottom: 0; width: 372px; max-width: calc(100vw - 32px);
	max-height: min(620px, calc(100vh - 40px)); background: var(--sf-bg);
	border: 1px solid var(--sf-line); border-radius: var(--sf-radius); box-shadow: var(--sf-shadow);
	display: flex; flex-direction: column; overflow: hidden; transform-origin: bottom right;
	animation: sf-pop .16s ease-out;
}
@keyframes sf-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

.sf-head {
	display: flex; align-items: center; gap: 10px; padding: 13px 14px;
	background: var(--sf-bg); border-bottom: 1px solid var(--sf-line); flex: 0 0 auto;
}
.sf-head-icon { width: 30px; height: 30px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; background: var(--sf-primary); border-radius: 8px; color: #fff; overflow: hidden; }
.sf-head-icon svg { width: 17px; height: 17px; }
.sf-head-icon img { width: 100%; height: 100%; object-fit: cover; }
.sf-head-titles { flex: 1 1 auto; min-width: 0; }
.sf-head-title { font-size: 14px; font-weight: 650; color: var(--sf-ink); }
.sf-head-sub { font-size: 11px; color: var(--sf-muted); }
.sf-head-btn { width: 30px; height: 30px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--sf-muted); border-radius: 7px; }
.sf-head-btn:hover { background: var(--sf-subtle); color: var(--sf-ink); }
.sf-head-btn svg { width: 16px; height: 16px; }

.sf-body { flex: 1 1 auto; overflow-y: auto; padding: 16px; }
.sf-lead { font-size: 15px; line-height: 1.5; margin: 2px 0 16px; }

.sf-field { margin-bottom: 12px; }
.sf-label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.sf-input, .sf-textarea {
	width: 100%; border: 1px solid var(--sf-line-2); border-radius: 9px; padding: 9px 11px;
	font-size: 14px; font-family: inherit; color: var(--sf-field-ink, var(--sf-ink)); background: var(--sf-field-bg, #fff);
	transition: border-color .12s ease, box-shadow .12s ease;
}
.sf-input:focus, .sf-textarea:focus { outline: none; border-color: var(--sf-primary); box-shadow: 0 0 0 3px rgba(47,111,235,.16); }
.sf-textarea { resize: vertical; min-height: 78px; }
.sf-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sf-invalid { border-color: var(--sf-danger) !important; }
.sf-err { display: none; color: var(--sf-danger); font-size: 12px; margin-top: 4px; }
.sf-err.sf-show { display: block; }
.sf-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

.sf-identity { display: flex; flex-direction: column; gap: 2px; background: var(--sf-subtle); border: 1px solid var(--sf-line); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; }
.sf-identity-label { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: var(--sf-muted); }
.sf-identity-name { font-size: 14px; font-weight: 650; }
.sf-identity-email { font-size: 12.5px; color: var(--sf-muted); word-break: break-word; }

.sf-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	width: 100%; height: 44px; padding: 0 16px; border-radius: 10px;
	background: var(--sf-primary); color: #fff; border: 1px solid var(--sf-primary-d);
	font-size: 14px; font-weight: 650; letter-spacing: .2px; transition: background .12s ease;
}
.sf-btn:hover { background: var(--sf-primary-d); color: #fff; }
.sf-btn:disabled { opacity: .6; cursor: default; }
.sf-btn svg { width: 16px; height: 16px; }
.sf-btn-ghost { background: var(--sf-ghost-bg, #fff); color: var(--sf-ink); border-color: var(--sf-line-2); }
.sf-btn-ghost:hover { background: var(--sf-subtle); color: var(--sf-ink); }

.sf-attach-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.sf-thumb { position: relative; width: 54px; height: 54px; border-radius: 9px; overflow: hidden; border: 1px solid var(--sf-line); background: var(--sf-subtle); flex: 0 0 auto; }
.sf-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sf-thumb-x { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border: 0; border-radius: 999px; background: rgba(31,36,48,.78); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.sf-thumb-x:hover { background: var(--sf-danger); }

.sf-toast { margin-top: 8px; font-size: 12.5px; padding: 8px 11px; border-radius: 9px; display: none; }
.sf-toast.sf-show { display: block; }
.sf-toast-err { background: #fdecea; color: var(--sf-danger); border: 1px solid #f3c9c6; }

.sf-state { text-align: center; padding: 18px 8px 6px; }
.sf-state-mark { width: 52px; height: 52px; margin: 0 auto 14px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: #e7f7f0; color: var(--sf-good); }
.sf-state-mark svg { width: 26px; height: 26px; }
.sf-state-title { font-size: 16px; font-weight: 650; margin-bottom: 6px; }
.sf-state-text { font-size: 13.5px; color: var(--sf-muted); line-height: 1.5; }
.sf-staff-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--sf-muted); background: var(--sf-subtle); border: 1px dashed var(--sf-line-2); border-radius: 8px; padding: 8px 11px; margin-bottom: 14px; }
.sf-spin { width: 15px; height: 15px; border-radius: 999px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; animation: sf-rot .7s linear infinite; display: inline-block; }
@keyframes sf-rot { to { transform: rotate(360deg); } }

/* "Not customer support" note + Contact-support link-button. */
.sf-note {
	display: flex; gap: 8px; align-items: flex-start;
	font-size: 12px; color: var(--sf-muted);
	background: var(--sf-subtle); border: 1px solid var(--sf-line);
	border-radius: 10px; padding: 10px 12px; margin-top: 14px;
}
.sf-note svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 1px; color: var(--sf-muted); }
.sf-btn-link { text-decoration: none !important; }

/* Harden controls against host-theme input/button resets. */
.sf-widget .sf-input, .sf-widget .sf-textarea {
	background-color: var(--sf-field-bg, #fff) !important; color: var(--sf-field-ink, var(--sf-ink)) !important; -webkit-text-fill-color: var(--sf-field-ink, var(--sf-ink)) !important;
	border: 1px solid var(--sf-line-2) !important; background-image: none !important;
}
.sf-widget .sf-input:focus, .sf-widget .sf-textarea:focus { border-color: var(--sf-primary) !important; }
.sf-widget ::placeholder { color: var(--sf-muted) !important; opacity: 1; }
.sf-widget .sf-bubble, .sf-widget .sf-btn { background-color: var(--sf-primary) !important; color: #fff !important; border: 1px solid var(--sf-primary-d) !important; background-image: none !important; text-transform: none !important; }
.sf-widget .sf-bubble:hover, .sf-widget .sf-btn:hover { background-color: var(--sf-primary-d) !important; color: #fff !important; }
.sf-widget .sf-btn-ghost { background-color: var(--sf-ghost-bg, #fff) !important; color: var(--sf-ink) !important; border: 1px solid var(--sf-line-2) !important; }
.sf-widget .sf-btn-ghost:hover { background-color: var(--sf-subtle) !important; }

@media (max-width: 480px) {
	.sf-widget { right: 12px; bottom: 12px; left: 12px; }
	.sf-popup { width: auto; left: 0; right: 0; max-width: none; max-height: calc(100vh - 24px); }
	.sf-row2 { grid-template-columns: 1fr; }
	.sf-bubble { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) { .sf-popup, .sf-bubble, .sf-spin { animation: none; transition: none; } }
