/* Streamient Tabler shell */

:root {
	--st-font-body: "Noto Sans Variable", "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	--st-font-mono: "Noto Sans Mono Variable", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	--st-sidebar-width: 15rem;
	--st-topbar-height: 3.75rem;
	/* Streamient brand: periwinkle accent + ink borders (streamient.com design system) */
	--st-accent: #5763e6;
	--st-accent-bright: #6c7bff;
	--st-accent-deep: #4149c9;
	--st-ink: #15232d;
	--st-bg: #f7f6f2;
	--st-panel: #ffffff;
	--st-panel-subtle: #f8f9fa;
	--st-panel-muted: #eef1f3;
	--st-line: #dde3e8;
	--st-line-strong: #c6d0d8;
	--st-text: var(--st-ink);
	--st-muted: #5c6b77;
	--st-primary: var(--st-accent);
	--st-primary-rgb: 87, 99, 230;
	--st-primary-soft: #e9ecff;
	--st-danger-soft: #fff1f2;
	--st-warning-soft: #fff7e6;
	--st-result-notes-bg: #e9ecff;
	--st-result-notes-text: #2f3aa8;
	--st-result-notes-border: #c6cdff;
	--st-result-memory-bg: #e6f4ea;
	--st-result-memory-text: #1f663b;
	--st-result-memory-border: #b9dfc5;
	--st-result-urls-bg: #fff3cd;
	--st-result-urls-text: #725100;
	--st-result-urls-border: #ebd18c;
	--st-result-emails-bg: #e9eef2;
	--st-result-emails-text: #3f4d58;
	--st-result-emails-border: #c9d5dc;
	--st-result-pages-bg: #e1f3f8;
	--st-result-pages-text: #155e75;
	--st-result-pages-border: #b6dce6;
	--st-border-ink: var(--st-ink);
	--st-shadow-hard: 2px 2px 0 0 var(--st-border-ink);
	--st-shadow-hard-lg: 3px 3px 0 0 var(--st-border-ink);
	--bs-body-font-family: var(--st-font-body);
	--bs-body-bg: var(--st-bg);
	--bs-body-color: var(--st-text);
	--bs-border-color: var(--st-line);
	--bs-primary: var(--st-accent);
	--bs-primary-rgb: 87, 99, 230;
	--bs-link-color: var(--st-accent-deep);
	--bs-link-color-rgb: 138, 107, 0;
	--bs-link-hover-color: var(--st-ink);
	--bs-link-hover-color-rgb: 21, 35, 45;
	--bs-focus-ring-color: rgba(87, 99, 230, 0.25);
	--tblr-body-bg: var(--st-bg);
	--tblr-primary: var(--st-accent);
	--tblr-primary-rgb: 87, 99, 230;
	--tblr-link-color: var(--st-accent-deep);
	--tblr-link-color-rgb: 138, 107, 0;
	--tblr-link-hover-color: var(--st-ink);
	--tblr-link-hover-color-rgb: 21, 35, 45;
}

[data-bs-theme="dark"] {
	--st-bg: #0e161d;
	--st-panel: #15232d;
	--st-panel-subtle: #111c24;
	--st-panel-muted: #1b2a36;
	--st-line: #24343f;
	--st-line-strong: #2f4250;
	--st-text: #e6edf3;
	--st-muted: #93a6b3;
	--st-primary: var(--st-accent-bright);
	--st-primary-rgb: 108, 123, 255;
	--st-primary-soft: #232649;
	--st-danger-soft: #3a1820;
	--st-warning-soft: #392a12;
	--st-result-notes-bg: #30386f;
	--st-result-notes-text: #eef0ff;
	--st-result-notes-border: #5967bd;
	--st-result-memory-bg: #214b35;
	--st-result-memory-text: #c8f3d4;
	--st-result-memory-border: #497d5e;
	--st-result-urls-bg: #4a3819;
	--st-result-urls-text: #ffe0a3;
	--st-result-urls-border: #86682f;
	--st-result-emails-bg: #34434e;
	--st-result-emails-text: #e1eaf0;
	--st-result-emails-border: #607481;
	--st-result-pages-bg: #214753;
	--st-result-pages-text: #c6edf5;
	--st-result-pages-border: #477785;
	--st-border-ink: var(--st-line-strong);
	--st-shadow-hard: 2px 2px 0 0 rgba(0, 0, 0, 0.55);
	--st-shadow-hard-lg: 3px 3px 0 0 rgba(0, 0, 0, 0.55);
	--bs-body-bg: var(--st-bg);
	--bs-body-color: var(--st-text);
	--bs-border-color: var(--st-line);
	--bs-primary: var(--st-accent-bright);
	--bs-primary-rgb: 108, 123, 255;
	--bs-link-color: var(--st-accent-bright);
	--bs-link-color-rgb: 108, 123, 255;
	--bs-link-hover-color: #e6edf3;
	--bs-link-hover-color-rgb: 230, 237, 243;
	--bs-focus-ring-color: rgba(108, 123, 255, 0.3);
	--tblr-body-bg: var(--st-bg);
	--tblr-primary: var(--st-accent-bright);
	--tblr-primary-rgb: 108, 123, 255;
	--tblr-link-color: var(--st-accent-bright);
	--tblr-link-color-rgb: 108, 123, 255;
	--tblr-link-hover-color: #e6edf3;
	--tblr-link-hover-color-rgb: 230, 237, 243;
}

