@import url("https://fonts.googleapis.com/css2?family=Freeman&family=Inter:wght@300;400;500;600;700&display=swap");

:root {
	/* Saved blue/green palette 2026-05-12:
	--bg: #f4f6f8;
	--panel: #ffffff;
	--border: #d9e0e7;
	--accent: #246b5d;
	--accent-dark: #17483f;
	--sidebar: #17212b;
	--sidebar-active: #243341;
	*/
	--bg: #ffffff;
	--panel: #FCFCFD;
	--text: #25272c;
	--muted: #777c84;
	--border: #e6e7e5;
	--accent: #161a1f;
	--accent-dark: #05070a;
	--warning: #9a6700;
	--warning-bg: #fff4cf;
	--pending-note-bg: #f5f7fb;
	--pending-note-border: #d97706;
	--pending-note-text: #4b5563;
	--pending-note-title: #111827;
	--ok: #39a66b;
	--menu-green: #22c55e;
	--sidebar: #fcfcfc;
	--sidebar-text: #30343a;
	--sidebar-muted: #8a8f96;
	--sidebar-active: #ffffff;
	--navigation-menu-bg: #ffffff;
	--field-disabled: #f9f9fb;
	--brand-mark-bg: #171b20;
	--toast-bg: #171b20;
	--toast-text: #ffffff;
	--app-font: "Inter", Arial, Helvetica, sans-serif;
	--heading-font: var(--app-font);
	--brand-font: "Freeman", var(--app-font);
}

html[data-theme="dark"] {
	--bg: #101316;
	--panel: #171b20;
	--text: #f4f6f8;
	--muted: #a2aab4;
	--border: #2b3138;
	--accent: #f4f6f8;
	--accent-dark: #d7dde5;
	--warning: #facc15;
	--warning-bg: #3b2f12;
	--pending-note-bg: #1e2329;
	--pending-note-border: #d97706;
	--pending-note-text: #d7dde5;
	--pending-note-title: #f4f6f8;
	--ok: #4ade80;
	--sidebar: #111418;
	--sidebar-text: #e6eaf0;
	--sidebar-muted: #8d96a3;
	--sidebar-active: #1d232a;
	--navigation-menu-bg: rgb(36, 43, 52);
	--field-disabled: #20262d;
	--brand-mark-bg: #f4f6f8;
	--toast-bg: #f4f6f8;
	--toast-text: #101316;
}

/* Hide the page until localization.js has loaded the translation files, so it never flashes in English. */
html[data-i18n-pending] body {
	visibility: hidden;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .secondary-button,
html[data-theme="dark"] .sidebar-user-dropdown,
html[data-theme="dark"] .row-actions-menu,
html[data-theme="dark"] .message-reaction-menu {
	background-color: rgb(36, 43, 52);
	color: var(--text);
}

html[data-theme="dark"] .tab-button:hover,
html[data-theme="dark"] .message-thread {
	background: #151a20;
}

html[data-theme="dark"] .conversation-thread-panel,
html[data-theme="dark"] .thread-header-surface {
	background: #151a20;
}

html[data-theme="dark"] .message-bubble.patient,
html[data-theme="dark"] .conversation-status.status-closed {
	background: #242b34;
	color: var(--text);
}

html[data-theme="dark"] .message-bubble.assistant {
	background: #005c4b;
	color: #e9edef;
}

html[data-theme="dark"] .message-bubble.assistant time {
	color: rgba(233, 237, 239, 0.74);
}

html[data-theme="dark"] .test-chat-thread .message-bubble.assistant {
	background: #1e3a5f;
	color: #e9edef;
}

html[data-theme="dark"] .test-chat-thread .message-bubble.assistant time {
	color: rgba(233, 237, 239, 0.74);
}

html[data-theme="dark"] .conversation-status.status-paused {
	background: #3a2332;
	color: #f5d0fe;
}

html[data-theme="dark"] .conversation-status.status-inactive {
	background: #242b34;
	color: #c7d0db;
}

html[data-theme="dark"] .conversation-status.status-cooldown {
	background: #2a2617;
	color: #fde68a;
}

html[data-theme="dark"] .conversation-status.status-attention {
	background: #3a2618;
	color: #fdba74;
}

html[data-theme="dark"] .status-pill,
html[data-theme="dark"] .status-pill.muted {
	background: #242b34;
	color: var(--muted);
}

html[data-theme="dark"] .status-pill.success {
	background: #2f2448;
	color: #c4b5fd;
}

html[data-theme="dark"] .filter-chip {
	background: transparent;
	color: var(--muted);
}

html[data-theme="dark"] .filter-chip:hover {
	color: var(--text);
	background: rgba(244, 246, 248, 0.08);
}

html[data-theme="dark"] .filter-chip.active {
	background: #3779f0;
	color: #ffffff;
}

html[data-theme="dark"] .filter-chip-count {
	background: rgba(244, 246, 248, 0.14);
	color: #e6eaf0;
}

html[data-theme="dark"] .filter-chip.active .filter-chip-count {
	background: rgba(255, 255, 255, 0.22);
	color: #ffffff;
}

html[data-theme="dark"] .conversation-filter-scroller {
	background: #1a2027;
	border-color: var(--border);
}

html[data-theme="dark"] .primary-button {
	color: #101316;
}

html[data-theme="dark"] input:disabled,
html[data-theme="dark"] select:disabled,
html[data-theme="dark"] textarea:disabled {
	background-color: var(--field-disabled);
	color: var(--muted);
	-webkit-text-fill-color: var(--muted);
	opacity: 1;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
	color: #6f7884;
}

html[data-theme="dark"] input:disabled::placeholder,
html[data-theme="dark"] textarea:disabled::placeholder {
	color: transparent;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--app-font);
	font-weight: 400;
	font-size: 15px;
	line-height: 1.45;
}

.login-page {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 72px 0 0;
	overflow-x: hidden;
}

.login-shell {
	width: min(calc(100% - 48px), 380px);
}

.error-shell {
	width: min(calc(100% - 48px), 900px);
}

.error-panel {
	display: grid;
	gap: 12px;
	justify-items: center;
	text-align: center;
}

.error-phrase {
	font-size: clamp(34px, 7vw, 60px);
	font-weight: 700;
	line-height: 1.25;
	color: var(--text);
	margin: 0;
}

.error-status {
	font-size: 15px;
	color: var(--muted);
	margin: 0;
}

.error-back-link {
	margin-top: 16px;
	color: var(--accent-dark);
	font-size: 16px;
	font-weight: 600;
	text-decoration: underline;
}

.error-back-link:hover {
	text-decoration: none;
}

.site-meta-bar {
	width: 100%;
	margin-top: auto;
	padding: 10px 0 64px;
}

.site-meta {
	width: min(calc(100% - 40px), 1280px);
	margin: 0 auto;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 32px;
}

.site-copyright,
.site-meta-links a {
	color: #383838;
	font-size: 0.9rem;
	font-weight: 500;
}

.site-meta-links {
	grid-column: 2;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 18px 34px;
}

.site-meta-links a {
	font-weight: 600;
	text-decoration: none;
	transition: color 0.2s ease;
}

.site-meta-links a:hover {
	color: #000000;
}

html[data-theme="dark"] .site-copyright,
html[data-theme="dark"] .site-meta-links a {
	color: var(--muted);
}

html[data-theme="dark"] .site-meta-links a:hover {
	color: var(--text);
}

@media (max-width: 700px) {
	.site-meta {
		grid-template-columns: 1fr;
		justify-items: center;
		gap: 16px;
	}

	.site-meta-links {
		grid-column: 1;
		gap: 10px 24px;
	}
}

.onboarding-shell {
	width: min(100%, 640px);
	margin: 16px auto 48px;
}

.onboarding-page {
	display: flex;
	padding: 0 24px 24px;
}

.onboarding-topbar {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	align-items: center;
	width: 100%;
	padding: 20px 24px 0;
}

.onboarding-progress {
	grid-column: 1 / -1;
	grid-row: 1;
	justify-self: center;
	display: grid;
	gap: 8px;
	width: min(100%, 440px);
	margin: 0;
	padding-bottom: 0;
}

.onboarding-progress[hidden] {
	display: none !important;
}

.onboarding-topbar-logo {
	grid-column: 1;
	grid-row: 1;
	justify-self: start;
}

.flow-progress-summary {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 4px 16px;
	color: var(--text);
	font-size: 14px;
	line-height: 1.4;
}

.flow-progress-current strong {
	font-weight: 600;
}

.flow-progress-next {
	margin-left: auto;
	color: var(--muted);
}

.flow-progress-segments {
	display: flex;
	gap: 6px;
}

.flow-progress-segment {
	flex: 1;
	height: 6px;
	border-radius: 999px;
	background: var(--border);
}

.flow-progress-segment.is-reached {
	background: var(--accent);
}

.signup-progress {
	width: min(440px, calc(100vw - 40px));
	margin: 0 50% 32px;
	transform: translateX(-50%);
}

.signup-progress[hidden] {
	display: none !important;
}

.signup-flow-topbar {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	align-items: start;
	width: 100%;
	padding: 0 24px;
}

.signup-flow-topbar[hidden] {
	display: none !important;
}

/* The logo on login/sign-up pages links to the marketing site; the link is what gets placed. */
.auth-logo-link {
	display: block;
}

.signup-flow-logo-link {
	grid-column: 1;
	grid-row: 1;
	justify-self: start;
}

.signup-flow-topbar .signup-progress {
	grid-column: 1 / -1;
	grid-row: 1;
	justify-self: center;
	margin: 28px 0 0;
	transform: none;
}

.login-page.has-plan-flow {
	padding-top: 20px;
}

.has-plan-flow .auth-brand .auth-logo-link {
	display: none;
}

.has-plan-flow .login-shell {
	margin-top: 16px;
}

.onboarding-logout-button {
	grid-column: 3;
	grid-row: 1;
	justify-self: end;
}

.onboarding-panel {
	position: relative;
	display: grid;
	gap: 20px;
	padding: 24px;
}

.onboarding-panel::before,
.onboarding-panel::after {
	display: none;
}

.onboarding-page .onboarding-panel {
	background: #ffffff;
}

html[data-theme="dark"] .onboarding-panel {
	background: var(--panel);
}

html[data-theme="dark"] .onboarding-panel .faq-item {
	background: var(--field-disabled);
}

.onboarding-panel h1 {
	font-size: 28px;
	line-height: 1.2;
}

.onboarding-panel label {
	margin: 0;
	gap: 6px;
}

.onboarding-panel .login-button {
	min-height: 50px;
	margin-top: 4px;
	justify-content: center;
}

.onboarding-panel .login-message {
	margin: 0;
}

.onboarding-panel .login-message:empty {
	display: none;
}

.onboarding-section h3 {
	margin-bottom: 4px;
}

.onboarding-description-field {
	margin-bottom: 0px;
}

.field-hint.onboarding-legend {
	display: block;
	width: fit-content;
	margin-top: 12px;
	color: var(--muted);
	font-weight: 600;
	opacity: 1;
}

