/* BraidPress Admin Workspace Styles
 * Pure tonal monochrome surfaces inspired by Grok Bot (x.ai/bot).
 * Strictly zero box-shadows, zero borders, zero pills, zero AI clutter.
 */

body.braidpress-admin-screen #wpbody-content {
	padding-bottom: 0;
}

body.braidpress-admin-screen #wpfooter,
body.braidpress-admin-screen #screen-meta-links,
body.braidpress-admin-screen #screen-meta {
	display: none;
}

body.braidpress-admin-screen #wpcontent {
	padding-left: 0;
}

.brp-root {
	--brp-bg: #ffffff;
	--brp-sidebar: #f4f5f6;
	--brp-sidebar-hover: #eaeced;
	--brp-sidebar-active: #e2e5e8;
	--brp-surface: #f2f3f5;
	--brp-surface-2: #e9ebee;
	--brp-surface-elevated: #f5f6f7;
	--brp-input-bg: #ffffff;
	--brp-input-focus: #f7f8f9;
	--brp-surface-user: #161616;
	--brp-surface-user-fg: #ffffff;
	--brp-fg: #161616;
	--brp-fg-muted: #5c6166;
	--brp-fg-faint: #8c9196;
	--brp-primary: #161616;
	--brp-primary-hover: #2e2e2e;
	--brp-primary-fg: #ffffff;
	--brp-link: #0b6dd3;
	--brp-success: #0d8a52;
	--brp-success-bg: #e9f6ef;
	--brp-warning: #b36b00;
	--brp-danger: #c92a2a;
	--brp-danger-bg: #fcedee;
	--brp-overlay: rgba(10, 10, 12, 0.42);
	--brp-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	--brp-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

	position: relative;
	display: flex;
	width: 100%;
	height: calc(100vh - 32px);
	min-height: 620px;
	background: var(--brp-bg);
	color: var(--brp-fg);
	font-family: var(--brp-font);
	font-size: 13.5px;
	line-height: 1.5;
	box-sizing: border-box;
	overflow: hidden;
	-webkit-font-smoothing: antialiased;
}

.brp-root[data-theme="dark"] {
	--brp-bg: #0a0a0a;
	--brp-sidebar: #111112;
	--brp-sidebar-hover: #1b1b1d;
	--brp-sidebar-active: #232326;
	--brp-surface: #18181a;
	--brp-surface-2: #222225;
	--brp-surface-elevated: #151517;
	--brp-input-bg: #202023;
	--brp-input-focus: #27272b;
	--brp-surface-user: #f5f5f5;
	--brp-surface-user-fg: #0a0a0a;
	--brp-fg: #f5f5f5;
	--brp-fg-muted: #a1a1a6;
	--brp-fg-faint: #6e6e73;
	--brp-primary: #f5f5f5;
	--brp-primary-hover: #dcdcdc;
	--brp-primary-fg: #0a0a0a;
	--brp-link: #4d9bff;
	--brp-success: #1db974;
	--brp-success-bg: #11261c;
	--brp-warning: #e59624;
	--brp-danger: #ff6463;
	--brp-danger-bg: #2a1416;
	--brp-overlay: rgba(0, 0, 0, 0.72);
}

.brp-root *,
.brp-root *::before,
.brp-root *::after {
	box-sizing: border-box;
	box-shadow: none !important;
}

.brp-boot-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: var(--brp-fg-muted);
	font-size: 14px;
}

/* Sidebar */
.brp-sidebar {
	width: 288px;
	min-width: 288px;
	height: 100%;
	display: flex;
	flex-direction: column;
	background: var(--brp-sidebar);
	border: 0;
}

.brp-sidebar-header {
	height: 54px;
	padding: 0 14px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
}

.brp-brand {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: -0.01em;
	color: var(--brp-fg);
}

.brp-brand-logo {
	width: 22px;
	height: 22px;
	border-radius: 5px;
	display: block;
	object-fit: cover;
}