/* The app scrolls inside panels, so it does not need a viewport scrollbar gutter. */
html:has(> body.st-template1) {
	scrollbar-gutter: auto;
}

html,
body.st-template1 {
	height: 100%;
}

body.st-template1 {
	min-height: 100vh;
	overflow: hidden;
	background: var(--st-bg);
	color: var(--st-text);
}

body.st-template1 a {
	color: var(--st-primary);
}

body.st-template1 .st-icon.ti {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1em;
	height: 1em;
	line-height: 1;
	vertical-align: -0.145em;
}

body.st-template1 .st-navbar-logo,
.st-app-sidebar .navbar-brand img {
	max-height: 2rem;
	width: auto;
	object-fit: contain;
}

/* Same rendered size as the sidebar logo (13rem = sidebar width minus padding) */
.st-topbar-brand img {
	width: 13rem;
	height: auto;
	object-fit: contain;
}

body.st-template1 .st-white-label-navbar-logo {
	width: 175px;
	max-width: 175px;
	max-height: 2.75rem;
	height: auto;
	object-fit: contain;
}

.st-app-sidebar {
	width: var(--st-sidebar-width);
	background: var(--st-panel);
	border-right: 1px solid var(--st-line);
	box-shadow: none;
}

.navbar-vertical.st-app-sidebar .navbar-brand {
	min-height: var(--st-topbar-height);
	padding: 0.5rem 1rem;
	/* border-bottom: 1px solid var(--st-line); */
}

.st-app-sidebar .nav-link {
	border-radius: 6px;
	color: var(--st-muted);
	cursor: pointer;
}

.st-app-sidebar .nav-link.active,
.st-app-sidebar .nav-link:hover {
	background: var(--st-primary-soft);
	color: var(--st-primary);
}

body.st-template1 #main-content {
	height: 100vh;
	min-height: 0;
	overflow: hidden;
	background: var(--st-bg);
}

body.st-template1 #main-content {
	margin-left: var(--st-sidebar-width);
}

.st-topbar {
	min-height: var(--st-topbar-height);
	background: var(--st-panel);
	border-bottom: 1px solid var(--st-line);
	box-shadow: none;
}

.st-topbar .container-fluid {
	display: flex;
	align-items: center;
	flex-wrap: nowrap;
	gap: 1rem;
	min-height: var(--st-topbar-height);
}

.st-navbar-left {
	flex: 0 0 auto;
}

.st-topbar-brand {
	min-width: max-content;
}

.st-topnav {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	min-width: 0;
}

.st-navbtn {
	display: inline-flex;
	align-items: center;
	min-height: 2rem;
	padding: 0.35rem 0.65rem;
	border-radius: 6px;
	color: var(--st-muted);
	font-size: 0.875rem;
	font-weight: 650;
	text-decoration: none;
	cursor: pointer;
}

.st-navbtn.active,
.st-navbtn:hover {
	background: var(--st-primary-soft);
	color: var(--st-primary);
	text-decoration: none;
}

.st-navbtn.active {
	box-shadow: inset 3px 0 0 var(--st-primary);
}

.st-navbar-actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-shrink: 0;
	min-width: 0;
}

.st-navbar-actions > .btn-sm,
.st-navbar-actions > form .btn-sm,
.st-navbar-actions .dropdown > .btn-sm {
	min-height: 2.125rem;
	padding-top: 0.3rem;
	padding-bottom: 0.3rem;
}

.st-support-button {
	display: none;
}

body.st-template1:has([data-managani-widget-instance="default"] [data-tab="chat"]) .st-support-button {
	display: inline-flex;
}