.onboarding-legend strong {
	font-weight: 600;
}

.onboarding-page #addFaqButton {
	color: var(--muted);
	font-weight: 400;
}

.onboarding-page #addFaqButton::after {
	font-weight: inherit;
}

/* A light gray note on the panel, with the amber stripe of the marketing site's "Próximamente" help
   note (.help-note-pending). */
.onboarding-history-note {
	margin: 32px 0 16px;
	padding: 14px 18px;
	border-left: 3px solid var(--pending-note-border);
	border-radius: 12px;
	background: var(--pending-note-bg);
	color: var(--pending-note-text);
	font-size: 14px;
	line-height: 1.6;
}

.onboarding-history-note p {
	margin: 0;
}

.onboarding-history-note .onboarding-history-note-title {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--pending-note-title);
	font-weight: 700;
}

.onboarding-history-note-icon {
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	color: var(--pending-note-border);
	stroke-width: 2.2;
}

.onboarding-history-note p + p {
	margin-top: 6px;
}

/* .onboarding-panel sets display: grid, which would otherwise override the hidden attribute
   used to switch between the onboarding steps. */
.onboarding-panel[hidden] {
	display: none;
}

/* Onboarding step 2 - "Connect your WhatsApp". */
.onboarding-steps,
.onboarding-notes {
	display: grid;
	gap: 8px;
	margin: 10px 0 0;
	padding-left: 22px;
	font-size: 14px;
	line-height: 1.5;
}

.onboarding-steps {
	color: var(--text);
}

.onboarding-steps li::marker {
	color: var(--muted);
	font-weight: 700;
}

.onboarding-notes {
	color: var(--muted);
}

.onboarding-step-buttons {
	display: grid;
	gap: 24px;
}

/* More room under Connect WhatsApp, before Back and Skip for now. */
.onboarding-whatsapp-step .onboarding-step-buttons {
	gap: 36px;
}

.onboarding-step-buttons .login-button {
	justify-content: center;
}

.onboarding-step-secondary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.onboarding-skip-button {
	border: 0;
	background: transparent;
	color: var(--accent-dark);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
	padding: 10px 4px;
	cursor: pointer;
}

/* .onboarding-legend sets display: block, which would otherwise override the hidden attribute
   used to hide the requirement once enough answers are approved. */
.field-hint.onboarding-legend[hidden] {
	display: none;
}

.auth-brand {
	display: grid;
	justify-items: center;
	gap: 6px;
	color: var(--text);
	margin-bottom: 20px;
	text-align: center;
}

.auth-logo {
	display: block;
	width: 72px;
	height: 72px;
	object-fit: contain;
	margin-bottom: 4px;
}

.auth-brand strong {
	font-family: var(--brand-font);
	font-size: 33px;
	font-weight: 400;
	line-height: 1.1;
}

.auth-brand span {
	color: var(--muted);
	font-size: 14px;
}

.login-panel {
	position: relative;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 32px 24px;
	min-height: 260px;
}

.login-panel::before,
.login-panel::after {
	content: "";
	position: absolute;
	top: 25%;
	/* Only as long as the gap to the screen edge (the panel is centered) - a full 100vw line
	   overflowed sideways, which iOS Safari lets you drag even with overflow-x: hidden. */
	width: max(0px, calc((100vw - 100%) / 2 - 12px));
	height: 1px;
	background: var(--border);
	pointer-events: none;
}

.login-panel::before {
	right: 100%;
}

.login-panel::after {
	left: 100%;
}

.login-button {
	width: 100%;
	margin-top: 4px;
}

/* Login, sign-up and onboarding: the dashboard menu's gray so the white card stands out. Dark mode keeps its own background. */
.login-screen {
	background: var(--sidebar);
}

html[data-theme="dark"] .login-screen {
	background: var(--bg);
}

.signup-page .login-shell {
	width: min(calc(100% - 32px), 490px);
	/* Keeps the footer links away from the card. */
	margin-bottom: 56px;
}

.signup-panel {
	background: #ffffff;
	padding: 24px;
}

.signup-panel::before,
.signup-panel::after {
	display: none;
}

html[data-theme="dark"] .signup-panel {
	background: var(--panel);
}

.signup-panel h1 {
	font-size: 28px;
	font-weight: 600;
	line-height: 1.2;
}

/* The login page has no plan badge between the title and the Google button. */
.signup-panel h1 + .signup-google-button {
	margin-top: 24px;
}

.signup-plan-badge {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	margin: 16px 0 24px;
	padding: 6px 14px;
	border-radius: 999px;
	background: var(--field-disabled);
	font-size: 14px;
}

.signup-plan-badge[hidden],
.signup-trial-note[hidden] {
	display: none;
}

.signup-panel a {
	color: var(--text);
	text-underline-offset: 2px;
}

.signup-panel form {
	display: grid;
	gap: 16px;
}

.signup-google-button {
	width: 100%;
	min-height: 48px;
	padding: 10px 16px;
	border: 1px solid var(--border);
	border-radius: 6px;
	background: transparent;
	color: var(--text);
	font-weight: 600;
}

.signup-google-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	cursor: pointer;
}

.signup-google-button:hover {
	background: var(--field-disabled);
}

.signup-google-icon {
	flex: none;
}

.signup-panel .signup-google-message {
	margin-top: 8px;
	text-align: center;
}

.signup-divider {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 24px 0;
	color: var(--muted);
	font-size: 13px;
}

.signup-divider::before,
.signup-divider::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--border);
}

.signup-panel label {
	margin: 0;
	gap: 6px;
}

.signup-panel input {
	min-height: 48px;
}

.signup-password-field {
	display: grid;
	gap: 6px;
}

.signup-password-input {
	position: relative;
}

.signup-password-input input {
	padding-right: 92px;
}

.signup-password-input button {
	position: absolute;
	top: 1px;
	right: 1px;
	bottom: 1px;
	padding: 0 14px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--text);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.signup-hint,
.signup-consent {
	margin: 0;
	color: var(--muted);
	font-size: 13px;
	line-height: 1.5;
}

.signup-panel .login-button {
	min-height: 50px;
	margin-top: 8px;
	justify-content: center;
}

.signup-trial-note,
.signup-consent,
.signup-panel .forgot-link {
	text-align: center;
}

.signup-consent {
	margin-top: 8px;
}

.signup-panel .forgot-link,
.signup-panel .login-message {
	margin: 0;
}

.signup-panel .login-message:empty {
	display: none;
}

.forgot-link {
	display: inline-block;
	color: var(--accent-dark);
	font-size: 13px;
	margin-top: 14px;
}

.forgot-link-strong {
	font-weight: 700;
}

.login-message {
	color: var(--accent-dark);
	font-size: 13px;
	line-height: 1.45;
	margin: 12px 0 0;
}

.login-message.attention {
	color: #9f3028;
}

.password-reset-success {
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	margin: 4px auto 16px;
	border-radius: 50%;
	background: #22c55e;
	color: #ffffff;
	font-size: 32px;
	font-weight: 700;
	line-height: 1;
}

.password-reset-success[hidden] {
	display: none;
}

.password-reset-request-complete .login-message {
	margin-top: 0;
	text-align: center;
}

.password-reset-request-complete .forgot-link {
	display: block;
	width: fit-content;
	margin: 14px auto 0;
	text-align: center;
}

button,
input,
select,
textarea {
	font: inherit;
}

.app-shell {
	height: 100vh;
	display: grid;
	grid-template-columns: 288px 1fr;
}

.app-shell.sidebar-collapsed {
	grid-template-columns: 76px 1fr;
}

/* "Getting your assistant ready" bar across the top of the page area while the WhatsApp history
   sync runs (dashboard.js renderHistorySyncBar). The shell gets a second row for it, so it stays
   in place while the page below scrolls. */
.history-sync-bar {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 42px;
	padding: 0 28px;
	background: var(--warning-bg);
	color: var(--warning);
	font-size: 14px;
	font-weight: 600;
}

.history-sync-bar-track {
	flex: 0 1 220px;
	height: 14px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--warning) 20%, transparent);
	overflow: hidden;
}

.history-sync-bar-fill {
	width: 0;
	height: 100%;
	border-radius: inherit;
	background: var(--warning);
	transition: width 0.4s ease;
}

.history-sync-bar-percent {
	font-variant-numeric: tabular-nums;
}

/* Shown inside the bar on phones only (see the max-width: 920px block). */
.history-sync-bar-label {
	display: none;
}

.app-shell.has-history-sync-bar {
	grid-template-rows: auto minmax(0, 1fr);
}

.app-shell.has-history-sync-bar > .sidebar {
	grid-row: 1 / span 2;
}

.app-shell.has-history-sync-bar > .history-sync-bar {
	grid-column: 2;
	grid-row: 1;
}

.app-shell.has-history-sync-bar > .main {
	grid-column: 2;
	grid-row: 2;
}

/* These pages fill the window height; leave room for the bar. */
.app-shell.has-history-sync-bar .conversation-workspace,
.app-shell.has-history-sync-bar .test-chat-panel {
	height: max(480px, calc(100vh - 158px - 42px));
}

/* Mobile-only navigation chrome - shown by the max-width: 920px block below. */
.mobile-topbar,
.mobile-drawer-close,
.mobile-drawer-backdrop {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.sidebar,
	.mobile-drawer-backdrop {
		transition: none !important;
	}
}

.sidebar {
	background: var(--sidebar);
	color: var(--sidebar-text);
	display: flex;
	flex-direction: column;
	padding: 24px 18px;
	border-right: 1px solid var(--border);
	position: sticky;
	top: 0;
	height: 100vh;
	z-index: 1;
}

.sidebar-collapse-toggle {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--sidebar-muted);
	background: transparent;
	border: 0;
	cursor: pointer;
	margin-top: auto;
	padding: 10px 12px;
	border-radius: 6px;
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	width: fit-content;
	text-align: left;
}

.sidebar-collapse-toggle:hover {
	background: var(--sidebar-active);
	color: var(--text);
	box-shadow: 0 0 0 1px var(--border);
}