.brp-sidebar-actions {
	position: relative;
	display: flex;
	align-items: center;
	gap: 4px;
}

.brp-icon-btn {
	width: 30px;
	height: 30px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--brp-fg-muted);
	cursor: pointer;
	padding: 0;
	transition: background 120ms ease, color 120ms ease;
}

.brp-icon-btn:hover,
.brp-icon-btn.is-active {
	background: var(--brp-sidebar-hover);
	color: var(--brp-fg);
}

.brp-dropdown-menu {
	position: absolute;
	top: 36px;
	right: 0;
	min-width: 168px;
	background: var(--brp-surface-2);
	border: 0;
	border-radius: 8px;
	padding: 5px;
	z-index: 40;
}

.brp-dropdown-item {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 10px;
	border: 0;
	border-radius: 5px;
	background: transparent;
	color: var(--brp-fg);
	font-size: 13px;
	text-align: left;
	cursor: pointer;
}

.brp-dropdown-item:hover {
	background: var(--brp-sidebar-hover);
}

.brp-search-wrap {
	padding: 4px 12px 6px;
}

.brp-search-input {
	width: 100%;
	height: 34px;
	padding: 0 11px;
	border: 0;
	border-radius: 6px;
	background: var(--brp-input-bg);
	color: var(--brp-fg);
	font-size: 12.5px;
}

.brp-search-input:focus {
	outline: none;
	background: var(--brp-input-focus);
}

.brp-sidebar-scroll {
	flex: 1;
	overflow-y: auto;
	padding: 6px 10px 12px;
}

/* Pinned bots 3-column grid (Grok Bot signature layout) */
.brp-pinned-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 6px;
	margin-bottom: 12px;
}

.brp-pinned-tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 10px 4px 8px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: var(--brp-fg);
	cursor: pointer;
	text-align: center;
	transition: background 120ms ease;
}

.brp-pinned-tile:hover {
	background: var(--brp-sidebar-hover);
}

.brp-pinned-tile.is-active {
	background: var(--brp-sidebar-active);
}

.brp-pinned-name {
	font-size: 11.5px;
	font-weight: 500;
	color: var(--brp-fg);
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Thread rows */
.brp-thread-list {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.brp-thread-row {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 10px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--brp-fg);
	text-align: left;
	cursor: pointer;
	transition: background 120ms ease;
}

.brp-thread-row:hover {
	background: var(--brp-sidebar-hover);
}

.brp-thread-row.is-active {
	background: var(--brp-sidebar-active);
}

.brp-thread-meta {
	min-width: 0;
	flex: 1;
}

.brp-thread-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
}

.brp-thread-title {
	font-size: 13px;
	font-weight: 500;
	color: var(--brp-fg);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.brp-thread-time {
	font-size: 11px;
	color: var(--brp-fg-faint);
	flex-shrink: 0;
}

.brp-thread-preview {
	font-size: 12px;
	color: var(--brp-fg-muted);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	margin-top: 1px;
}

/* Bot & Group Avatars */
.brp-avatar-wrap {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.brp-group-avatar {
	position: relative;
	width: 34px;
	height: 34px;
	flex-shrink: 0;
}

.brp-group-avatar .brp-group-av-1 {
	position: absolute;
	top: 0;
	left: 0;
}

.brp-group-avatar .brp-group-av-2 {
	position: absolute;
	bottom: 0;
	right: 0;
	border-radius: 50%;
}

.brp-working-dot {
	position: absolute;
	right: 0;
	bottom: 0;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--brp-success);
}

/* Sidebar Navigation Footer */
.brp-sidebar-nav {
	padding: 10px 10px 6px;
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex-shrink: 0;
}

.brp-nav-btn {
	width: 100%;
	height: 32px;
	padding: 0 10px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--brp-fg-muted);
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: background 120ms ease, color 120ms ease;
}

.brp-nav-btn:hover {
	background: var(--brp-sidebar-hover);
	color: var(--brp-fg);
}