.st-support-button:hover {
	background: var(--st-panel-muted);
	text-decoration: none;
}

.st-support-button .st-icon {
	font-size: 1.125rem;
}

.st-global-search {
	flex: 0 1 32rem;
	width: min(32rem, 100%);
	min-width: 16rem;
	max-width: 32rem;
	/* topbar flex gap (1rem) + this margin = 3rem gap after the nav pills */
	margin-left: 2rem;
	margin-right: auto;
}

.st-global-search-trigger {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	width: 100%;
	height: 2.5rem;
	padding: 0 0.85rem;
	border-color: var(--st-line);
	border-radius: 7px;
	background: var(--st-panel-subtle);
	color: var(--st-muted);
	font-weight: 600;
	text-align: left;
	box-shadow: none;
	cursor: pointer;
}

.st-global-search-trigger:hover,
.st-global-search-trigger:focus {
	border-color: var(--st-line-strong);
	background: var(--st-panel);
	color: var(--st-text);
}

.st-global-search-icon {
	font-size: 1.25rem;
	flex: 0 0 auto;
}

.st-global-search-text {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.st-global-search-spacer {
	flex: 1 1 auto;
	min-width: 0;
}

.st-global-search-trigger kbd,
.st-search-dialog kbd {
	border: 1px solid var(--st-line);
	background: var(--st-panel);
	color: var(--st-muted);
	box-shadow: none;
}

.st-page-body {
	height: calc(100vh - var(--st-topbar-height));
	margin: 0;
	overflow: hidden;
}

.st-page-container {
	height: 100%;
	min-height: 0;
	padding: 1rem;
}

.st-content-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 21rem;
	gap: 1rem;
	height: 100%;
	min-height: 0;
}

body.st-no-chat-sidebar .st-content-grid {
	grid-template-columns: minmax(0, 1fr);
}

.st-content-main {
	display: flex;
	flex-direction: column;
	min-width: 0;
	min-height: 0;
}

.st-content-main > #chat-results-panel {
	flex: 1 1 auto;
	min-height: 0;
	max-height: none;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

#chat-results-list {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding-right: 0.25rem;
}

#page-content {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 0;
	/* Vertical scroll only — .row negative gutter margins (e.g. project overview
	   stat cards) hang 0.5rem past this unpadded pane and would otherwise
	   produce a horizontal scrollbar. */
	overflow-x: hidden;
	overflow-y: auto;
}

.st-chat-rail {
	min-width: 0;
	min-height: 0;
	overflow: auto;
	padding: 1rem;
	border: 1px solid var(--st-line);
	border-radius: 8px;
	background: var(--st-panel);
}

.chat-sidebar {
	height: 100%;
	display: flex;
	flex-direction: column;
}

.chat-example-btn {
	width: 100%;
	padding: 0.5rem 0.65rem;
	border: 1px solid var(--st-line);
	border-radius: 6px;
	background: var(--st-panel-subtle);
	color: var(--st-text);
	text-align: left;
	cursor: pointer;
}

.chat-example-btn:hover {
	border-color: var(--st-line-strong);
	background: var(--st-panel-muted);
}

.st-search-backdrop {
	position: fixed;
	inset: 0;
	z-index: 1080;
	background: rgba(14, 22, 29, 0.42);
}

.st-search-palette {
	position: fixed;
	inset: 5rem auto auto 50%;
	z-index: 1090;
	width: min(44rem, calc(100vw - 2rem));
	transform: translateX(-50%);
}

.st-search-dialog {
	overflow: hidden;
	border: 1px solid var(--st-line);
	border-radius: 8px;
	background: var(--st-panel);
	box-shadow: 0 24px 70px rgba(14, 22, 29, 0.22);
}

.st-search-input-row,
.st-search-footer {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.75rem;
	border-bottom: 1px solid var(--st-line);
}

.st-search-input-row .form-control {
	flex: 1 1 auto;
	min-width: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
}

.st-search-footer {
	justify-content: space-between;
	border-top: 1px solid var(--st-line);
	border-bottom: 0;
	color: var(--st-muted);
	font-size: 0.75rem;
}

.st-search-help {
	padding: 0.5rem 0.75rem;
	color: var(--st-muted);
	font-size: 0.75rem;
}

.st-search-results {
	max-height: min(28rem, 55vh);
	overflow: auto;
}