/* Icon-only rail - desktop only; the mobile drawer always shows full labels. */
@media (min-width: 921px) {
	.sidebar-collapsed .sidebar {
		padding-left: 14px;
		padding-right: 14px;
	}

	.sidebar-collapsed .nav-label,
	.sidebar-collapsed .sidebar-help-link span,
	.sidebar-collapsed .sidebar-user-name,
	.sidebar-collapsed .sidebar-user-caret,
	.sidebar-collapsed .brand span {
		display: none;
	}

	.sidebar-collapsed .nav-list a,
	.sidebar-collapsed .nav-list button,
	.sidebar-collapsed .sidebar-help-link,
	.sidebar-collapsed .sidebar-collapse-toggle,
	.sidebar-collapsed .sidebar-user-trigger {
		justify-content: center;
	}

	.sidebar-collapsed .nav-list-heading {
		display: none;
	}

	.sidebar-collapsed .channel-nav-toggle,
	.sidebar-collapsed .channel-submenu {
		display: none;
	}

	.sidebar-collapsed .sidebar-collapse-toggle,
	.sidebar-collapsed .sidebar-user-trigger {
		width: 100%;
		min-width: 0;
	}

	.sidebar-collapsed .sidebar-user-menu {
		width: 100%;
	}

	.sidebar-collapsed .channel-nav-group {
		position: relative;
	}

	.sidebar-collapsed .channel-nav-group:has(.channel-submenu a.active) [data-nav-channel],
	.sidebar-collapsed .channel-nav-group.flyout-open [data-nav-channel] {
		background: var(--sidebar-active);
		color: var(--text);
		box-shadow: 0 0 0 1px var(--border);
	}

	.sidebar-collapsed .channel-nav-group.flyout-open .channel-submenu {
		display: grid;
		position: absolute;
		left: calc(100% + 14px);
		top: 0;
		z-index: 10;
		min-width: 160px;
		width: max-content;
		max-width: min(320px, calc(100vw - 90px));
		margin: 0;
	}

	.sidebar-collapsed .nav-list .channel-submenu a {
		justify-content: flex-start;
		padding: 10px 12px;
		font-size: 14px;
		color: var(--text);
	}

	.sidebar-collapsed .nav-list .channel-submenu a:hover {
		background: var(--field-disabled);
		color: var(--text);
		box-shadow: none;
	}

	.sidebar-collapsed .nav-list .channel-submenu a.active {
		background: var(--sidebar-active);
		color: var(--text);
		box-shadow: 0 0 0 1px var(--border);
	}
}

.brand {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 32px;
}

.brand-mark {
	width: 36px;
	height: 36px;
	display: grid;
	place-items: center;
	border-radius: 8px;
	background: var(--brand-mark-bg);
	color: #ffffff;
	font-weight: 600;
}

.brand-logo {
	display: block;
	width: 46px;
	height: 46px;
	object-fit: contain;
	flex: 0 0 auto;
}

.brand span,
.eyebrow {
	display: block;
	color: var(--sidebar-muted);
	font-size: 12px;
	margin-top: 2px;
}

.brand span {
	color: var(--sidebar-muted);
}

.eyebrow {
	color: var(--ok);
	font-weight: 600;
}

h1,
h2,
h3,
.thread-header h2,
.panel-heading h2,
.auth-brand strong {
	font-family: var(--heading-font);
}

.brand strong,
.auth-brand strong {
	font-family: var(--brand-font);
	font-weight: 400;
}

.nav-list {
	display: grid;
	gap: 6px;
}

.nav-list a,
.nav-list button {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	color: var(--sidebar-text);
	text-decoration: none;
	border: 0;
	background: transparent;
	cursor: pointer;
	padding: 10px 12px;
	border-radius: 6px;
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	text-align: left;
}

.nav-list a[hidden],
.nav-list button[hidden] {
	display: none;
}

.nav-list .channel-nav-group[hidden] {
	display: none;
}

.channel-nav-header {
	display: flex;
	align-items: center;
}

.nav-list .channel-nav-header [data-nav-channel] {
	flex: 1 1 auto;
	min-width: 0;
}

.nav-list .channel-nav-toggle {
	width: 36px;
	min-width: 36px;
	justify-content: center;
	padding: 10px 8px;
}

.channel-nav-caret {
	width: 16px;
	height: 16px;
	color: var(--sidebar-muted);
	transition: transform 0.18s ease;
}

.channel-nav-group.is-collapsed .channel-nav-caret {
	transform: rotate(-90deg);
}

.channel-nav-group.is-collapsed .channel-submenu {
	display: none;
}

.channel-submenu {
	display: grid;
	gap: 2px;
	margin: 2px 0 6px 28px;
}

.nav-list .channel-submenu a {
	padding: 7px 12px;
	font-size: 13px;
	font-weight: 500;
	color: var(--sidebar-muted);
}

.nav-list .channel-submenu a:hover,
.nav-list .channel-submenu a.active {
	color: var(--sidebar-text);
	background: var(--sidebar-active);
}

.nav-list-heading {
	color: var(--sidebar-muted);
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin: 18px 0 2px;
	padding: 0 12px;
}

.nav-list-heading:first-child {
	margin-top: 0;
}

.nav-icon {
	width: 16px;
	height: 16px;
	stroke-width: 2.2;
	flex: 0 0 auto;
}

.nav-icon-automation {
	color: #8b5cf6;
}

.nav-icon-conversations,
.nav-icon-whatsapp,
.whatsapp-icon {
	color: var(--menu-green);
}

.nav-icon-webchat {
	color: #3b82f6;
}

.business-whatsapp-link-button[hidden] {
	display: none;
}

.nav-icon-business {
	color: #f59e0b;
}

.nav-icon-knowledge {
	color: #3779f0;
}

.nav-icon-account {
	color: #10b981;
}

.nav-icon-users {
	color: #ec4899;
}

.nav-icon-settings {
	color: #64748b;
}

.sidebar-help-link {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--sidebar-muted);
	text-decoration: none;
	padding: 10px 12px;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 500;
}

.sidebar-help-link:hover {
	background: var(--sidebar-active);
	color: var(--text);
	box-shadow: 0 0 0 1px var(--border);
}

.sidebar-user-menu {
	position: relative;
	margin-top: 6px;
	width: max-content;
	max-width: 100%;
}

.sidebar-user-trigger {
	display: flex;
	align-items: center;
	gap: 10px;
	width: max-content;
	min-width: 100%;
	border: 0;
	background: transparent;
	color: var(--sidebar-text);
	padding: 10px 12px;
	border-radius: 6px;
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	text-align: left;
	cursor: pointer;
}

.sidebar-user-trigger:hover,
.sidebar-user-trigger[aria-expanded="true"] {
	background: var(--sidebar-active);
	color: var(--text);
	box-shadow: 0 0 0 1px var(--border);
}

.sidebar-user-name {
	flex: 0 1 auto;
	min-width: 0;
	white-space: normal;
	overflow-wrap: anywhere;
}

.sidebar-user-caret {
	width: 15px;
	height: 15px;
	stroke-width: 2.2;
	color: var(--sidebar-muted);
	flex: 0 0 auto;
}

.sidebar-user-dropdown {
	position: absolute;
	bottom: calc(100% + 6px);
	left: 0;
	min-width: 100%;
	width: max-content;
	max-width: min(320px, calc(100vw - 36px));
	display: grid;
	gap: 2px;
	z-index: 10;
}

.sidebar-user-dropdown,
.sidebar-collapsed .channel-nav-group.flyout-open .channel-submenu {
	background: var(--navigation-menu-bg);
	color: var(--text);
	border: 1px solid var(--border);
	border-radius: 8px;
	box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
	padding: 6px;
}

.sidebar-user-dropdown[hidden] {
	display: none;
}

.sidebar-user-dropdown-item {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--text);
	text-decoration: none;
	text-align: left;
	padding: 10px 12px;
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
}

.sidebar-user-dropdown-item:hover {
	background: var(--field-disabled);
}

.main {
	min-width: 0;
	padding: 28px;
	overflow: auto;
}

.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 22px;
}

h1,
h2,
p {
	margin: 0;
}

h1 {
	font-size: 27px;
	line-height: 1.15;
}

.title-row {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.ai-powered-badge {
	display: inline-flex;
	align-items: center;
	border-radius: 999px;
	background: #ede9fe;
	color: #6d28d9;
	padding: 5px 10px;
	font-size: 12px;
	font-weight: 700;
}

h2 {
	font-size: 18px;
}

h3 {
	margin: 0;
	font-size: 15px;
}

.title-with-icon {
	display: flex;
	align-items: center;
	gap: 8px;
}

.title-icon {
	width: 16px;
	height: 16px;
	stroke-width: 2.2;
	flex: 0 0 auto;
}

.title-icon-automation {
	color: #8b5cf6;
}

.topbar-actions,
.field-row,
.toggle-row {
	display: flex;
	gap: 12px;
}

.topbar-actions {
	align-items: center;
}

.form-actions {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
	margin-top: 4px;
}

#addUserModal .form-actions,
#addAddressModal .form-actions {
	margin-top: 20px;
}

.form-actions > button[hidden] {
	display: none;
}

.modal-backdrop {
	position: fixed;
	inset: 0;
	display: grid;
	place-items: center;
	background: rgba(15, 23, 42, 0.45);
	padding: 24px;
	z-index: 20;
}

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

.modal-panel {
	width: min(100%, 680px);
	max-height: calc(100vh - 48px);
	overflow: auto;
}

.toast-notification {
	position: fixed;
	left: 24px;
	bottom: 24px;
	z-index: 40;
	background: var(--toast-bg);
	color: var(--toast-text);
	border-radius: 8px;
	box-shadow: 0 12px 30px rgba(15, 23, 42, 0.22);
	font-weight: 700;
	padding: 12px 16px;
	opacity: 0;
	pointer-events: none;
	transform: translateY(12px);
	transition: opacity 160ms ease, transform 160ms ease;
}

.toast-notification.attention {
	background: #9f3028;
}

.toast-notification.show {
	opacity: 1;
	transform: translateY(0);
}

.primary-button,
.secondary-button {
	display: inline-flex;
	align-items: center;
	border: 1px solid transparent;
	border-radius: 6px;
	padding: 10px 14px;
	cursor: pointer;
	font-weight: 500;
	text-decoration: none;
}

.primary-button {
	background: var(--accent);
	color: #ffffff;
}

.primary-button:hover {
	background: var(--accent-dark);
}

.secondary-button {
	background: #ffffff;
	border-color: var(--border);
	color: var(--text);
}

.danger-button {
	border: 1px solid transparent;
	border-radius: 6px;
	padding: 10px 14px;
	cursor: pointer;
	font-weight: 500;
	background: #9f3028;
	color: #ffffff;
}

.danger-button:hover {
	background: #7f2620;
}

.trial-badge {
	display: inline-flex;
	align-items: center;
	min-height: 42px;
	border: 1px solid #facc15;
	border-radius: 6px;
	background: #fef3c7;
	color: #8a5a00;
	padding: 10px 14px;
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
}

.trial-badge[hidden] {
	display: none;
}

.ios-toggle-field {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	min-height: 42px;
	margin: 0;
	margin-right: 8px;
}

.ios-toggle-label {
	color: var(--text);
	font-size: 13px;
	font-weight: 600;
}

.ios-toggle {
	position: relative;
	display: inline-flex;
	flex: 0 0 auto;
	width: 44px;
	height: 26px;
}

.ios-toggle input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	opacity: 0;
	cursor: pointer;
	z-index: 1;
}

.ios-toggle-track {
	position: absolute;
	inset: 0;
	border-radius: 999px;
	background: #d9dbe0;
	transition: background-color 0.18s ease;
}

.ios-toggle-thumb {
	position: absolute;
	top: 2px;
	left: 2px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #ffffff;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.35);
	transition: transform 0.18s ease;
}