.brp-nav-btn.is-active {
	background: var(--brp-sidebar-active);
	color: var(--brp-fg);
}

.brp-nav-left {
	display: flex;
	align-items: center;
	gap: 8px;
}

.brp-nav-count {
	font-size: 12px;
	font-family: var(--brp-mono);
	color: var(--brp-fg-muted);
}

.brp-nav-count.is-alert {
	color: var(--brp-link);
	font-weight: 600;
}

.brp-sidebar-user {
	height: 48px;
	padding: 0 14px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
}

.brp-user-info {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.brp-user-initials {
	width: 26px;
	height: 26px;
	border-radius: 6px;
	background: var(--brp-sidebar-active);
	color: var(--brp-fg);
	font-size: 11px;
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.brp-user-name {
	font-size: 12.5px;
	font-weight: 500;
	color: var(--brp-fg);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Main Workspace Area */
.brp-main {
	flex: 1;
	min-width: 0;
	height: 100%;
	display: flex;
	flex-direction: column;
	background: var(--brp-bg);
}

.brp-main-header {
	height: 54px;
	padding: 0 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-shrink: 0;
}

.brp-header-identity {
	display: flex;
	align-items: center;
	gap: 10px;
	border: 0;
	background: transparent;
	padding: 4px 8px;
	margin-left: -8px;
	border-radius: 6px;
	color: var(--brp-fg);
	cursor: pointer;
}

.brp-header-identity:hover {
	background: var(--brp-surface);
}

.brp-header-title {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: -0.01em;
	color: var(--brp-fg);
	white-space: nowrap;
}

.brp-header-meta {
	font-size: 12.5px;
	color: var(--brp-fg-muted);
	white-space: nowrap;
}

.brp-header-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

/* Buttons (pure tonal surfaces, 6px corners, zero borders, zero pills) */
.brp-btn {
	height: 32px;
	padding: 0 13px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	white-space: nowrap;
	border: 0;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	font-family: var(--brp-font);
	cursor: pointer;
	background: var(--brp-surface);
	color: var(--brp-fg);
	text-decoration: none;
	transition: background 120ms ease, color 120ms ease;
}

.brp-btn:hover {
	background: var(--brp-surface-2);
}

.brp-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.brp-btn-primary {
	background: var(--brp-primary);
	color: var(--brp-primary-fg);
}

.brp-btn-primary:hover {
	background: var(--brp-primary-hover);
}

.brp-btn-ghost {
	background: transparent;
	color: var(--brp-fg-muted);
}

.brp-btn-ghost:hover {
	background: var(--brp-surface);
	color: var(--brp-fg);
}

.brp-btn-danger {
	background: var(--brp-danger-bg);
	color: var(--brp-danger);
}

.brp-btn-danger:hover {
	background: var(--brp-danger);
	color: #ffffff;
}

.brp-btn-sm {
	height: 29px;
	padding: 0 11px;
	font-size: 12.5px;
}

/* Thread Body */
.brp-chat-layout {
	flex: 1;
	min-height: 0;
	display: flex;
	overflow: hidden;
}

.brp-chat-column {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	height: 100%;
}

.brp-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px 28px 18px;
}

.brp-messages-inner {
	max-width: 740px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.brp-time-divider {
	text-align: center;
	font-size: 11.5px;
	color: var(--brp-fg-faint);
	margin: 8px 0 2px;
}

.brp-system-msg {
	text-align: center;
	font-size: 12.5px;
	color: var(--brp-fg-muted);
	padding: 10px 16px;
	border: 0;
	border-radius: 8px;
	background: var(--brp-surface);
}

.brp-msg-row {
	display: flex;
	flex-direction: column;
	gap: 7px;
}

.brp-msg-row.is-user {
	align-items: flex-end;
}

.brp-msg-row.is-bot {
	align-items: flex-start;
}

.brp-msg-sender {
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 12px;
	font-weight: 500;
	color: var(--brp-fg-muted);
}

.brp-msg-handle {
	font-family: var(--brp-mono);
	font-size: 11px;
	color: var(--brp-fg-faint);
}

.brp-bubble {
	max-width: 84%;
	padding: 11px 15px;
	border: 0;
	border-radius: 10px;
	font-size: 13.5px;
	line-height: 1.54;
	word-break: break-word;
}

.brp-bubble-bot {
	background: var(--brp-surface);
	color: var(--brp-fg);
}

.brp-bubble-user {
	background: var(--brp-surface-user);
	color: var(--brp-surface-user-fg);
}

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

.brp-bubble p:last-child,
.brp-bubble ul:last-child,
.brp-bubble ol:last-child,
.brp-bubble pre:last-child,
.brp-bubble blockquote:last-child,
.brp-bubble table:last-child {
	margin-bottom: 0;
}

.brp-bubble h1,
.brp-bubble h2,
.brp-bubble h3,
.brp-bubble h4 {
	margin: 12px 0 6px;
	font-weight: 600;
	line-height: 1.35;
	color: inherit;
}

.brp-bubble h1:first-child,
.brp-bubble h2:first-child,
.brp-bubble h3:first-child,
.brp-bubble h4:first-child {
	margin-top: 0;
}

.brp-bubble h1 { font-size: 16px; }
.brp-bubble h2 { font-size: 14.5px; }
.brp-bubble h3,
.brp-bubble h4 { font-size: 13.5px; }

.brp-bubble ul {
	margin: 6px 0 10px;
	padding-left: 20px;
	list-style-type: disc !important;
	list-style-position: outside;
}

.brp-bubble ol {
	margin: 6px 0 10px;
	padding-left: 22px;
	list-style-type: decimal !important;
	list-style-position: outside;
}

.brp-bubble li {
	display: list-item !important;
	margin-bottom: 4px;
	line-height: 1.5;
}

.brp-bubble li::marker {
	color: var(--brp-fg-muted);
}

.brp-bubble-user li::marker {
	color: inherit;
}

.brp-bubble blockquote {
	margin: 8px 0;
	padding: 6px 12px;
	border-radius: 6px;
	background: var(--brp-surface-2);
	color: var(--brp-fg-muted);
}

.brp-bubble hr {
	border: 0;
	height: 1px;
	background: var(--brp-surface-2);
	margin: 10px 0;
}

.brp-bubble pre {
	margin: 8px 0 10px;
	padding: 11px 13px;
	border: 0;
	border-radius: 6px;
	background: var(--brp-bg);
	overflow-x: auto;
	font-family: var(--brp-mono);
	font-size: 12px;
	line-height: 1.48;
	color: var(--brp-fg);
}

.brp-bubble pre code {
	padding: 0;
	background: transparent;
	border-radius: 0;
	font-size: inherit;
}

.brp-bubble code {
	font-family: var(--brp-mono);
	font-size: 12px;
	padding: 2px 5px;
	border-radius: 4px;
	background: rgba(127, 127, 127, 0.16);
}

.brp-bubble a {
	color: var(--brp-link);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.brp-bubble-user a {
	color: inherit;
}

.brp-bubble table {
	width: 100%;
	border-collapse: collapse;
	margin: 8px 0 10px;
	font-size: 12.5px;
	border-radius: 6px;
	overflow: hidden;
}

.brp-bubble th,
.brp-bubble td {
	padding: 7px 10px;
	border: 0;
	text-align: left;
}

.brp-bubble th {
	font-weight: 600;
	background: var(--brp-surface-2);
}

.brp-bubble tbody tr:nth-child(even) td {
	background: rgba(127, 127, 127, 0.06);
}

.brp-mention {
	color: var(--brp-link);
	font-weight: 500;
}

.brp-bubble-user .brp-mention {
	color: inherit;
	text-decoration: underline;
}

/* Inline completed actions summary inside bot turns */
.brp-trace-block {
	max-width: 84%;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.brp-trace-line {
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 12.5px;
	color: var(--brp-fg-muted);
}

.brp-check-mark {
	color: var(--brp-success);
	font-weight: 700;
}

.brp-pending-mark {
	color: var(--brp-warning);
	font-weight: 700;
}

.brp-trace-toggle {
	align-self: flex-start;
	padding: 2px 0;
	border: 0;
	background: transparent;
	color: var(--brp-fg-faint);
	font-size: 12px;
	cursor: pointer;
}

.brp-trace-toggle:hover {
	color: var(--brp-fg);
}

.brp-trace-detail {
	margin-top: 6px;
	padding: 12px 14px;
	border: 0;
	border-radius: 8px;
	background: var(--brp-surface);
	font-family: var(--brp-mono);
	font-size: 11.5px;
	color: var(--brp-fg-muted);
	white-space: pre-wrap;
	overflow-x: auto;
}

/* Inline Human Approval Card (borderless tonal surface, Grok Bot style) */
.brp-approval-card {
	width: 100%;
	max-width: 560px;
	padding: 16px 18px;
	border: 0;
	border-radius: 10px;
	background: var(--brp-surface);
}

.brp-view-container .brp-approval-card {
	max-width: 100%;
}

.brp-approval-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 8px;
}

.brp-approval-title {
	font-size: 13.5px;
	font-weight: 600;
	color: var(--brp-fg);
	line-height: 1.4;
}

.brp-status-inline {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: var(--brp-fg-muted);
	white-space: nowrap;
	flex-shrink: 0;
}

.brp-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	display: inline-block;
	flex-shrink: 0;
}

.brp-dot-pending { background: var(--brp-warning); }
.brp-dot-ok, .brp-dot-executed, .brp-dot-replied, .brp-dot-completed { background: var(--brp-success); }
.brp-dot-rejected, .brp-dot-failed, .brp-dot-error, .brp-dot-denied { background: var(--brp-danger); }
.brp-dot-new, .brp-dot-drafted { background: var(--brp-link); }
.brp-dot-idle { background: var(--brp-fg-faint); }

.brp-approval-summary {
	font-size: 12.5px;
	color: var(--brp-fg-muted);
	white-space: pre-line;
	margin: 0 0 13px;
	line-height: 1.5;
}

.brp-approval-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.brp-approval-card .brp-btn:not(.brp-btn-primary):not(.brp-btn-ghost) {
	background: var(--brp-surface-2);
}

/* Working indicator */
.brp-working-row {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--brp-fg-muted);
	font-size: 12.5px;
	padding: 4px 0;
}

.brp-pulse-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--brp-success);
	animation: brpPulse 1.2s ease-in-out infinite;
}