.swal2-popup.swal2-st-popup {
	--swal2-outline: 0 0 0 0.25rem rgba(var(--st-primary-rgb), 0.3);
	--swal2-border: 2px solid var(--st-border-ink);
	--swal2-border-radius: var(--tblr-border-radius-lg, 0.5rem);
	--swal2-background: var(--st-panel);
	--swal2-color: var(--st-text);
	--swal2-input-border: 1px solid var(--st-line-strong);
	--swal2-input-background: var(--st-panel-muted);
	--swal2-input-focus-border: 1px solid var(--st-primary);
	--swal2-input-focus-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 0.25rem rgba(var(--st-primary-rgb), 0.3);
	--swal2-validation-message-background: var(--st-danger-soft);
	--swal2-validation-message-color: var(--st-text);
	--swal2-footer-border-color: var(--st-line);
	--swal2-confirm-button-background-color: var(--st-primary);
	--swal2-cancel-button-background-color: var(--tblr-secondary, #6b7280);
	--swal2-timer-progress-bar-background: rgba(var(--st-primary-rgb), 0.55);
	--swal2-toast-border: 1px solid var(--st-line-strong);
	--swal2-toast-box-shadow: var(--st-shadow-hard);
	box-shadow: var(--st-shadow-hard-lg);
}

.swal2-popup.swal2-st-popup .swal2-loader {
	border-color: var(--st-primary) transparent var(--st-primary) transparent;
}

.swal2-popup.swal2-st-popup.swal2-toast {
	box-shadow: var(--st-shadow-hard);
}

.swal2-icon.swal2-st-icon {
	border: 0;
	background: var(--st-primary-soft);
	color: var(--st-primary);
}

.swal2-icon.swal2-error.swal2-st-icon {
	background: var(--st-danger-soft);
	color: var(--tblr-danger, #d63939);
}

.swal2-icon.swal2-warning.swal2-st-icon {
	background: var(--st-warning-soft);
	color: var(--tblr-warning, #f59f00);
}

/* Auth */

.st-auth-page {
	background: var(--tblr-bg-surface, #ffffff);
	background-image: var(--st-auth-cover-image);
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
	min-height: 100vh;
	color: var(--st-text);
	overflow: auto;
}

.st-auth-page .st-auth-shell {
	min-height: 100vh;
	width: 100%;
}

.st-auth-page .st-auth-panel {
	background: rgba(255, 255, 255, 0.88);
	backdrop-filter: blur(0.375rem);
	justify-content: center !important;
	min-height: 100vh;
}

.st-auth-page .container-tight {
	margin-bottom: auto !important;
	margin-top: auto !important;
	max-width: 25rem;
}

.st-auth-page .st-auth-cover-column {
	background: var(--st-bg);
	min-height: 100vh;
}

.st-auth-page .st-auth-cover {
	background-color: #e3e5f2;
	background-image:
		var(--st-auth-cover-image),
		linear-gradient(135deg, #f8fafc 0%, #e3e5f2 52%, #e9ecff 100%);
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
	position: relative;
}

.st-auth-page .st-auth-cover::after {
	background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(21, 35, 45, 0.18));
	content: "";
	inset: 0;
	position: absolute;
}

[data-bs-theme="dark"] .st-auth-page,
[data-theme="dark"] .st-auth-page {
	background: var(--tblr-bg-surface, #15232d);
	background-image: var(--st-auth-cover-image);
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
}

[data-bs-theme="dark"] .st-auth-page .st-auth-panel,
[data-theme="dark"] .st-auth-page .st-auth-panel {
	background: rgba(21, 35, 45, 0.88);
}

[data-bs-theme="dark"] .st-auth-page .st-auth-cover,
[data-theme="dark"] .st-auth-page .st-auth-cover {
	background-color: #0e161d;
	background-image:
		var(--st-auth-cover-image),
		linear-gradient(135deg, #0e161d 0%, #15232d 55%, #3a2f14 100%);
}

[data-bs-theme="dark"] .st-auth-page .st-auth-cover::after,
[data-theme="dark"] .st-auth-page .st-auth-cover::after {
	background: linear-gradient(90deg, rgba(14, 22, 29, 0.2), rgba(0, 0, 0, 0.35));
}

.st-auth-page .navbar-brand {
	margin: 0;
}

.st-auth-page .logo-form img {
	max-width: 14rem;
	height: auto;
}

[data-bs-theme="dark"] .st-logo-light,
[data-theme="dark"] .st-logo-light,
[data-bs-theme="light"] .st-logo-dark,
[data-theme="light"] .st-logo-dark {
	display: none;
}

.st-auth-page .st-white-label-auth-logo {
	max-width: 12rem;
	max-height: 3rem;
	object-fit: contain;
}

.st-auth-page .form-control {
	font-size: 0.875rem;
}

.st-auth-page .st-auth-methods {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-bottom: 1.25rem;
}

.st-auth-page .st-auth-method-btn {
	align-items: center;
	display: inline-flex;
	flex: 0 0 auto;
	font-size: 0.875rem;
	font-weight: 600;
	justify-content: center;
	min-height: 2.25rem;
	min-width: 8rem;
	padding: 0.45rem 0.8rem;
}

.st-auth-page .st-auth-method-btn .st-icon {
	font-size: 1rem;
	vertical-align: -0.125rem;
}

/* OAuth consent — denser than the login form, so relax the column cap */
.st-auth-page .container-tight:has(.oauth-authorize-page) {
	max-width: 28rem;
}

.oauth-eyebrow {
	color: var(--st-primary);
	font-size: 0.6875rem;
	font-weight: 800;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.oauth-section > h2 {
	color: var(--st-muted);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.oauth-account-card {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.75rem;
	border: 1px solid var(--st-line);
	border-radius: 8px;
	background: var(--st-panel-subtle);
	box-shadow: var(--st-shadow-hard);
}

.oauth-account-avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 8px;
	background: var(--st-primary-soft);
	color: var(--st-primary);
	font-weight: 800;
}

.oauth-scope-list {
	border: 1px solid var(--st-line);
	border-radius: 8px;
	box-shadow: var(--st-shadow-hard);
	overflow: hidden;
}

.oauth-scope-list .list-group-item {
	background: var(--st-panel-subtle);
	border: 0;
	border-bottom: 1px solid var(--st-line);
	padding: 0.65rem 0.75rem 0.65rem 2.1rem;
	position: relative;
}

.oauth-scope-list .list-group-item:last-child {
	border-bottom: 0;
}

.oauth-scope-list .list-group-item::before {
	color: var(--st-primary);
	content: "✓";
	font-weight: 800;
	left: 0.8rem;
	position: absolute;
	top: 0.6rem;
}

.oauth-details {
	background: var(--st-panel-subtle);
	border: 1px solid var(--st-line);
	border-radius: 8px;
}

.oauth-details summary {
	color: var(--st-muted);
	cursor: pointer;
	font-weight: 600;
	padding: 0.65rem 0.75rem;
}

.oauth-details summary:hover {
	color: var(--st-primary);
}

.oauth-details[open] summary {
	border-bottom: 1px solid var(--st-line);
	color: var(--st-text);
}

.oauth-meta-list {
	display: grid;
	gap: 0.75rem;
	list-style: none;
	margin: 0;
	padding: 0.75rem;
}

.oauth-meta-list code {
	display: block;
	overflow-wrap: anywhere;
	white-space: normal;
}

/* ---- Streamient brand components ---- */

body.st-template1 .btn-primary,
body.st-auth-page .btn-primary {
	--bs-btn-bg: var(--st-accent-bright);
	--bs-btn-color: var(--st-ink);
	--bs-btn-border-color: var(--st-ink);
	--bs-btn-border-width: 2px;
	--bs-btn-hover-bg: #8d99ff;
	--bs-btn-hover-color: var(--st-ink);
	--bs-btn-hover-border-color: var(--st-ink);
	--bs-btn-active-bg: var(--st-accent-deep);
	--bs-btn-active-color: #ffffff;
	--bs-btn-active-border-color: var(--st-ink);
	--bs-btn-disabled-bg: var(--st-accent-bright);
	--bs-btn-disabled-color: var(--st-ink);
	--bs-btn-disabled-border-color: var(--st-ink);
	--tblr-btn-bg: var(--st-accent-bright);
	--tblr-btn-color: var(--st-ink);
	--tblr-btn-border-color: var(--st-ink);
	--tblr-btn-border-width: 2px;
	--tblr-btn-hover-bg: #8d99ff;
	--tblr-btn-hover-color: var(--st-ink);
	--tblr-btn-hover-border-color: var(--st-ink);
	--tblr-btn-active-bg: var(--st-accent-deep);
	--tblr-btn-active-color: #ffffff;
	--tblr-btn-active-border-color: var(--st-ink);
	--tblr-btn-disabled-bg: var(--st-accent-bright);
	--tblr-btn-disabled-color: var(--st-ink);
	--tblr-btn-disabled-border-color: var(--st-ink);
	border-radius: 6px;
	box-shadow: 2px 2px 0 0 var(--st-ink);
}

body.st-template1 .btn-primary:active,
body.st-auth-page .btn-primary:active {
	transform: translate(2px, 2px);
	box-shadow: none;
}

[data-bs-theme="dark"] body.st-template1 .btn-primary,
[data-bs-theme="dark"] body.st-auth-page .btn-primary,
[data-theme="dark"] body.st-template1 .btn-primary,
[data-theme="dark"] body.st-auth-page .btn-primary {
	--bs-btn-border-color: var(--st-border-ink);
	--tblr-btn-border-color: var(--st-border-ink);
	box-shadow: var(--st-shadow-hard);
}

/* Tabler's dist ships a late .btn-link rule with a pre-baked blue that
   bypasses --tblr-link-color — re-point it to the brand link tokens. */
.btn-link {
	color: var(--tblr-link-color, var(--st-primary));
}

.btn-link:hover {
	color: var(--tblr-link-hover-color, var(--st-text));
}

body.st-template1 .modal-content,
body.st-auth-page .modal-content {
	border: 2px solid var(--st-border-ink);
	box-shadow: var(--st-shadow-hard-lg);
}

.st-search-dialog {
	border: 2px solid var(--st-border-ink);
	box-shadow: var(--st-shadow-hard-lg);
}

/* Theme toggle in the user dropdown: show only the label for the theme you can
   switch TO ("Dark theme" while light, "Light theme" while dark). */
[data-bs-theme="light"] .st-theme-label-dark,
[data-theme="light"] .st-theme-label-dark,
[data-bs-theme="dark"] .st-theme-label-light,
[data-theme="dark"] .st-theme-label-light,
[data-bs-theme="light"] .st-theme-icon-dark,
[data-theme="light"] .st-theme-icon-dark,
[data-bs-theme="dark"] .st-theme-icon-light,
[data-theme="dark"] .st-theme-icon-light {
	display: none;
}

/* ---- Streamient sidebar: project list ---- */

.st-app-sidebar .st-sidebar-body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
	padding: 0.75rem 1rem 1rem;
}

.st-app-sidebar h6 {
	margin: 0;
	color: var(--st-text);
	font-size: 0.85rem;
}

#new-project-btn,
.st-app-sidebar .btn.btn-sm {
	padding: 0.25rem 0.55rem;
	border: 1px solid var(--st-line);
	border-radius: 6px;
	color: var(--st-muted);
	background: var(--st-panel);
}

#new-project-btn:hover,
.st-app-sidebar .btn.btn-sm:hover {
	background: var(--st-panel-muted);
	color: var(--st-text);
	border-color: var(--st-line-strong);
}

#project-list {
	flex: 0 1 auto;
	overflow-y: auto;
	min-height: 0;
	font-size: 0.82rem;
}

#project-list .st-project-card,
#project-list > div,
#project-list .list-group-item {
	border: 1px solid var(--st-line);
	border-radius: 8px;
	background: var(--st-panel-subtle);
	padding: 0.5rem;
	margin-bottom: 0.5rem;
	color: var(--st-text);
	font-size: 0.82rem;
}

#project-list .active,
#project-list .selected,
#project-list .list-group-item.active {
	box-shadow: 0 0 0 1px rgba(var(--st-primary-rgb), 0.35) inset;
	border-color: rgba(var(--st-primary-rgb), 0.45) !important;
}

#project-list .st-project-row,
#project-list a {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0.35rem 0.3rem;
	border-radius: 6px;
	color: var(--st-text);
	text-decoration: none;
}

#project-list .st-project-row:hover,
#project-list a:hover {
	background: var(--st-panel-muted);
}

#project-list .section-active {
	background: var(--st-panel-muted);
}