.ios-toggle input:checked ~ .ios-toggle-track {
	background: var(--menu-green);
}

.ios-toggle input:checked ~ .ios-toggle-thumb {
	transform: translateX(18px);
}

.ios-toggle input:focus-visible ~ .ios-toggle-track {
	box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}

.ios-toggle input:disabled {
	cursor: not-allowed;
	opacity: 0;
	background: transparent;
	-webkit-text-fill-color: transparent;
}

.ios-toggle input:disabled ~ .ios-toggle-track {
	background: #d9dbe0;
	opacity: 0.6;
	cursor: not-allowed;
}

.ios-toggle input:checked:disabled ~ .ios-toggle-track {
	background: #d9dbe0;
	opacity: 0.6;
}

.ios-toggle input:disabled ~ .ios-toggle-thumb {
	background: #f4f4f5;
	opacity: 0.92;
}

.ios-toggle input:checked:disabled ~ .ios-toggle-thumb {
	background: #ffffff;
	opacity: 1;
}

.ios-toggle-field:has(input:disabled) {
	cursor: not-allowed;
}

html[data-theme="dark"] .ios-toggle-track {
	background: #3a3f47;
}

html[data-theme="dark"] .ios-toggle input:disabled ~ .ios-toggle-track,
html[data-theme="dark"] .ios-toggle input:checked:disabled ~ .ios-toggle-track {
	background: #3a3f47;
}

html[data-theme="dark"] .ios-toggle input:disabled {
	opacity: 0;
	background: transparent;
	-webkit-text-fill-color: transparent;
}

html[data-theme="dark"] .ios-toggle input:checked:disabled ~ .ios-toggle-track {
	background: #3a3f47;
	opacity: 1;
}

html[data-theme="dark"] .ios-toggle input:disabled ~ .ios-toggle-thumb {
	background: #dfe6ee;
	opacity: 0.96;
}

html[data-theme="dark"] .ios-toggle input:checked:disabled ~ .ios-toggle-thumb {
	background: #ffffff;
	opacity: 1;
}

button:disabled {
	background: #f1f4f7;
	border-color: var(--border);
	color: #8a96a3;
	cursor: not-allowed;
}

button.is-busy {
	background: #c8d0d8;
	border-color: #c8d0d8;
	color: #536171;
	transform: translateY(1px);
}

.small {
	padding: 7px 10px;
	font-size: 13px;
}

.add-button::after {
	content: "+";
	display: inline-block;
	margin-left: 8px;
	font-weight: 700;
}

#addFaqButton::after {
	order: -1;
	margin-right: 8px;
	margin-left: 0;
}

.add-button.has-existing-value::after {
	content: "+-";
}

.faq-action-button,
.faq-import-button {
	background: #ffffff;
	border-color: var(--border);
	color: #101316;
	padding: 8px 12px;
	font-size: 14px;
}

.faq-action-button:hover,
.faq-import-button:hover {
	background: #f2f3f1;
	border-color: var(--border-strong);
}

.faq-import-button {
	gap: 6px;
}

.faq-import-button svg {
	width: 16px;
	height: 16px;
}

html[data-theme="dark"] .faq-action-button,
html[data-theme="dark"] .faq-import-button {
	background: #ffffff;
	color: #101316;
}

html[data-theme="dark"] .faq-action-button:hover,
html[data-theme="dark"] .faq-import-button:hover {
	background: #e6e7e5;
}

.section-grid,
.content-grid {
	display: grid;
	gap: 16px;
}

.metrics {
	grid-template-columns: repeat(4, minmax(0, 1fr));
	margin-bottom: 16px;
}

.metric,
.panel {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 8px;
}

.metric {
	padding: 16px;
}

.metric span {
	display: block;
	color: var(--muted);
	font-size: 13px;
	margin-bottom: 8px;
}

.metric strong {
	font-size: 20px;
}

.content-grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.automation-tabs {
	display: grid;
	gap: 0;
	width: 100%;
	max-width: none;
}

.tab-list {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0;
	width: 100%;
	align-self: end;
	justify-self: stretch;
	padding-left: 6px;
}

.tab-button {
	position: relative;
	top: 1px;
	border: 1px solid transparent;
	border-bottom: 0;
	border-radius: 8px 8px 0 0;
	background: transparent;
	color: var(--muted);
	cursor: pointer;
	font: inherit;
	font-weight: 700;
	padding: 11px 18px;
	white-space: nowrap;
}

.tab-button:hover {
	color: var(--text);
	background: #ffffff;
}

.tab-button.active,
.tab-button[aria-selected="true"] {
	background: var(--panel);
	border-color: var(--border);
	box-shadow: none;
	color: var(--text);
	padding-bottom: 12px;
}

.automation-tab-panels {
	display: grid;
	gap: 16px;
	width: 100%;
}

.form-panel {
	max-width: 760px;
	width: 100%;
}

.automation-tab-panels > .form-panel {
	max-width: 940px;
}

.wide-form-panel {
	max-width: 860px;
}

.single-panel {
	grid-template-columns: minmax(0, 720px);
}

.account-grid {
	grid-template-columns: minmax(300px, 440px) minmax(0, 1fr);
}

.panel {
	padding: 28px;
}

.wide,
.table-panel {
	grid-column: 1 / -1;
}

.panel-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
}

.panel-heading-copy {
	display: grid;
	gap: 10px;
	min-width: 0;
	width: 100%;
}

.onboarding-panel .panel-heading-copy {
	max-width: 400px;
}

.panel-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	justify-content: flex-end;
	margin-left: auto;
}

.panel-heading > .add-button {
	margin-left: auto;
}

.icon-text-button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.conversation-filter-scroller {
	display: flex;
	align-items: center;
	gap: 2px;
	min-width: 0;
	width: 100%;
	padding: 2px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: #f7f8f7;
}

.filter-scroll-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 28px;
	width: 28px;
	align-self: stretch;
	min-height: 27px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: color-mix(in srgb, var(--panel) 65%, transparent);
	color: color-mix(in srgb, var(--text) 75%, transparent);
	cursor: pointer;
}

.filter-scroll-button[hidden] {
	display: none;
}

.filter-scroll-button:disabled {
	opacity: 0.35;
	cursor: default;
}

.filter-scroll-button:not(:disabled):hover {
	background: color-mix(in srgb, var(--field-disabled) 85%, transparent);
	color: var(--text);
}

.filter-scroll-button svg {
	width: 16px;
	height: 16px;
}

@media (max-width: 640px) {
	.filter-scroll-button {
		display: none;
	}
}

.conversation-status-filter {
	display: flex;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	margin: 0;
	flex-wrap: nowrap;
	gap: 2px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	overflow-x: auto;
	scrollbar-width: none;
}

.conversation-status-filter::-webkit-scrollbar {
	display: none;
}

.filter-chip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	min-width: 0;
	min-height: 27px;
	padding: 2px 6px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--muted);
	cursor: pointer;
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.filter-chip-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	min-width: 14px;
	height: 14px;
	padding: 0 3px;
	margin-left: 4px;
	border-radius: 999px;
	background: rgba(15, 23, 42, 0.1);
	color: inherit;
	font-size: 9px;
	font-weight: 700;
	line-height: 1;
}

.filter-chip-count.has-alert-count {
	color: #ffffff;
}

.filter-chip:hover {
	color: var(--text);
	background: rgba(22, 26, 31, 0.05);
}

.filter-chip.active {
	background: #3779f0;
	color: #ffffff;
	padding-left: 10px;
	padding-right: 10px;
}

.filter-chip.active .filter-chip-count {
	background: rgba(255, 255, 255, 0.22);
}

.filter-chip.active .filter-chip-count.has-alert-count {
	color: #ffffff;
}

.filter-chip[data-conversation-filter="all"].active {
	background: #3779f0;
	color: #ffffff;
}

.filter-chip[data-conversation-filter="handled"].active {
	background: #3779f0;
	color: #ffffff;
}

.filter-chip[data-conversation-filter="paused"].active {
	background: #3779f0;
	color: #ffffff;
}

.filter-chip[data-conversation-filter="needs_attention"].active {
	background: #3779f0;
	color: #ffffff;
}

.filter-chip[data-conversation-filter="all"].active .filter-chip-count,
.filter-chip[data-conversation-filter="handled"].active .filter-chip-count {
	background: rgba(255, 255, 255, 0.22);
	color: inherit;
}

.filter-chip[data-conversation-filter="paused"].active .filter-chip-count {
	background: rgba(22, 26, 31, 0.12);
	color: inherit;
}

.filter-chip[data-conversation-filter="needs_attention"].active .filter-chip-count {
	background: rgba(255, 255, 255, 0.22);
	color: inherit;
}

.filter-chip[data-conversation-filter="needs_attention"].active .filter-chip-count.has-alert-count {
	color: #ffffff;
}

html[data-theme="dark"] .filter-chip[data-conversation-filter="needs_attention"].active .filter-chip-count {
	background: rgba(255, 255, 255, 0.22);
	color: inherit;
}

html[data-theme="dark"] .filter-chip[data-conversation-filter="needs_attention"].active .filter-chip-count.has-alert-count {
	background: rgba(22, 26, 31, 0.28);
	color: #ffffff;
}

html[data-theme="dark"] .filter-chip[data-conversation-filter="paused"].active .filter-chip-count {
	background: rgba(22, 26, 31, 0.28);
	color: inherit;
}

.button-icon {
	width: 14px;
	height: 14px;
	stroke-width: 2.2;
	flex: 0 0 auto;
}

.button-icon.muted {
	color: #8a8f96;
}

.field-hint {
	font-size: 12px;
	font-weight: 400;
	color: var(--muted);
	opacity: 0.75;
	margin-top: 12px;
}

.name-guess {
	display: block;
	font-size: 0.7em;
	font-weight: 400;
	color: var(--muted);
	opacity: 0.7;
	line-height: 1.2;
}

label {
	display: grid;
	gap: 7px;
	color: var(--muted);
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 24px;
	margin-top: 10px;
}

.label-with-help {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	width: fit-content;
}

.help-tooltip {
	position: relative;
	display: inline-grid;
	place-items: center;
	width: 18px;
	height: 18px;
	border: 1px solid var(--border);
	border-radius: 50%;
	background: #f1f4f7;
	color: #4f5d6a;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	cursor: help;
}

.help-tooltip-text {
	position: absolute;
	left: calc(100% + 8px);
	top: 50%;
	transform: translateY(-50%);
	z-index: 20;
	display: none;
	width: min(320px, 78vw);
	padding: 2px 12px;
	border-radius: 6px;
	background: #17212b;
	color: #ffffff;
	box-shadow: var(--shadow);
	font-size: 12px;
	font-weight: 500;
	line-height: 1.45;
}

.help-tooltip:hover .help-tooltip-text,
.help-tooltip:focus .help-tooltip-text {
	display: block;
}