@keyframes brpPulse {
	0%, 100% { opacity: 0.35; }
	50% { opacity: 1; }
}

/* Composer */
.brp-composer-wrap {
	padding: 10px 28px 18px;
	flex-shrink: 0;
}

.brp-composer-inner {
	position: relative;
	max-width: 740px;
	margin: 0 auto;
}

.brp-attached-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 8px;
}

.brp-attached-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 10px;
	border: 0;
	border-radius: 6px;
	background: var(--brp-surface);
	font-size: 12px;
	color: var(--brp-fg-muted);
	white-space: nowrap;
}

.brp-attached-remove {
	border: 0;
	background: transparent;
	color: var(--brp-fg-muted);
	cursor: pointer;
	padding: 0 2px;
	font-size: 13px;
}

.brp-composer-box {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 9px 11px;
	border: 0;
	border-radius: 10px;
	background: var(--brp-surface);
	transition: background 120ms ease;
}

.brp-composer-box:focus-within {
	background: var(--brp-surface-2);
}

.brp-composer-input {
	flex: 1;
	border: 0 !important;
	background: transparent !important;
	color: var(--brp-fg);
	font-family: var(--brp-font);
	font-size: 13.5px;
	line-height: 1.45;
	resize: none;
	min-height: 24px;
	max-height: 140px;
	padding: 4px 2px;
	outline: none !important;
}

