/* USMoneyRoots Smart Assistant. All rules are scoped under .usmr-sa to avoid theme conflicts.
   Change the accent color in Smart Assistant > Settings. */
.usmr-sa {
	--usmr-sa-accent: #12395b;
	--usmr-sa-border: rgba(0, 0, 0, 0.15);
	--usmr-sa-bg: #fff;
	--usmr-sa-fg: #1d2327;
	--usmr-sa-soft: #f1f3f5;
	position: fixed;
	right: 16px;
	bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	z-index: 99990;
	font-family: inherit;
	font-size: 16px;
	line-height: 1.5;
	color: var(--usmr-sa-fg);
}
.usmr-sa *, .usmr-sa *::before, .usmr-sa *::after { box-sizing: border-box; }
.usmr-sa [hidden] { display: none !important; }
.usmr-sa__launcher {
	display: block;
	margin-left: auto;
	min-height: 48px;
	padding: 0.6rem 1.2rem;
	font: inherit;
	font-weight: 700;
	color: #fff;
	background: var(--usmr-sa-accent);
	border: 0;
	border-radius: 999px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
	cursor: pointer;
}
.usmr-sa__launcher:hover { filter: brightness(1.12); }
.usmr-sa__launcher:focus-visible, .usmr-sa__send:focus-visible, .usmr-sa__close:focus-visible,
.usmr-sa__chip:focus-visible, .usmr-sa input:focus-visible { outline: 3px solid #f5b800; outline-offset: 2px; }
.usmr-sa__panel {
	display: flex;
	flex-direction: column;
	width: 370px;
	max-width: calc(100vw - 32px);
	height: 540px;
	max-height: calc(100vh - 110px);
	margin-bottom: 12px;
	background: var(--usmr-sa-bg);
	border: 1px solid var(--usmr-sa-border);
	border-radius: 14px;
	box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28);
	overflow: hidden;
}
.usmr-sa__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0.75rem 1rem; color: #fff; background: var(--usmr-sa-accent); }
.usmr-sa__head strong { display: block; }
.usmr-sa__sub { display: block; font-size: 0.8em; opacity: 0.9; }
.usmr-sa__close { width: 44px; height: 44px; font-size: 1.6rem; line-height: 1; color: #fff; background: transparent; border: 0; cursor: pointer; }
.usmr-sa__log { flex: 1 1 auto; padding: 0.75rem; overflow-y: auto; overscroll-behavior: contain; }
.usmr-sa__msg { max-width: 92%; margin-bottom: 0.6rem; padding: 0.55rem 0.8rem; border-radius: 12px; font-size: 0.95em; word-wrap: break-word; }
.usmr-sa__msg p { margin: 0 0 0.5rem; }
.usmr-sa__msg p:last-child { margin-bottom: 0; }
.usmr-sa__msg--bot { background: var(--usmr-sa-soft); border-bottom-left-radius: 4px; }
.usmr-sa__msg--user { margin-left: auto; color: #fff; background: var(--usmr-sa-accent); border-bottom-right-radius: 4px; }
.usmr-sa__note { padding: 0.4rem 0.6rem; font-size: 0.88em; background: #fff8e1; border-left: 3px solid #f5b800; border-radius: 4px; }
.usmr-sa__src { font-size: 0.88em; }
.usmr-sa a { color: var(--usmr-sa-accent); text-decoration: underline; }
.usmr-sa__msg--user a { color: #fff; }
.usmr-sa__guides { margin: 0.4rem 0 0; padding-left: 1.1rem; }
.usmr-sa__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 0.4rem; }
.usmr-sa__chips--start { padding: 0 0.75rem 0.5rem; margin: 0; max-height: 110px; overflow-y: auto; }
.usmr-sa__chips--start:empty { display: none; }
.usmr-sa__chip {
	min-height: 36px;
	padding: 0.3rem 0.7rem;
	font: inherit;
	font-size: 0.85em;
	text-align: left;
	color: var(--usmr-sa-accent);
	background: #fff;
	border: 1px solid var(--usmr-sa-accent);
	border-radius: 999px;
	cursor: pointer;
}
.usmr-sa__chip:hover { background: var(--usmr-sa-soft); }
.usmr-sa__form { display: flex; gap: 6px; padding: 0.6rem 0.75rem 0.3rem; border-top: 1px solid var(--usmr-sa-border); }
.usmr-sa__form input { flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0.4rem 0.7rem; font: inherit; color: inherit; background: #fff; border: 1px solid var(--usmr-sa-border); border-radius: 8px; }
.usmr-sa__send { min-height: 44px; padding: 0 1rem; font: inherit; font-weight: 700; color: #fff; background: var(--usmr-sa-accent); border: 0; border-radius: 8px; cursor: pointer; }
.usmr-sa__foot { margin: 0; padding: 0.2rem 0.75rem 0.6rem; font-size: 0.74em; color: #50575e; }
.usmr-sa__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 480px) {
	.usmr-sa { right: 8px; left: 8px; }
	.usmr-sa__panel { width: 100%; max-width: 100%; height: min(78vh, 560px); }
}
@media (prefers-color-scheme: dark) {
	.usmr-sa { --usmr-sa-bg: #1e2327; --usmr-sa-fg: #eceff1; --usmr-sa-soft: #2b3238; --usmr-sa-border: rgba(255, 255, 255, 0.2); }
	.usmr-sa__form input { color: #eceff1; background: #14181b; }
	.usmr-sa__chip { background: transparent; color: #cfe3f5; border-color: #cfe3f5; }
	.usmr-sa a { color: #9cc9f0; }
	.usmr-sa__note { color: #1d2327; }
	.usmr-sa__foot { color: #b0b8bf; }
}