input,
select,
textarea {
	width: 100%;
	border: 1px solid var(--border);
	border-radius: 6px;
	background: #ffffff;
	color: var(--text);
	padding: 10px 11px;
	min-height: 42px;
}

select {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	padding-right: 44px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%23777c84' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 12px 12px;
}

html[data-theme="dark"] select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%23a2aab4' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 12px 12px;
}

input:focus,
select:focus,
textarea:focus {
	border-color: #a5a9ae;
	box-shadow: 0 0 0 3px rgba(32, 35, 39, 0.08);
	outline: none;
}

input::placeholder,
textarea::placeholder {
	color: #B3B5BA;
}

input:disabled::placeholder,
textarea:disabled::placeholder {
	color: transparent;
}

input:disabled,
select:disabled,
textarea:disabled {
	background-color: var(--field-disabled);
	color: #7b8794;
	cursor: not-allowed;
}

textarea {
	resize: vertical;
}

 .field-row {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	align-items: start;
}

.field-row > label {
	flex: 1;
	margin-bottom: 0;
}

.assistant-sections-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	margin-bottom: 18px;
}

.single-assistant-panel {
	grid-template-columns: minmax(0, 1fr);
}

.assistant-section-panel {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 16px;
	background: var(--panel);
}

.assistant-section-panel.is-muted {
	opacity: 0.72;
}

.assistant-section-title {
	margin: 0 0 14px;
	font-size: 0.98rem;
	font-weight: 700;
	color: var(--text);
}

.assistant-section-panel .form-actions {
	margin-top: auto;
	padding-top: 12px;
}

.assistant-section-panel .field-row:last-child,
.assistant-section-panel label:last-child {
	margin-bottom: 0;
}

@media (max-width: 900px) {
	.assistant-sections-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.field-row {
		grid-template-columns: minmax(0, 1fr);
	}
}

.toggle-row {
	flex-wrap: wrap;
}

.availability-box {
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 14px;
	margin-bottom: 14px;
}

.availability-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

.availability-header span {
	color: var(--muted);
	font-size: 12px;
}

.panel-note {
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 14px;
	margin-bottom: 14px;
}

.panel-note span {
	color: var(--muted);
	font-size: 12px;
}

.warning-banner {
	display: grid;
	gap: 4px;
	border: 1px solid #facc15;
	border-radius: 8px;
	background: var(--warning-bg);
	color: var(--warning);
	padding: 12px 14px;
	margin-bottom: 14px;
}

.warning-banner strong {
	font-size: 14px;
}

.warning-banner span {
	font-size: 13px;
}

.panel-description {
	color: var(--muted);
	font-size: 13px;
	margin: -6px 0 14px;
}

.plan-usage {
	display: grid;
	gap: 8px;
	margin-top: 16px;
}

.plan-usage-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	font-size: 13px;
	font-weight: 600;
	color: var(--text);
}

.plan-usage-header span:last-child {
	color: var(--muted);
	font-weight: 500;
}

.plan-usage-track {
	height: 8px;
	border-radius: 999px;
	background: var(--field-disabled);
	overflow: hidden;
}

.plan-usage-fill {
	height: 100%;
	border-radius: 999px;
	background: var(--ok);
	transition: width 0.18s ease, background-color 0.18s ease;
}

.plan-usage-fill.warning {
	background: var(--warning);
}

.plan-usage-fill.attention {
	background: #dc2626;
}

.availability-box .field-row label {
	margin-bottom: 0;
}

.schedule-list {
	display: grid;
	gap: 10px;
	margin-bottom: 10px;
}

.schedule-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
	gap: 10px;
	align-items: end;
}

.schedule-row label {
	margin: 0;
}

.weekly-schedule-list {
	display: grid;
	gap: 12px;
}

.custom-schedule-list {
	display: grid;
	gap: 10px;
}

.custom-schedule-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: -6px 0 14px;
}

.custom-schedule-heading .panel-description {
	margin: 0;
}

.custom-schedule-row {
	grid-template-columns: minmax(120px, 0.9fr) minmax(0, 1fr) minmax(0, 1fr) auto;
}

.custom-schedule-empty {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.weekly-schedule-day {
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 12px;
}

.weekly-schedule-day-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 10px;
}

.weekly-schedule-day-header strong {
	font-size: 14px;
}

.weekly-schedule-day .schedule-list {
	margin-bottom: 10px;
}

.schedule-actions {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 18px;
}

.icon-button {
	display: inline-grid;
	place-items: center;
	width: 34px;
	height: 34px;
	padding: 0;
}

.icon-button[hidden] {
	display: none;
}

.faq-list {
	display: grid;
	gap: 12px;
}

.faq-item {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 14px;
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 10px;
}

.onboarding-panel .faq-item {
	background-color: var(--field-disabled);
}

.faq-copy {
	display: grid;
	gap: 6px;
	min-width: 0;
}

.faq-title-row {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	min-width: 0;
}

.faq-copy strong,
.faq-copy p {
	overflow-wrap: anywhere;
}

.faq-copy strong {
	color: #4f5864;
	font-size: 14px;
}

.faq-copy p {
	color: var(--muted);
	font-size: 13px;
	line-height: 1.45;
	margin: 0;
}

#faqs .faq-copy strong {
	font-size: 15px;
}

#faqs .faq-copy p {
	font-size: 14px;
}

#faqs .faq-copy {
	padding-left: 10px;
}

.faq-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	flex-wrap: wrap;
}

.empty-state {
	border: 1px dashed var(--border);
	border-radius: 8px;
	color: var(--muted);
	padding: 14px;
	font-size: 13px;
}

.user-list {
	display: grid;
	border-top: 1px solid var(--border);
}

.user-row {
	display: grid;
	grid-template-columns: minmax(150px, 1fr) minmax(190px, 1.2fr) minmax(78px, 90px) minmax(130px, 0.75fr) minmax(64px, 80px);
	align-items: center;
	gap: 12px;
	border-bottom: 1px solid var(--border);
	padding: 12px 0;
	color: var(--muted);
	font-size: 13px;
}

.user-row-heading {
	color: var(--muted);
	font-weight: 700;
	padding-top: 10px;
}

.user-row strong {
	display: block;
	color: var(--text);
	font-size: 15px;
}

.user-name-cell {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.user-avatar {
	width: 30px;
	height: 30px;
	display: grid;
	place-items: center;
	flex: 0 0 auto;
	border-radius: 50%;
	background: #8b5cf6;
	color: #ffffff;
	font-size: 12px;
	font-weight: 700;
}

.user-row span {
	overflow-wrap: anywhere;
}

.user-actions {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
	min-height: 32px;
}

.toggle {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--text);
	font-weight: 600;
	margin: 0;
}

.setting-toggle {
	margin: 4px 0 8px;
}

.toggle input {
	width: 18px;
	height: 18px;
	min-height: 18px;
}

.status-pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: fit-content;
	border-radius: 999px;
	background: #f4f5f4;
	color: #42464d;
	padding: 4px 9px;
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
}

.status-pill[hidden] {
	display: none;
}

/* Handoff tab: a vertical tab per handoff type, with that type's settings beside it. Colors come
   from the theme tokens, so light and dark mode both follow them. */
.handoff-section {
	border: 0;
	padding: 0;
	background: transparent;
}

.handoff-types {
	display: grid;
	gap: 12px;
}

.handoff-types-title {
	color: var(--muted);
	font-size: 13px;
	font-weight: 600;
}

.handoff-types-hint {
	margin-top: -6px;
	color: var(--muted);
	font-size: 12px;
	opacity: 0.75;
}

/* The selected tab joins the settings panel: it overlaps the panel's left border by 1px and
   shares its background, like the page tabs above. */
.handoff-layout {
	display: grid;
	grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
}

/* The settings panel runs the full height of the tab list. */
.handoff-type-panels {
	display: grid;
}

.handoff-type-tabs {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.handoff-type-tab {
	border: 1px solid transparent;
	border-radius: 8px;
	background: transparent;
	color: var(--muted);
	cursor: pointer;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	padding: 10px 12px;
	text-align: left;
}

.handoff-type-tab:hover {
	color: var(--text);
}

.handoff-type-tab[aria-selected="true"] {
	position: relative;
	z-index: 1;
	margin-right: -1px;
	border-color: var(--border);
	border-right-color: var(--panel);
	border-radius: 8px 0 0 8px;
	background: var(--panel);
	color: var(--text);
}

.handoff-type {
	display: grid;
	gap: 7px;
	align-content: start;
	padding: 12px;
	border: 1px solid var(--border);
	/* The left side touches the tabs, so it stays square wherever the selected tab joins it. */
	border-radius: 0 8px 8px 0;
	background: var(--panel);
}

.handoff-type[hidden],
.handoff-type textarea[hidden] {
	display: none;
}

.handoff-type-examples {
	color: var(--muted);
	font-size: 12px;
}

@media (max-width: 600px) {
	.handoff-layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.handoff-layout {
		gap: 8px;
	}

	.handoff-type-tabs {
		flex-direction: row;
		flex-wrap: wrap;
	}

	/* Stacked above the settings, the tabs stand on their own instead of joining the panel. */
	.handoff-type-tab[aria-selected="true"] {
		margin-right: 0;
		border-right-color: var(--border);
		border-radius: 8px;
	}

	.handoff-type {
		border-radius: 8px;
	}
}

.field-label-row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}

.status-pill.muted {
	background: #f3f4f2;
	color: #6d727a;
}

.status-pill.warning {
	background: var(--warning-bg);
	color: var(--warning);
}

.status-pill.success {
	background: #dafbe1;
	color: #1a7f37;
}

.status-pill.status-archived {
	background: #eceef1;
	color: #58606b;
}

.connection-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
}

.connection-grid.single-column {
	grid-template-columns: 1fr;
}

.connection-column {
	display: grid;
	align-content: start;
	gap: 0;
}

.checklist {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 10px;
	margin-top: 4px;
	color: var(--muted);
	font-size: 13px;
}

.dot {
	display: inline-block;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: #b6c0ca;
	margin-right: 6px;
}

.dot.ok {
	background: var(--ok);
}

.table-panel {
	margin-top: 16px;
}

/* The list keeps its full 408px on wide screens and gives up width (down to 280px) before the
   thread does, so laptop-size windows fit without sideways scrolling. Below 920px only one panel
   shows at a time (see the Chats block at the end of this file). */
.conversation-workspace {
	display: grid;
	grid-template-columns: clamp(280px, 40%, 408px) minmax(0, 1fr);
	gap: 16px;
	align-items: stretch;
	min-width: 0;
	overflow-x: auto;
	height: max(480px, calc(100vh - 158px));
}

.conversation-workspace.has-channel-panel {
	grid-template-columns: 200px clamp(280px, 30%, 408px) minmax(0, 1fr);
}

.conversation-channel-panel[hidden],
.conversation-channel-list button[hidden],
.conversation-status-filter button[hidden] {
	display: none;
}

.conversation-channel-panel,
.conversation-list-panel {
	background: var(--sidebar);
}