.brp-composer-popover {
	position: absolute;
	bottom: 56px;
	left: 0;
	width: 340px;
	max-height: 240px;
	overflow-y: auto;
	background: var(--brp-surface-2);
	border: 0;
	border-radius: 8px;
	padding: 6px;
	z-index: 30;
}

.brp-popover-item {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 8px 10px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--brp-fg);
	font-size: 12.5px;
	text-align: left;
	cursor: pointer;
}

.brp-popover-item:hover {
	background: var(--brp-sidebar-hover);
}

.brp-popover-kind {
	font-family: var(--brp-mono);
	font-size: 11px;
	color: var(--brp-fg-faint);
	white-space: nowrap;
}

/* Right Inspector Drawer */
.brp-inspector {
	width: 344px;
	min-width: 344px;
	height: 100%;
	border: 0;
	background: var(--brp-sidebar);
	overflow-y: auto;
	padding: 20px 18px;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.brp-inspector-block {
	display: flex;
	flex-direction: column;
	gap: 9px;
}

.brp-kv-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	font-size: 12.5px;
}

.brp-kv-label {
	color: var(--brp-fg-muted);
	white-space: nowrap;
	flex-shrink: 0;
}

.brp-kv-val {
	color: var(--brp-fg);
	font-weight: 500;
	text-align: right;
	min-width: 0;
	overflow-wrap: anywhere;
}

