/* Sovereign Care Chat widget styles. Scoped under .scc-chat. */
.scc-chat {
	/* Palette matched to the sovereigncare.ai site (blue primary, navy text). */
	--scc-bg: #ffffff;
	--scc-border: #e2e8f0;
	--scc-user: #2563eb;
	--scc-user-hover: #1d4ed8;
	--scc-user-text: #ffffff;
	--scc-assistant: #f1f5f9;
	--scc-assistant-text: #0f172a;
	--scc-muted: #64748b;

	max-width: 640px;
	margin: 0 auto;
	border: 1px solid var(--scc-border);
	border-radius: 12px;
	background: var(--scc-bg);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	font-size: 15px;
	line-height: 1.5;
}

.scc-messages {
	height: 460px;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.scc-msg {
	display: flex;
}

.scc-msg--user {
	justify-content: flex-end;
}

.scc-msg--assistant {
	justify-content: flex-start;
}

.scc-bubble {
	max-width: 85%;
	padding: 10px 14px;
	border-radius: 14px;
	word-wrap: break-word;
}

.scc-msg--user .scc-bubble {
	background: var(--scc-user);
	color: var(--scc-user-text);
	border-bottom-right-radius: 4px;
}

.scc-msg--assistant .scc-bubble {
	background: var(--scc-assistant);
	color: var(--scc-assistant-text);
	border-bottom-left-radius: 4px;
}

.scc-bubble p {
	margin: 0 0 8px;
}

.scc-bubble p:last-child {
	margin-bottom: 0;
}

.scc-bubble ul {
	margin: 6px 0;
	padding-left: 20px;
}

/* Inline action row: rendered inside the message stream (not fixed chrome),
   so controls like "Use my location" scroll away with the conversation. */
.scc-actions {
	padding: 0 0 2px;
}

.scc-actions--done {
	font-size: 12px;
	line-height: 1.4;
	color: var(--scc-muted);
}

.scc-locate {
	appearance: none;
	border: 1px solid var(--scc-border);
	background: #fff;
	color: var(--scc-user);
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	border-radius: 999px;
	padding: 6px 12px;
	cursor: pointer;
}

.scc-locate:hover {
	border-color: var(--scc-user);
}

.scc-locate:disabled {
	opacity: 0.6;
	cursor: default;
}

.scc-input {
	display: flex;
	gap: 8px;
	padding: 12px;
	border-top: 1px solid var(--scc-border);
	align-items: flex-end;
}

.scc-input textarea {
	flex: 1;
	resize: none;
	border: 1px solid var(--scc-border);
	border-radius: 10px;
	padding: 10px 12px;
	font: inherit;
	color: inherit;
}

.scc-input textarea:focus {
	outline: 2px solid var(--scc-user);
	outline-offset: 0;
}

.scc-input button {
	background: var(--scc-user);
	color: var(--scc-user-text);
	border: 0;
	border-radius: 10px;
	padding: 10px 18px;
	font: inherit;
	cursor: pointer;
}

.scc-input button:disabled {
	opacity: 0.55;
	cursor: default;
}

.scc-disclaimer {
	margin: 0;
	padding: 8px 14px 12px;
	font-size: 12px;
	color: var(--scc-muted);
	text-align: center;
}

/* Typing indicator. */
.scc-typing .scc-bubble {
	display: inline-flex;
	gap: 4px;
}

.scc-typing .scc-bubble span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--scc-muted);
	animation: scc-blink 1.2s infinite both;
}

.scc-typing .scc-bubble span:nth-child(2) { animation-delay: 0.2s; }
.scc-typing .scc-bubble span:nth-child(3) { animation-delay: 0.4s; }

@keyframes scc-blink {
	0%, 80%, 100% { opacity: 0.2; }
	40% { opacity: 1; }
}

/* --- Provider result cards (Path B) --- */
.scc-providers {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 2px 0 6px;
}

.scc-providers__note {
	margin: 0 0 2px;
	font-size: 12px;
	line-height: 1.4;
	color: var(--scc-muted);
}

.scc-provider {
	border: 1px solid var(--scc-border);
	border-radius: 10px;
	padding: 10px 12px;
	background: #fff;
}

.scc-provider__name {
	font-weight: 700;
	color: var(--scc-assistant-text);
}

.scc-provider__type {
	font-size: 13px;
	color: var(--scc-user);
	margin-top: 2px;
}

.scc-provider__meta {
	font-size: 13px;
	color: var(--scc-muted);
	margin-top: 2px;
}

.scc-provider__src {
	font-size: 11px;
	color: var(--scc-muted);
	margin-top: 6px;
}

.scc-provider__badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	color: var(--scc-success, #047857);
	background: var(--scc-success-bg, #d1fae5);
	border-radius: 999px;
	padding: 2px 8px;
	vertical-align: middle;
}

.scc-provider__dist {
	color: var(--scc-user);
	font-weight: 600;
}

/* Approved partner listings: visually distinct from public results, so a
   curated listing never reads as a neutral search result. */
.scc-provider--partner {
	border-color: var(--scc-user);
	border-width: 2px;
	background: var(--scc-partner-bg, #f8fafc);
}

.scc-provider__badge--partner {
	color: var(--scc-partner, #1d4ed8);
	background: var(--scc-partner-badge-bg, #dbeafe);
}

.scc-provider__prices {
	margin: 6px 0 2px;
	padding-left: 18px;
	font-size: 13px;
	color: var(--scc-assistant-text);
}

.scc-provider__prices li {
	margin: 2px 0;
}

.scc-provider__price-note,
.scc-provider__caveat {
	color: var(--scc-muted);
	font-size: 12px;
}

.scc-provider__disclosure {
	font-style: italic;
}

.scc-provider__link {
	color: var(--scc-user);
	text-decoration: underline;
}

/* --- Modal launcher mode --- */
.scc-launcher-wrap {
	text-align: center;
	margin: 16px 0;
}

.scc-launcher {
	background: var(--scc-user, #2563eb);
	color: #ffffff;
	border: 0;
	border-radius: 999px;
	padding: 14px 24px;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
}

.scc-launcher:hover {
	background: var(--scc-user-hover, #1d4ed8);
}

.scc-launcher:focus {
	outline: 2px solid var(--scc-user, #2563eb);
	outline-offset: 2px;
}

.scc-modal[hidden] {
	display: none;
}

.scc-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.scc-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
}

.scc-modal__dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 660px;
	max-height: 90vh;
	background: #ffffff;
	border-radius: 12px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.scc-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	border-bottom: 1px solid #e2e6ea;
}

.scc-modal__title {
	margin: 0;
	font-size: 18px;
	line-height: 1.2;
}

.scc-modal__close {
	background: transparent;
	border: 0;
	font-size: 28px;
	line-height: 1;
	color: #6b7280;
	cursor: pointer;
	padding: 0 6px;
}

.scc-modal__close:hover {
	color: #111827;
}

/* Inside the modal the chat fills the dialog rather than centering. */
.scc-modal__dialog .scc-chat {
	max-width: none;
	border: 0;
	border-radius: 0;
	flex: 1;
	min-height: 0;
}

.scc-modal__dialog .scc-messages {
	height: auto;
	flex: 1;
}

/* Prevent the page behind the modal from scrolling. */
body.scc-modal-open {
	overflow: hidden;
}

.scc-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}