.conversation-channel-panel {
	display: flex;
	flex-direction: column;
	min-height: 0;
	padding-left: 18px;
	padding-right: 18px;
	overflow: hidden;
}

.conversation-channel-list {
	display: grid;
	align-content: start;
	gap: 6px;
	min-height: 0;
	overflow-y: auto;
}

.conversation-channel-list button {
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.conversation-list-panel,
.conversation-thread-panel {
	display: flex;
	flex-direction: column;
	min-height: 0;
	overflow: hidden;
}

.conversation-thread-panel {
	background: #ffffff;
}

.conversation-list-panel {
	justify-self: stretch;
	min-width: 0;
	padding-left: 18px;
	padding-right: 18px;
}

.conversation-list {
	display: grid;
	align-content: start;
	gap: 6px;
	width: 100%;
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overflow-x: hidden;
}

.conversation-channel-list,
.conversation-list {
	/* Keep the selected item's outer outline inside the scrollable area. */
	padding: 1px;
}

.conversation-list,
.message-thread {
	scrollbar-width: thin;
	scrollbar-color: transparent transparent;
}

.conversation-list:hover,
.message-thread:hover {
	scrollbar-color: rgba(15, 23, 42, 0.25) transparent;
}

.message-thread {
	scrollbar-color: rgba(15, 23, 42, 0.25) transparent;
}

.conversation-list::-webkit-scrollbar,
.message-thread::-webkit-scrollbar {
	width: 8px;
}

.conversation-list::-webkit-scrollbar-thumb,
.message-thread::-webkit-scrollbar-thumb {
	background: transparent;
	border-radius: 999px;
}

.conversation-list:hover::-webkit-scrollbar-thumb,
.message-thread:hover::-webkit-scrollbar-thumb {
	background: rgba(15, 23, 42, 0.25);
}

.message-thread::-webkit-scrollbar-thumb {
	background: rgba(15, 23, 42, 0.25);
}

.conversation-list-item {
	width: 100%;
	display: flex;
	align-items: flex-start;
	gap: 14px;
	border: 0;
	background: transparent;
	color: var(--text);
	padding: 10px 12px;
	border-radius: 6px;
}

.nav-list a.active,
.nav-list a:hover,
.nav-list button.active,
.nav-list button:hover,
.conversation-list-item.active,
.conversation-list-item:hover {
	background: var(--sidebar-active);
	color: var(--text);
	box-shadow: 0 0 0 1px var(--border);
}

.conversation-list-item.active .row-actions-toggle:hover,
.conversation-list-item.active .row-actions-toggle[aria-expanded="true"] {
	background: var(--field-disabled);
	color: var(--text);
}

.conversation-list-item-select {
	flex: 1 1 auto;
	min-width: 0;
	width: 100%;
	display: grid;
	gap: 8px;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	padding: 2px 6px 2px 8px;
	text-align: left;
	cursor: pointer;
}

.row-actions {
	position: relative;
	flex: 0 0 auto;
}

.row-actions-toggle {
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--muted);
	cursor: pointer;
	padding: 0;
}

.row-actions-toggle:hover,
.row-actions-toggle[aria-expanded="true"] {
	background: var(--field-disabled);
	color: var(--text);
}

html[data-theme="dark"] .row-actions-toggle:disabled {
	background: var(--field-disabled);
	color: #68727d;
	opacity: 1;
}

.row-actions-menu {
	position: absolute;
	top: 32px;
	right: 0;
	min-width: 150px;
	display: grid;
	gap: 2px;
	background: #ffffff;
	border: 1px solid var(--border);
	border-radius: 8px;
	box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
	padding: 6px;
	z-index: 10;
}

.row-actions-menu[hidden] {
	display: none;
}

.row-actions-item {
	position: relative;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--text);
	text-align: left;
	padding: 8px 10px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
}

.row-actions-item[data-tooltip]::after {
	content: attr(data-tooltip);
	position: absolute;
	left: calc(100% + 10px);
	top: 50%;
	transform: translateY(-50%);
	z-index: 30;
	display: none;
	width: min(280px, 55vw);
	padding: 10px 12px;
	border-radius: 6px;
	background: #17212b;
	color: #ffffff;
	box-shadow: var(--shadow);
	font-size: 12px;
	font-weight: 500;
	line-height: 1.45;
	white-space: normal;
	pointer-events: none;
}

.row-actions-item[data-tooltip]:hover::after,
.row-actions-item[data-tooltip]:focus-visible::after {
	display: block;
}

.row-actions-item:hover:not(:disabled) {
	background: var(--field-disabled);
}

.row-actions-item.danger {
	color: #9f3028;
}

.row-actions-item.danger:hover:not(:disabled) {
	background: #fdecea;
}

.conversation-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	min-width: 0;
}

.conversation-row span,
.conversation-row strong,
.conversation-preview {
	overflow-wrap: anywhere;
}

/* In a narrow list the name wraps, not the timestamp. */
.conversation-row time {
	flex: 0 0 auto;
	white-space: nowrap;
}

.conversation-row time,
.conversation-preview,
.thread-header span,
.thread-meta,
.message-bubble time {
	color: var(--muted);
	font-size: 12px;
}

.conversation-preview {
	display: -webkit-box;
	line-height: 1.35;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	margin-right: 2px;
}

.thread-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 14px;
	padding: 14px 14px 0;
	border-bottom: 1px solid var(--border);
}

.thread-header-copy {
	display: grid;
	gap: 8px;
	min-width: 0;
}

.thread-title-row {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	min-width: 0;
}

.thread-title-row h2 {
	margin: 0;
}

.thread-meta-inline {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	min-width: 0;
}

#threadPhoneNumber {
	display: inline-block;
	margin-bottom: 10px;
}

.thread-actions {
	display: flex;
	align-items: center;
	gap: 6px;
	flex: 0 0 auto;
	justify-content: flex-end;
}

.thread-actions .row-actions-toggle {
	width: 34px;
	height: 34px;
}

.thread-actions .row-actions-toggle .button-icon {
	width: 18px;
	height: 18px;
}

.thread-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	padding: 12px 14px 22px;
}

.thread-header-surface {
	border-radius: 8px;
	margin-bottom: 14px;
	flex: 0 0 auto;
}

.conversation-status.status-active {
	background: var(--ok);
	color: #ffffff;
}

.conversation-status.status-human {
	background: #ede9fe;
	color: #6d28d9;
}

.conversation-status.status-paused {
	background: #f3e8ff;
	color: #7e22ce;
}

.conversation-status.status-inactive {
	background: #f1f5f9;
	color: #64748b;
}

.conversation-status.status-cooldown {
	background: #fef3c7;
	color: #92400e;
}

.conversation-status.status-attention {
	background: #ffedd5;
	color: #9a3412;
}

.thread-assistant-notice {
	margin-bottom: 14px;
	padding: 10px 12px;
	border-radius: 8px;
	background: #f8fafc;
	color: var(--muted);
	border: 1px solid var(--border);
	font-size: 13px;
	flex: 0 0 auto;
}

html[data-theme="dark"] .thread-assistant-notice {
	background: #11161c;
	border-color: #26303a;
	color: #9aa6b2;
}

.message-thread {
	display: flex;
	flex-direction: column;
	gap: 8px;
	background: #ffffff;
	border-radius: 8px;
	padding: 4px;
	flex: 1 1 0;
	min-height: 0;
	height: 0;
	overflow-y: auto;
	overflow-x: hidden;
	overscroll-behavior: contain;
}

/*
 * Pins a short conversation to the bottom of the panel without using align-content/
 * justify-content "end" on the scroll container itself: Chrome doesn't register overflow that
 * happens on the start side of an end-aligned flex/grid container as scrollable, so `overflow-y:
 * auto` never produced a scrollbar and older messages were unreachable. margin-top: auto on the
 * first row achieves the same bottom-pinned look while keeping the container's own alignment at
 * the (working) default, so scrollHeight/scrollTop behave correctly once messages overflow.
 */
.message-thread .message-row:first-child {
	margin-top: auto;
}

.reply-composer {
	margin-bottom: 4px;
	flex: 0 0 auto;
}

.reply-composer-label {
	display: block;
	margin-bottom: 10px;
}

.reply-composer-input {
	position: relative;
}

.reply-composer textarea {
	min-height: 58px;
	max-height: 160px;
	padding-top: 16px;
	padding-bottom: 16px;
	padding-right: 72px;
	line-height: 1.4;
	overflow: hidden;
	resize: none;
	border-radius: 28px;
	scrollbar-width: none;
}

.reply-composer textarea::-webkit-scrollbar {
	display: none;
}

.reply-composer textarea:focus {
	border-color: var(--border);
	box-shadow: none;
}

.reply-send-button {
	position: absolute;
	right: 14px;
	top: 46%;
	transform: translateY(-50%);
	display: inline-grid;
	place-items: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: #097fe8;
	color: #ffffff;
	box-shadow: 0 8px 20px rgba(9, 127, 232, 0.28);
}

.reply-send-button:hover {
	background: #086fcb;
}

.reply-send-button .button-icon {
	width: 18px;
	height: 18px;
	stroke-width: 2.6;
}

.composer-note {
	color: #315f72;
	border-radius: 8px;
	font-size: 13px;
	line-height: 1.45;
	margin: 0 0 0px;
	padding: 10px 12px;
}

html[data-theme="dark"] .composer-note {
	color: #bfdcff;
	background: #102235;
	border-color: #1e3a5f;
}

html[data-theme="dark"] .reply-send-button {
	background: #097fe8;
	color: #ffffff;
}

html[data-theme="dark"] .reply-send-button:hover {
	background: #0a74d3;
}

.message-row {
	display: flex;
	width: 100%;
}

.message-row.patient {
	justify-content: flex-start;
}

.message-row.assistant {
	justify-content: flex-end;
}

.message-bubble {
	position: relative;
	max-width: min(74%, 560px);
	display: grid;
	gap: 4px;
	border: 0;
	border-radius: 20px;
	padding: 9px 13px;
	line-height: 1.32;
}