.brp-tool-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.brp-tool-tag {
	padding: 4px 8px;
	border: 0;
	border-radius: 5px;
	background: var(--brp-surface-2);
	font-family: var(--brp-mono);
	font-size: 11px;
	color: var(--brp-fg-muted);
}

.brp-memory-item {
	padding: 10px 12px;
	border: 0;
	border-radius: 8px;
	background: var(--brp-bg);
	font-size: 12.5px;
}

.brp-memory-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 4px;
}

.brp-memory-key {
	font-family: var(--brp-mono);
	font-size: 11.5px;
	font-weight: 600;
	color: var(--brp-fg);
}

/* Utility Views (Forms, Routines, Approvals, Activity, Settings) */
.brp-view-body {
	flex: 1;
	overflow-y: auto;
	padding: 14px 26px 36px;
}

.brp-view-container {
	max-width: 1120px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.brp-tabs {
	display: flex;
	align-items: center;
	gap: 6px;
}

.brp-tab-btn {
	height: 32px;
	padding: 0 12px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--brp-fg-muted);
	font-size: 13px;
	font-weight: 500;
	white-space: nowrap;
	cursor: pointer;
	transition: background 120ms ease, color 120ms ease;
}

.brp-tab-btn:hover {
	background: var(--brp-surface);
	color: var(--brp-fg);
}

.brp-tab-btn.is-active {
	background: var(--brp-surface);
	color: var(--brp-fg);
}

.brp-panel {
	border: 0;
	border-radius: 10px;
	background: var(--brp-surface);
	overflow-x: auto;
}

.brp-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.brp-table th,
.brp-table td {
	padding: 13px 16px;
	text-align: left;
	border: 0;
	vertical-align: top;
}

.brp-table th {
	font-size: 12px;
	font-weight: 600;
	color: var(--brp-fg-muted);
	background: var(--brp-surface-2);
	white-space: nowrap;
}

.brp-table tbody tr:nth-child(even) td {
	background: rgba(127, 127, 127, 0.045);
}

.brp-table .brp-btn:not(.brp-btn-primary):not(.brp-btn-ghost) {
	background: var(--brp-surface-2);
}

.brp-table .brp-btn:not(.brp-btn-primary):not(.brp-btn-ghost):hover {
	background: var(--brp-sidebar-active);
}

.brp-nowrap {
	white-space: nowrap;
}

.brp-cell-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: nowrap;
	white-space: nowrap;
}