#project-list .project-item {
	padding: 0 0 0.5rem;
	overflow: hidden;
}

#project-list .project-item-section {
	padding-left: 0.75rem;
}

#project-list .project-settings-gear {
	margin-left: auto;
	padding: 2px;
	border: 0;
	background: transparent;
	color: var(--st-muted);
	line-height: 1;
	border-radius: 6px;
	opacity: 0.7;
}

#project-list .project-settings-gear:hover {
	color: var(--st-text);
	background: var(--st-panel-muted);
	opacity: 1;
}

#project-list .project-settings-gear .st-icon {
	font-size: 15px;
}

/* Global Trash link pinned to the bottom of the sidebar */
.st-app-sidebar .st-sidebar-trash {
	display: block;
	margin-top: auto;
	padding: 0.55rem 0.75rem;
	border-radius: 8px;
	border: 1px dashed var(--st-line-strong);
	color: var(--st-muted) !important;
	text-decoration: none;
}

.st-app-sidebar .st-sidebar-trash:hover {
	background: var(--st-panel-muted);
}

/* ---- Sticky list toolbars (notes/memories/urls/emails) ---- */

.st-list-toolbar {
	position: sticky;
	top: 0;
	z-index: 5;
	background: var(--st-bg);
	padding-top: 0.25rem;
	padding-bottom: 0.5rem;
	margin-bottom: 0.25rem;
}