.message-reaction {
	position: absolute;
	bottom: -9px;
	font-size: 13px;
	line-height: 1;
	padding: 3px 5px;
	border-radius: 999px;
	background: var(--bg);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.message-bubble.patient .message-reaction {
	right: 8px;
}

.message-bubble.assistant .message-reaction {
	left: 8px;
}

.message-bubble p {
	margin: 0;
}

.message-media {
	display: block;
	width: 100%;
	max-width: 320px;
	border-radius: 12px;
	object-fit: cover;
}

.message-audio {
	display: block;
	width: 260px;
	max-width: 100%;
	height: 40px;
}

.message-reaction-control {
	position: absolute;
	top: 50%;
	left: 100%;
	padding-left: 8px;
	transform: translateY(-50%);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.12s ease;
	z-index: 20;
}

.message-row:hover .message-reaction-control,
.message-reaction-control:focus-within {
	opacity: 1;
	pointer-events: auto;
}

.message-reaction-toggle {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 999px;
	background: var(--bg);
	color: var(--muted);
	cursor: pointer;
	padding: 0;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.message-reaction-toggle .button-icon {
	width: 20px;
	height: 20px;
}

.message-reaction-toggle:hover {
	color: var(--text);
}

.message-reaction-menu {
	position: absolute;
	bottom: 100%;
	left: 50%;
	display: flex;
	gap: 2px;
	background: #ffffff;
	border: 1px solid var(--border);
	border-radius: 8px;
	box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
	padding: 4px;
	z-index: 10;
	opacity: 0;
	pointer-events: none;
	transform: translateX(-50%) translateY(4px);
	transition: opacity 0.12s ease, transform 0.12s ease;
}

.message-reaction-control.open .message-reaction-menu {
	opacity: 1;
	pointer-events: auto;
	transform: translateX(-50%) translateY(0);
}

.message-reaction-control.open-below .message-reaction-menu {
	bottom: auto;
	top: 100%;
	transform: translateX(-50%) translateY(-4px);
}

.message-reaction-control.open-below.open .message-reaction-menu {
	transform: translateX(-50%) translateY(0);
}

.message-reaction-option {
	border: 0;
	background: transparent;
	border-radius: 6px;
	font-size: 18px;
	line-height: 1;
	padding: 4px 6px;
	cursor: pointer;
}

.message-reaction-option:hover {
	background: var(--field-disabled);
}

.message-bubble.patient {
	background: #f1f5f9;
	color: #111827;
	border-bottom-left-radius: 6px;
}

.message-bubble.assistant {
	background: #d9fdd3;
	color: #111b21;
	border-bottom-right-radius: 6px;
}

.message-bubble.assistant time {
	color: rgba(17, 27, 33, 0.62);
}

/* Pale lavender and purple text matched to the supplied reference. */
.web-chat-thread .message-bubble.assistant,
html[data-theme="dark"] .web-chat-thread .message-bubble.assistant {
	background: rgb(191 188 248);
	color: #131a29;
}

.web-chat-thread .message-bubble.assistant time,
html[data-theme="dark"] .web-chat-thread .message-bubble.assistant time {
	color: #131a29;
}

/* Test chat AI replies use a different color than the WhatsApp green so this sandbox never
   looks like a real customer conversation at a glance. */
.test-chat-thread .message-bubble.assistant {
	background: #dbeafe;
	color: #0f2f5c;
}

.test-chat-thread .message-bubble.assistant time {
	color: rgba(15, 47, 92, 0.62);
}

.test-chat-panel {
	width: 100%;
	max-width: none;
	display: flex;
	flex-direction: column;
	height: max(480px, calc(100vh - 158px));
	min-height: 0;
	overflow: hidden;
}

.field-label {
	display: block;
	flex: 0 0 auto;
	color: var(--muted);
	font-size: 13px;
	font-weight: 600;
	margin-top: 10px;
	margin-bottom: 7px;
}

.test-chat-thread {
	flex: 1 1 0;
	height: 0;
	min-height: 0;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	justify-content: flex-start;
	align-content: normal;
	padding: 12px;
	overflow-y: auto;
	overflow-x: hidden;
	scrollbar-width: thin;
	scrollbar-color: rgba(15, 23, 42, 0.25) transparent;
	overscroll-behavior: contain;
}

.test-chat-thread::-webkit-scrollbar {
	width: 8px;
}

.test-chat-thread::-webkit-scrollbar-thumb {
	background: rgba(15, 23, 42, 0.25);
	border-radius: 999px;
}

.test-chat-panel > .panel-description,
.test-chat-panel > .field-label,
.test-chat-panel > label,
.test-chat-panel > .form-actions {
	flex: 0 0 auto;
}

.test-chat-input {
	resize: vertical;
}

.test-chat-thread .message-row.test-chat-message-with-hint {
	flex-direction: column;
	gap: 0;
}

.test-chat-thread .message-row.test-chat-message-with-hint.patient {
	align-items: flex-start;
}

.test-chat-thread .message-row.test-chat-message-with-hint.assistant {
	align-items: flex-end;
}

.test-chat-hint-stack {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 6px;
	max-width: min(100%, 240px);
	margin-right: 8px;
	position: relative;
	z-index: 5;
}

.test-chat-hint {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	max-width: 240px;
	background: var(--field-disabled);
	color: var(--muted);
	font-size: 11px;
	font-style: italic;
	line-height: 1.3;
	padding: 5px 10px;
	border-radius: 12px;
	border-top-right-radius: 4px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
	text-align: left;
}

.test-chat-hint-icon {
	width: 13px;
	height: 13px;
	flex: 0 0 auto;
}

.test-chat-actions {
	justify-content: space-between;
	align-items: center;
}

.test-chat-usage {
	flex: 1 1 auto;
	max-width: 350px;
	margin-top: 0;
}

.test-chat-action-buttons {
	display: flex;
	gap: 10px;
	flex: 0 0 auto;
}

table {
	width: 100%;
	border-collapse: collapse;
}

th,
td {
	text-align: left;
	border-top: 1px solid var(--border);
	padding: 12px 10px;
	vertical-align: middle;
}

th {
	color: var(--muted);
	font-size: 13px;
}

.privileges-table td:first-child {
	color: var(--text);
	font-weight: 700;
	white-space: nowrap;
}

.privileges-table td {
	color: var(--muted);
	font-size: 13px;
	line-height: 1.4;
}

@media (max-width: 920px) {
	.app-shell,
	.app-shell.sidebar-collapsed {
		height: auto;
		grid-template-columns: 1fr;
	}

	/* Top bar + slide-in drawer (built in dashboard.js wireMobileNavigation). */
	.mobile-topbar {
		position: sticky;
		top: 0;
		z-index: 19;
		display: flex;
		align-items: center;
		gap: 4px;
		min-height: 56px;
		padding: env(safe-area-inset-top, 0px) 8px 0;
		background: var(--panel);
		border-bottom: 1px solid var(--border);
	}

	.mobile-topbar-title {
		flex: 1 1 auto;
		min-width: 0;
		overflow: hidden;
		color: var(--text);
		font-size: 16px;
		font-weight: 600;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.mobile-topbar-button {
		display: grid;
		place-items: center;
		flex: 0 0 auto;
		width: 44px;
		height: 44px;
		border: 0;
		border-radius: 8px;
		background: transparent;
		color: var(--text);
		cursor: pointer;
	}

	.mobile-topbar-button:hover,
	.mobile-topbar-button[aria-expanded="true"] {
		background: var(--sidebar-active);
	}

	.mobile-topbar-button svg {
		width: 22px;
		height: 22px;
	}

	.mobile-account-menu {
		position: relative;
	}

	.mobile-account-dropdown {
		top: calc(100% + 6px);
		right: 0;
		bottom: auto;
		left: auto;
		min-width: 180px;
	}

	.sidebar {
		position: fixed;
		top: 0;
		bottom: 0;
		left: 0;
		z-index: 35;
		width: min(300px, 85vw);
		height: 100vh;
		height: 100dvh;
		padding-top: calc(16px + env(safe-area-inset-top, 0px));
		padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
		overflow-y: auto;
		overscroll-behavior: contain;
		box-shadow: 0 0 40px rgba(15, 23, 42, 0.25);
		transform: translateX(-100%);
		visibility: hidden;
		transition: transform 0.22s ease, visibility 0s linear 0.22s;
	}

	.app-shell.drawer-open .sidebar {
		transform: none;
		visibility: visible;
		transition: transform 0.22s ease;
	}

	.mobile-drawer-backdrop {
		position: fixed;
		inset: 0;
		z-index: 34;
		display: block;
		background: rgba(15, 23, 42, 0.45);
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.22s ease;
	}

	.app-shell.drawer-open .mobile-drawer-backdrop {
		opacity: 1;
		pointer-events: auto;
	}

	/* One column on phones: the bar just sits between the top bar and the page. */
	.app-shell.has-history-sync-bar {
		grid-template-rows: none;
	}

	.app-shell.has-history-sync-bar > .history-sync-bar,
	.app-shell.has-history-sync-bar > .main {
		grid-column: auto;
		grid-row: auto;
	}

	/* Test chat's intro paragraph takes too much room on phones. */
	.test-chat-description {
		display: none;
	}

	/* Phones show only the progress bar, with a short label inside it. */
	.history-sync-bar {
		padding: 8px 16px;
	}

	.history-sync-bar-text,
	.history-sync-bar-percent {
		display: none;
	}

	.history-sync-bar-track {
		position: relative;
		flex: 1 1 auto;
		height: 24px;
	}

	/* Lighter fill so the label stays readable over both the filled and empty parts. */
	.history-sync-bar-fill {
		background: color-mix(in srgb, var(--warning) 45%, var(--warning-bg));
	}

	.history-sync-bar-label {
		position: absolute;
		inset: 0;
		display: flex;
		align-items: center;
		justify-content: center;
		color: var(--text);
		font-size: 13px;
		white-space: nowrap;
	}

	.brand {
		margin-bottom: 20px;
	}

	.mobile-drawer-close {
		display: grid;
		margin-left: auto;
		color: var(--sidebar-muted);
	}

	.sidebar-collapse-toggle {
		display: none;
	}

	html.drawer-scroll-lock,
	html.drawer-scroll-lock body {
		overflow: hidden;
	}

	.metrics,
	.content-grid,
	.account-grid,
	.connection-grid,
	.checklist,
	.faq-item {
		grid-template-columns: 1fr;
	}

	.faq-actions {
		align-items: flex-start;
		justify-content: flex-start;
	}

	/* The actions button sits on the left here, so open its menu to the right
	   instead of off the left edge of the screen. */
	.faq-actions .row-actions-menu {
		right: auto;
		left: 0;
	}

	.user-row {
		grid-template-columns: minmax(0, 1fr);
		align-items: start;
	}

	.user-actions {
		justify-content: flex-start;
	}
}

@media (max-width: 640px) {
	.main {
		padding: 18px;
	}

	.topbar,
	.topbar-actions,
	.form-actions,
	.field-row,
	.schedule-row {
		align-items: stretch;
		flex-direction: column;
	}

	.schedule-row {
		grid-template-columns: 1fr;
	}

	table {
		display: block;
		overflow-x: auto;
		white-space: nowrap;
	}

	.thread-header {
		align-items: stretch;
		flex-direction: column;
	}

	.thread-actions {
		justify-content: flex-start;
	}

	.tab-list {
		justify-self: stretch;
		overflow-x: auto;
	}
}
.billing-actions {
	display: flex;
	align-items: end;
	flex-wrap: wrap;
	gap: 12px;
}

#billingPeriod {
	margin-bottom: 16px;
}

.billing-actions[hidden], .billing-actions [hidden] { display: none; }

.billing-actions label { flex: 1 1 180px; }

#buyPlanButton {
	margin-bottom: 16px;
}

.faq-import-modal {
	width: min(880px, calc(100vw - 32px));
	max-height: calc(100dvh - 48px);
	color: var(--text);
	overflow-y: auto;
}

.faq-import-modal::backdrop { background: rgba(15, 23, 42, 0.55); }
.faq-import-modal [hidden] { display: none !important; }
.faq-import-modal progress { width: 100%; height: 12px; accent-color: var(--menu-green); }
.faq-import-modal input[type="file"] { display: block; margin-top: 12px; max-width: 100%; }
.faq-import-drafts { display: grid; gap: 12px; }
.faq-import-draft {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 16px;
	padding: 16px;
	border: 1px solid var(--border);
	border-radius: 8px;
}
.faq-import-copy { min-width: 0; display: grid; gap: 10px; overflow-wrap: anywhere; }
.faq-import-copy p { margin: 0; white-space: pre-wrap; }
.faq-import-copy input, .faq-import-copy textarea { width: 100%; box-sizing: border-box; }
.faq-import-row-actions { display: flex; align-items: start; gap: 6px; }
.faq-import-row-actions svg { width: 17px; height: 17px; }
.faq-import-row-actions [aria-pressed="true"] {
	background: var(--ok);
	border-color: var(--ok);
	color: #fff;
}
.faq-import-row-actions [aria-pressed="true"]:hover { background: var(--ok); }
.faq-import-footer {
	position: sticky;
	bottom: -28px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 20px 0;
	margin-top: 16px;
	background: var(--panel);
	border-top: 1px solid var(--border);
}
.faq-import-footer button { flex-shrink: 0; }
.faq-import-error { color: var(--warning); background: var(--warning-bg); padding: 12px; border-radius: 6px; }
@media (max-width: 600px) {
	.faq-import-modal { padding: 16px; }
	.faq-import-draft { grid-template-columns: 1fr; }
	.faq-import-row-actions { justify-content: end; }
	.faq-import-footer { bottom: -16px; flex-direction: column; align-items: stretch; }
}

/* Chats on phones and small tablets: one panel at a time - the chat list, or the open chat with a
   back button (dashboard.js openMobileChatThread). Same 920px breakpoint as the mobile drawer. */
.thread-back-button {
	display: none;
}

@media (max-width: 920px) {
	.main:has(> .conversation-workspace) {
		padding: 0;
	}

	.main:has(> .conversation-workspace) > .topbar {
		display: none;
	}

	.conversation-workspace,
	.conversation-workspace.has-channel-panel {
		grid-template-columns: minmax(0, 1fr);
		gap: 0;
		overflow: hidden;
		height: calc(100vh - 57px);
		height: calc(100dvh - 57px - env(safe-area-inset-top, 0px));
	}

	/* An open chat takes the whole screen - its own header has the back button. */
	.app-shell:has(.conversation-workspace.thread-open) .mobile-topbar {
		display: none;
	}

	.conversation-workspace.thread-open {
		height: 100vh;
		height: 100dvh;
		padding-top: env(safe-area-inset-top, 0px);
	}

	.conversation-workspace:not(.thread-open) .conversation-thread-panel,
	.conversation-workspace.thread-open .conversation-list-panel,
	.conversation-channel-panel {
		display: none;
	}

	.conversation-list-panel,
	.conversation-thread-panel {
		border: 0;
		border-radius: 0;
	}

	.conversation-list-panel {
		justify-self: stretch;
		width: 100%;
		max-width: none;
		min-width: 0;
		padding: 12px;
	}

	.conversation-thread-panel {
		padding: 0 12px calc(8px + env(safe-area-inset-bottom, 0px));
	}

	.thread-header-surface {
		margin-bottom: 8px;
	}

	.thread-header {
		flex-direction: row;
		align-items: center;
		gap: 6px;
		padding: 8px 0 0;
	}

	.thread-back-button {
		display: grid;
		place-items: center;
		flex: 0 0 auto;
		align-self: flex-start;
		width: 44px;
		height: 44px;
		margin-left: -8px;
		border: 0;
		border-radius: 8px;
		background: transparent;
		color: var(--text);
		cursor: pointer;
	}

	.thread-back-button svg {
		width: 22px;
		height: 22px;
	}

	.thread-header-copy {
		flex: 1 1 auto;
		gap: 4px;
	}

	.thread-title-row h2 {
		overflow: hidden;
		font-size: 17px;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	#threadPhoneNumber {
		margin-bottom: 8px;
	}

	.thread-actions {
		align-self: flex-start;
		justify-content: flex-end;
	}

	/* 16px keeps iOS Safari from zooming in when the reply box is focused. */
	.reply-composer textarea {
		font-size: 16px;
	}
}

/* Touch screens (no hover): the reaction smiley can't be revealed by hovering, so tapping a
   customer's message opens the emoji strip (dashboard.js), anchored to the message's left edge so
   it stays on screen; and small controls grow to roughly finger size. Mouse users are unaffected. */
@media (hover: none) {
	.message-reaction-control,
	.message-row:hover .message-reaction-control,
	.message-reaction-control:focus-within {
		top: 0;
		bottom: 0;
		left: 0;
		width: 100%;
		padding: 0;
		transform: none;
		opacity: 1;
		pointer-events: none;
	}

	.message-reaction-toggle {
		display: none;
	}

	.message-reaction-menu,
	.message-reaction-control.open .message-reaction-menu {
		left: 0;
		margin-bottom: 6px;
		transform: none;
	}

	.message-reaction-control.open-below .message-reaction-menu,
	.message-reaction-control.open-below.open .message-reaction-menu {
		margin-top: 6px;
		margin-bottom: 0;
		transform: none;
	}

	.message-reaction-option {
		min-width: 40px;
		min-height: 40px;
		padding: 6px;
		font-size: 22px;
	}

	.row-actions-toggle,
	.thread-actions .row-actions-toggle,
	.icon-button {
		width: 40px;
		height: 40px;
	}

	.row-actions-menu {
		top: 42px;
	}

	.row-actions-item {
		padding: 12px 14px;
		font-size: 15px;
	}

	.filter-chip {
		min-height: 36px;
		padding: 4px 10px;
	}

	.nav-list a,
	.nav-list button,
	.sidebar-help-link,
	.sidebar-user-trigger,
	.sidebar-user-dropdown-item {
		min-height: 44px;
	}

	.nav-list .channel-nav-toggle {
		min-width: 44px;
	}

	.faq-action-button,
	.faq-import-button {
		min-height: 40px;
	}
}

/* Role labels inside the privileges table - only shown when it becomes cards on phones. */
.privileges-cell-label {
	display: none;
}

/* Phones and small tablets: page-level fixes outside Chats. */
@media (max-width: 920px) {
	/* iOS Safari zooms into any focused field whose text is under 16px. */
	input,
	select,
	textarea {
		font-size: 16px;
	}

	.toast-notification {
		left: 12px;
		right: 12px;
		bottom: calc(12px + env(safe-area-inset-bottom, 0px));
	}

	/* Test chat fills the screen under the top bar, like Chats. */
	.main:has(> .test-chat-panel) {
		padding: 0;
	}

	.main:has(> .test-chat-panel) > .topbar,
	.test-chat-panel > .field-label {
		display: none;
	}

	.test-chat-panel {
		height: calc(100vh - 57px);
		height: calc(100dvh - 57px - env(safe-area-inset-top, 0px));
		border: 0;
		border-radius: 0;
		padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
	}

	.test-chat-panel > .panel-description {
		margin-bottom: 8px;
		font-size: 13px;
	}

	.test-chat-input {
		resize: none;
	}

	.test-chat-actions {
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
	}

	.test-chat-usage {
		max-width: none;
	}

	.test-chat-action-buttons > button {
		flex: 1 1 0;
		justify-content: center;
	}

	/* Users: a compact card per user instead of a five-column row. */
	.user-row-heading {
		display: none;
	}

	.user-row {
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas:
			"name actions"
			"email email"
			"type login";
		align-items: center;
		gap: 6px 12px;
	}

	.user-row > .user-name-cell {
		grid-area: name;
	}

	.user-row > span:nth-of-type(1) {
		grid-area: email;
	}

	.user-row > span:nth-of-type(2) {
		grid-area: type;
		justify-self: start;
	}

	.user-row > span:nth-of-type(3) {
		grid-area: login;
		justify-self: end;
		text-align: right;
	}

	.user-row > .user-actions {
		grid-area: actions;
		justify-content: flex-end;
	}

	/* Privileges: one card per area, each role labelled. */
	.privileges-table,
	.privileges-table tbody,
	.privileges-table tr,
	.privileges-table td {
		display: block;
		white-space: normal;
	}

	.privileges-table {
		overflow: visible;
	}

	.privileges-table thead {
		display: none;
	}

	.privileges-table tr {
		padding: 12px 0;
		border-bottom: 1px solid var(--border);
	}

	.privileges-table td {
		padding: 3px 0;
		border: 0;
	}

	.privileges-table td:first-child {
		padding-bottom: 6px;
		white-space: normal;
	}

	.privileges-cell-label {
		display: inline;
		margin-right: 6px;
		color: var(--text);
		font-weight: 600;
	}

	.privileges-cell-label::after {
		content: ":";
	}
}

@media (max-width: 640px) {
	.panel {
		padding: 18px;
	}

	/* Keep start/end times side by side instead of stacking every field. */
	.schedule-row,
	.custom-schedule-row {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
		align-items: end;
	}

	.custom-schedule-row > label:first-child {
		grid-column: 1 / -1;
	}
}

@media (max-width: 640px) {
	/* Tabs scroll sideways when they don't fit; never vertically (that showed a stray scrollbar). */
	.tab-list {
		overflow-y: hidden;
	}
}

/* Tabs with a long name carry a short one too (e.g. "Approved Answers" / "Answers"); phones show
   the short one so the tab bar fits on one row. */
.tab-label-short {
	display: none;
}

@media (max-width: 920px) {
	/* One row of tabs that scrolls sideways if a translation runs long - never a second row. */
	.tab-list {
		flex-wrap: nowrap;
		overflow-x: auto;
		overflow-y: hidden;
		scrollbar-width: none;
	}

	.tab-list::-webkit-scrollbar {
		display: none;
	}
}

@media (max-width: 640px) {
	.tab-label-full {
		display: none;
	}

	.tab-label-short {
		display: inline;
	}

	.tab-button {
		padding-left: 14px;
		padding-right: 14px;
	}
}

/* Signup and onboarding top bars on phones: the progress steps are centered over the same row as
   the logo (and Logout) on wider screens, which collides on a phone - give them their own row. */
@media (max-width: 640px) {
	.onboarding-topbar {
		row-gap: 14px;
		padding: 16px 0 0;
	}

	.signup-flow-topbar {
		row-gap: 14px;
	}

	.onboarding-topbar-logo,
	.signup-flow-logo {
		width: 48px;
		height: 48px;
	}

	.onboarding-progress,
	.signup-flow-topbar .signup-progress {
		grid-row: 2;
		margin-top: 0;
	}
}