.brp-mono {
	font-family: var(--brp-mono);
	font-size: 12px;
}

.brp-muted {
	color: var(--brp-fg-muted);
}

.brp-empty {
	padding: 36px 20px;
	text-align: center;
	color: var(--brp-fg-muted);
	font-size: 13px;
}

/* Forms & Settings Fields */
.brp-form-grid {
	padding: 20px 22px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.brp-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.brp-field-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}

.brp-field-row-wide {
	display: grid;
	grid-template-columns: 1.55fr 1fr;
	gap: 14px;
}

.brp-label {
	font-size: 12.5px;
	font-weight: 500;
	color: var(--brp-fg);
}

.brp-input,
.brp-select,
.brp-textarea {
	width: 100%;
	padding: 8px 11px;
	border: 0 !important;
	border-radius: 6px;
	background: var(--brp-input-bg) !important;
	color: var(--brp-fg) !important;
	font-family: var(--brp-font);
	font-size: 13px;
	line-height: 1.45;
}

.brp-select {
	height: 36px;
	max-width: none !important;
	width: 100% !important;
}

.brp-input {
	height: 36px;
}

.brp-textarea {
	min-height: 86px;
	resize: vertical;
}

.brp-input:focus,
.brp-select:focus,
.brp-textarea:focus {
	outline: none !important;
	background: var(--brp-input-focus);
}

.brp-checkbox-row {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--brp-fg);
	cursor: pointer;
}

.brp-notice {
	padding: 11px 15px;
	border: 0;
	border-radius: 8px;
	background: var(--brp-surface);
	font-size: 13px;
	color: var(--brp-fg);
}

.brp-notice.is-ok {
	background: var(--brp-success-bg);
	color: var(--brp-success);
}

.brp-notice.is-err {
	background: var(--brp-danger-bg);
	color: var(--brp-danger);
}