/* ---- Chat rail internals ---- */

.chat-input-group {
	align-items: flex-end;
}

#chat-input {
	font-size: 0.82rem;
	padding: 7px 10px;
	line-height: 1.35;
	min-height: 36px;
	max-height: 140px;
	resize: none;
	overflow-y: hidden;
}

#chat-send {
	padding: 7px 10px;
	font-size: 0.82rem;
	align-self: flex-end;
	flex: 0 0 auto;
	width: 38px;
	height: 36px;
	cursor: pointer;
}

#chat-messages {
	padding: 10px 0;
}

#chat-welcome {
	display: flex;
	flex-direction: column;
	padding: 1rem 0.5rem;
}

.chat-welcome-greeting h5 {
	color: var(--st-text);
	font-weight: 700;
}

.chat-welcome-greeting p {
	color: var(--st-text);
	font-weight: 600;
	font-size: 0.95rem;
}

.chat-welcome-examples {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

/* ---- Modal preview readability (universal item modal) ---- */

#rm-note-preview,
#rm-memory-preview {
	background: var(--st-panel-subtle) !important;
	color: var(--st-text) !important;
}

#rm-note-preview a,
#rm-memory-preview a {
	color: var(--st-primary) !important;
}

/* ---- Tenant/account switcher ---- */

body.st-template1 .account-switch-link {
	border: 1px solid transparent;
	border-radius: 8px;
	padding: 0.5rem 0.65rem;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

body.st-template1 .account-switch-link:hover,
body.st-template1 .account-switch-link:focus,
body.st-template1 .account-switch-link:active {
	color: var(--st-text) !important;
	background: var(--st-panel-muted) !important;
	border-color: var(--st-line-strong) !important;
	box-shadow: none !important;
}

body.st-template1 .account-switch-link.is-current,
body.st-template1 .account-switch-link.is-current:hover,
body.st-template1 .account-switch-link.is-current:focus {
	color: var(--st-text) !important;
	background: var(--st-panel-muted) !important;
	border-color: var(--st-line-strong) !important;
	box-shadow: none !important;
	pointer-events: none;
}

body.st-template1 .st-account-role-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 2px 6px;
	border: 1px solid var(--st-line-strong);
	border-radius: 999px;
	background: var(--st-panel-subtle);
	color: var(--st-muted);
	font-size: 0.56rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1;
	text-transform: uppercase;
}

/* ---- Email body view controls ---- */

body.st-template1 .st-email-body-controls .btn.btn-outline-secondary.active {
	background: var(--st-muted) !important;
	border-color: var(--st-muted) !important;
	color: var(--st-panel) !important;
}

/* ---- Floating batch action bar ---- */

.batch-floating-bar {
	position: fixed;
	top: calc(var(--st-topbar-height) + 1.25rem);
	left: 50%;
	transform: translateX(-50%);
	z-index: 1050;
	animation: batchSlideIn 0.25s ease-out;
}

@keyframes batchSlideIn {
	from { opacity: 0; transform: translateX(-50%) translateY(-100%); }
	to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.batch-floating-inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: start;
	gap: 12px;
	padding: 10px 16px;
	border: 2px solid var(--st-border-ink);
	border-radius: 10px;
	background: var(--st-ink);
	color: #fff;
	font-size: 0.85rem;
	box-shadow: var(--st-shadow-hard-lg);
}

[data-bs-theme="dark"] .batch-floating-inner,
[data-theme="dark"] .batch-floating-inner {
	background: var(--st-accent-bright);
	color: var(--st-ink);
}

.batch-floating-inner > .d-flex.align-items-center.gap-3 {
	display: flex !important;
	flex-wrap: wrap;
	align-items: center !important;
	justify-content: center;
	column-gap: 16px;
	row-gap: 10px;
	min-width: 0;
}

.batch-floating-count {
	font-weight: 700;
	white-space: nowrap;
}