/* Color swatches (6px square corners) */
.brp-swatch-row {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.brp-swatch {
	width: 26px;
	height: 26px;
	border-radius: 6px;
	border: 0;
	cursor: pointer;
	padding: 0;
	opacity: 0.72;
	transition: opacity 120ms ease, transform 120ms ease;
}

.brp-swatch.is-selected {
	opacity: 1;
	transform: scale(1.1);
}

/* Tool scope selector grid inside Bot modal */
.brp-scope-group {
	border: 0;
	border-radius: 8px;
	background: var(--brp-surface);
	padding: 11px 13px;
	display: flex;
	flex-direction: column;
	gap: 7px;
}

.brp-scope-cat {
	font-size: 12px;
	font-weight: 600;
	color: var(--brp-fg);
}

.brp-scope-items {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 7px 14px;
}

/* Modal (borderless, shadowless tonal dialog over dim overlay) */
.brp-modal-backdrop {
	position: fixed;
	inset: 0;
	background: var(--brp-overlay);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100000;
	padding: 20px;
}

.brp-modal {
	width: 100%;
	max-width: 660px;
	max-height: 88vh;
	background: var(--brp-bg);
	border: 0;
	border-radius: 12px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.brp-root[data-theme="dark"] .brp-modal {
	background: var(--brp-surface-elevated);
}

.brp-modal .brp-input,
.brp-modal .brp-select,
.brp-modal .brp-textarea {
	background: var(--brp-surface) !important;
}

.brp-root[data-theme="dark"] .brp-modal .brp-input,
.brp-root[data-theme="dark"] .brp-modal .brp-select,
.brp-root[data-theme="dark"] .brp-modal .brp-textarea {
	background: var(--brp-input-bg) !important;
}

.brp-modal-header {
	height: 52px;
	padding: 0 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
}

.brp-modal-title {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	color: var(--brp-fg);
}

.brp-modal-body {
	overflow-y: auto;
	padding: 8px 20px 18px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.brp-modal-footer {
	padding: 14px 20px;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	flex-shrink: 0;
}

/* Switch control */
.brp-switch {
	position: relative;
	display: inline-block;
	width: 36px;
	height: 20px;
}

.brp-switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.brp-switch-track {
	position: absolute;
	inset: 0;
	border-radius: 6px;
	background: var(--brp-surface-2);
	cursor: pointer;
	transition: background 140ms ease;
}

.brp-switch-track::before {
	content: "";
	position: absolute;
	width: 14px;
	height: 14px;
	left: 3px;
	top: 3px;
	border-radius: 4px;
	background: #ffffff;
	transition: transform 140ms ease;
}

.brp-switch input:checked + .brp-switch-track {
	background: var(--brp-success);
}

.brp-switch input:checked + .brp-switch-track::before {
	transform: translateX(16px);
}

/* Shortcode bar inside Forms view */
.brp-shortcode-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 11px 16px;
	border: 0;
	border-radius: 8px;
	background: var(--brp-surface);
	font-size: 12.5px;
}

.brp-form-reply-box {
	margin-top: 10px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* Truncation, Ellipsis, Pagination, Toolbars, Toasts, and Layout Helpers (Zero Inline Styles) */
.brp-block {
	display: block;
}

.brp-ellipsis {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.brp-ellipsis-url {
	display: inline-block;
	max-width: 240px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	vertical-align: bottom;
}

.brp-clamp-2 {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	word-break: break-word;
}

.brp-col-grow {
	width: 100%;
	min-width: 240px;
}

.brp-row-click {
	cursor: pointer;
}

.brp-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	flex-wrap: wrap;
}

.brp-toolbar-search {
	width: 260px;
	max-width: 100%;
	background: var(--brp-surface) !important;
}

.brp-pagination {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	border-radius: 8px;
	background: var(--brp-surface);
	font-size: 12.5px;
	color: var(--brp-fg-muted);
}

.brp-pagination-controls {
	display: flex;
	align-items: center;
	gap: 8px;
}

.brp-load-more-wrap {
	display: flex;
	justify-content: center;
	padding-bottom: 6px;
}

.brp-flex-between {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding-top: 6px;
}

.brp-stack-sm {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.brp-reply-preview {
	margin-top: 6px;
}

.brp-inspector-identity {
	display: flex;
	align-items: center;
	gap: 10px;
}

.brp-textarea-sm {
	min-height: 62px;
}

.brp-popover-empty {
	padding: 14px;
}

.brp-group-avatar-sm {
	width: 26px;
	height: 26px;
}

.brp-group-avatar-md {
	width: 34px;
	height: 34px;
}

.brp-swatch-c0 { background: #3f9b86; }
.brp-swatch-c1 { background: #5363c8; }
.brp-swatch-c2 { background: #7654b8; }
.brp-swatch-c3 { background: #3a78d8; }
.brp-swatch-c4 { background: #c6632b; }
.brp-swatch-c5 { background: #4ca466; }
.brp-swatch-c6 { background: #636d79; }
.brp-swatch-c7 { background: #b5822a; }

/* In-app Toast Notification (borderless, shadowless, replaces window.alert) */
.brp-toast {
	position: fixed;
	right: 24px;
	bottom: 24px;
	max-width: 380px;
	padding: 11px 15px;
	border: 0;
	border-radius: 8px;
	background: var(--brp-primary);
	color: var(--brp-primary-fg);
	font-size: 13px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	z-index: 100010;
}

.brp-toast.is-err {
	background: var(--brp-danger);
	color: #ffffff;
}

.brp-toast-close {
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
	padding: 0 2px;
	font-size: 15px;
	line-height: 1;
}

.brp-confirm-modal {
	max-width: 440px;
}

/* Responsive fallback for narrow admin viewports */
@media (max-width: 960px) {
	.brp-sidebar {
		width: 240px;
		min-width: 240px;
	}
	.brp-inspector {
		position: absolute;
		right: 0;
		top: 54px;
		bottom: 0;
		z-index: 25;
	}
}