.batch-floating-bar .btn.btn-sm {
	background: rgba(255, 255, 255, 0.15) !important;
	border: 1px solid rgba(255, 255, 255, 0.25) !important;
	border-radius: 6px;
	color: #fff !important;
	font-size: 0.8rem;
	font-weight: 600;
	backdrop-filter: blur(4px);
}

.batch-floating-bar .btn.btn-sm:hover {
	background: rgba(255, 255, 255, 0.28) !important;
	border-color: rgba(255, 255, 255, 0.4) !important;
}

[data-bs-theme="dark"] .batch-floating-bar .btn.btn-sm,
[data-theme="dark"] .batch-floating-bar .btn.btn-sm {
	background: rgba(21, 35, 45, 0.15) !important;
	border-color: rgba(21, 35, 45, 0.35) !important;
	color: var(--st-ink) !important;
}

[data-bs-theme="dark"] .batch-floating-bar .btn.btn-sm:hover,
[data-theme="dark"] .batch-floating-bar .btn.btn-sm:hover {
	background: rgba(21, 35, 45, 0.3) !important;
}

.batch-floating-close {
	background: transparent !important;
	border: none !important;
	color: rgba(255, 255, 255, 0.7) !important;
	padding: 4px 6px !important;
}

.batch-floating-close:hover {
	color: #fff !important;
}

[data-bs-theme="dark"] .batch-floating-close,
[data-theme="dark"] .batch-floating-close {
	color: rgba(21, 35, 45, 0.7) !important;
}

[data-bs-theme="dark"] .batch-floating-close:hover,
[data-theme="dark"] .batch-floating-close:hover {
	color: var(--st-ink) !important;
}

body.st-template1 .batch-floating-inner .small,
.batch-floating-banner {
	flex: 0 0 100%;
	color: inherit !important;
	opacity: 0.88;
	text-align: center;
	white-space: normal;
}

.batch-floating-banner a {
	color: inherit !important;
	text-decoration: underline;
	font-weight: 600;
}

/* ---- FilePond theming ---- */

body.st-template1 .filepond--panel-root {
	background: var(--st-panel-subtle) !important;
	border: 1px solid var(--st-line) !important;
	border-radius: 8px !important;
}

body.st-template1 .filepond--drop-label,
body.st-template1 .filepond--drop-label label {
	color: var(--st-muted) !important;
}

body.st-template1 .filepond--file {
	color: var(--st-text) !important;
}

body.st-template1 .filepond--file-info {
	color: var(--st-muted) !important;
}

body.st-template1 .filepond--file-info .filepond--file-info-main {
	color: var(--st-text) !important;
}

body.st-template1 .filepond--file-info .filepond--file-info-sub {
	color: var(--st-muted) !important;
}

body.st-template1 .filepond--item-panel {
	background: var(--st-panel-muted) !important;
	border-radius: 6px !important;
}

body.st-template1 .filepond--drip {
	background: rgba(var(--st-primary-rgb), 0.08) !important;
}

/* ---- Responsive ---- */

@media (max-width: 991.98px) {
	body.st-template1 #main-content {
		margin-left: 0;
	}

	.st-app-sidebar {
		width: 100%;
	}

	.st-app-sidebar .navbar-brand {
		min-height: 3.25rem;
	}

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

	.st-chat-rail {
		display: none;
	}

	.st-global-search {
		display: none;
	}

	.st-topnav {
		display: none;
	}

	.st-auth-page {
		background-color: var(--tblr-bg-surface, #ffffff);
	}

	.st-auth-page .st-auth-panel {
		background: rgba(255, 255, 255, 0.94);
		min-height: 100vh;
	}

	[data-bs-theme="dark"] .st-auth-page .st-auth-panel,
	[data-theme="dark"] .st-auth-page .st-auth-panel {
		background: rgba(21, 35, 45, 0.94);
	}
}

@media (max-width: 767.98px) {
	.st-topbar .container-fluid {
		gap: 0.75rem;
		padding-right: 0.5rem;
		padding-left: 0.5rem;
	}

	.st-topbar-brand {
		display: none !important;
	}

	.st-navbar-actions .dropdown > .btn .avatar + span {
		display: none;
	}

	.st-navbar-actions .dropdown > .btn {
		padding-right: 0.5rem;
		padding-left: 0.5rem;
	}

	.st-navbar-actions {
		flex: 1 1 auto;
		justify-content: flex-end;
		gap: 0.35rem;
		margin-right: 0;
		max-width: calc(100vw - 4rem);
		min-width: 0;
	}
}
