:root {
	color-scheme: dark;
	--web-app-bg: #100e17;
	--web-app-bg-alt: #0d0b12;
	--web-app-panel-bg: #191621;
	--web-app-fg: #bebebe;
	--web-app-muted: #aebbd0;
	--web-app-muted-strong: #c3cad8;
	--web-app-disabled-fg: #8f99aa;
	--web-app-disabled-bg: rgba(255, 255, 255, 0.055);
	--web-app-disabled-border: rgba(255, 255, 255, 0.16);
	--web-app-border: rgba(14, 210, 247, 0.18);
	--web-app-accent: #0fb6d6;
	--web-app-accent-soft: rgba(14, 210, 247, 0.25);
}

body.theme-dark {
	--web-app-bg: var(--background-primary, #100e17);
	--web-app-bg-alt: var(--background-primary-alt, #0d0b12);
	--web-app-panel-bg: var(--background-secondary, #191621);
	--web-app-fg: var(--text-normal, #bebebe);
	--web-app-muted: color-mix(
		in srgb,
		var(--text-normal, #bebebe) 76%,
		var(--text-accent, #7aa2f7) 24%
	);
	--web-app-muted-strong: color-mix(
		in srgb,
		var(--text-normal, #bebebe) 88%,
		var(--text-accent, #7aa2f7) 12%
	);
	--web-app-disabled-fg: color-mix(
		in srgb,
		var(--text-normal, #bebebe) 66%,
		var(--background-primary, #100e17) 34%
	);
	--web-app-disabled-bg: color-mix(
		in srgb,
		var(--background-secondary, #191621) 82%,
		var(--text-normal, #bebebe) 18%
	);
	--web-app-disabled-border: color-mix(
		in srgb,
		var(--background-modifier-border, rgba(255, 255, 255, 0.18)) 58%,
		var(--text-normal, #bebebe) 42%
	);
	--web-app-border: var(
		--background-modifier-border,
		rgba(14, 210, 247, 0.18)
	);
	--web-app-accent: var(--text-accent, #0fb6d6);
	--web-app-accent-soft: var(--bg-accent-25, rgba(14, 210, 247, 0.25));
	--font-interface:
		var(--default-font, Inter), -apple-system, BlinkMacSystemFont,
		"Segoe UI", sans-serif;
	--font-text:
		var(--default-font, Inter), -apple-system, BlinkMacSystemFont,
		"Segoe UI", sans-serif;
	/* Append real fallbacks: themes may name fonts that aren't installed
	   in the browser (otherwise the browser falls back to Times). */
	--font-monospace:
		var(--code-mono-font, "SFMono-Regular"), ui-monospace, "SFMono-Regular",
		Menlo, Consolas, "Liberation Mono", monospace;
	--text-muted: var(--web-app-muted);
	--text-on-accent: #061116;
	--interactive-normal: var(--background-secondary, #191621);
	--interactive-hover: var(
		--background-modifier-border,
		rgba(14, 210, 247, 0.18)
	);
	--background-modifier-hover: var(--web-app-accent-soft);
	--background-modifier-border-hover: var(
		--interactive-accent-hover,
		#31d5f4
	);
}

body {
	margin: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	background: var(--web-app-bg);
	color: var(--web-app-fg);
	font-family: var(
		--font-interface,
		-apple-system,
		BlinkMacSystemFont,
		"Segoe UI",
		Roboto,
		sans-serif
	);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

::-webkit-scrollbar {
	width: 10px;
	height: 10px;
}

::-webkit-scrollbar-track {
	background: transparent;
}

::-webkit-scrollbar-thumb {
	border: 3px solid transparent;
	border-radius: 8px;
	background-color: rgba(255, 255, 255, 0.14);
	background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
	background-color: rgba(255, 255, 255, 0.26);
}

::-webkit-scrollbar-corner {
	background: transparent;
}

.web-context-menu {
	box-sizing: border-box;
	min-width: 190px;
	max-width: min(280px, calc(100vw - 16px));
	padding: 5px;
	border: 1px solid var(--web-app-border);
	border-radius: 6px;
	background: var(--web-app-bg-alt);
	color: var(--web-app-fg);
	box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
}

.web-context-menu:focus {
	outline: none;
}

.web-context-menu-item {
	display: flex;
	align-items: center;
	width: 100%;
	min-height: 28px;
	padding: 5px 8px;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: inherit;
	cursor: pointer;
	font: inherit;
	font-size: 13px;
	text-align: left;
}

.web-context-menu-item:hover:not(:disabled),
.web-context-menu-item:focus-visible:not(:disabled) {
	background: var(--web-app-accent-soft);
	outline: none;
}

.web-context-menu-item:disabled {
	cursor: default;
	color: var(--web-app-disabled-fg);
}

.web-context-menu-item-title {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.web-context-menu-separator {
	height: 1px;
	margin: 5px 4px;
	background: var(--web-app-border);
}

.notice-container {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 10000;
	display: grid;
	gap: 8px;
	width: min(360px, calc(100vw - 32px));
	pointer-events: none;
}

.notice {
	box-sizing: border-box;
	border: 1px solid var(--web-app-border);
	border-radius: 8px;
	background: var(--web-app-bg-alt);
	color: var(--web-app-accent);
	box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
	padding: 10px 12px;
	font-size: 13px;
	line-height: 1.35;
	pointer-events: auto;
}

.notice-message {
	overflow-wrap: anywhere;
}

#app {
	display: flex;
	flex-direction: column;
	height: 100vh;
	min-width: 0;
	overflow: hidden;
	--web-app-sidebar-width: clamp(160px, 18vw, 280px);
	--web-app-workbench-width: clamp(320px, 42vw, 520px);
}

#app [hidden] {
	display: none !important;
}

.web-app-header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 16px;
	border-bottom: 1px solid var(--web-app-border);
	background: var(--web-app-bg-alt);
}

.web-app-title {
	display: inline-flex;
	align-items: center;
	font-size: 16px;
	margin: 0;
}

.web-app-title-mark {
	display: none;
}

.web-app-vault-name,
.web-app-status {
	color: var(--web-app-muted);
	font-size: 12px;
}

.web-app-status {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	white-space: nowrap;
}

.web-app-status::before {
	content: "";
	flex: 0 0 auto;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
	opacity: 0.7;
}

.web-app-status:empty::before {
	display: none;
}

.web-app-status.is-ok::before {
	background: #78d49f;
	opacity: 1;
}

.web-app-status.is-busy::before {
	background: #f2c46d;
	opacity: 1;
	animation: web-app-status-pulse 1.1s ease-in-out infinite;
}

.web-app-status.is-error::before {
	background: #ff8c8c;
	opacity: 1;
}

@keyframes web-app-status-pulse {
	0%,
	100% {
		transform: scale(1);
		opacity: 1;
	}

	50% {
		transform: scale(0.6);
		opacity: 0.55;
	}
}

.web-app-loading-spinner {
	box-sizing: border-box;
	display: inline-block;
	width: 12px;
	height: 12px;
	border: 2px solid rgba(255, 255, 255, 0.22);
	border-top-color: currentColor;
	border-radius: 50%;
	animation: web-app-spin 0.8s linear infinite;
}

@keyframes web-app-spin {
	to {
		transform: rotate(360deg);
	}
}

.web-app-loading-block {
	box-sizing: border-box;
	display: grid;
	gap: 10px;
	width: 100%;
	color: var(--text-muted, var(--web-app-muted));
}

.web-app-loading-header {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	line-height: 1.3;
}

.web-app-loading-line {
	display: block;
	width: var(--loading-line-width, 80%);
	height: 10px;
	border-radius: 999px;
	background: linear-gradient(
		90deg,
		rgba(255, 255, 255, 0.04),
		rgba(255, 255, 255, 0.11),
		rgba(255, 255, 255, 0.04)
	);
	background-size: 180% 100%;
	animation: web-app-skeleton 1.3s ease-in-out infinite;
}

@keyframes web-app-skeleton {
	0% {
		background-position: 100% 0;
	}

	100% {
		background-position: -80% 0;
	}
}

.web-app-loading-error {
	display: grid;
	gap: 5px;
	padding: 12px;
	border: 1px solid rgba(255, 140, 140, 0.35);
	border-radius: 6px;
	background: rgba(255, 140, 140, 0.08);
	color: #ffb1b1;
	font-size: 12px;
	line-height: 1.35;
}

.web-app-loading-error-details {
	margin-top: 4px;
	color: var(--text-muted, var(--web-app-muted));
}

.web-app-loading-error-details summary {
	cursor: pointer;
}

.web-app-loading-error-detail-text {
	margin: 6px 0 0;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	color: var(--text-muted, var(--web-app-muted));
	font-size: 11px;
}

.web-app-loading-button-label {
	white-space: nowrap;
}

.web-app-command-button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-left: auto;
	padding: 5px 10px;
	border: 1px solid var(--web-app-border);
	border-radius: 6px;
	background: var(--interactive-normal, rgba(255, 255, 255, 0.03));
	color: var(--web-app-fg);
	cursor: pointer;
	font: inherit;
	font-size: 13px;
}

.web-app-command-button:hover,
.web-app-command-button:focus-visible {
	border-color: var(--web-app-accent);
	color: var(--web-app-accent);
	outline: none;
}

.web-app-shortcut-hint,
.web-app-palette-shortcut,
.web-app-palette-item-shortcut {
	border: 1px solid var(--web-app-border);
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.04);
	color: var(--text-muted, var(--web-app-muted));
	font-family: var(--font-monospace, ui-monospace, SFMono-Regular, monospace);
	font-size: 11px;
	line-height: 1;
}

.web-app-shortcut-hint {
	padding: 3px 5px;
}

.web-app-sync,
.web-app-settings-button,
.web-app-offline-queue {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 28px;
	border-radius: 6px;
	padding: 4px 12px;
	cursor: pointer;
	font-size: 13px;
}

.web-app-sync,
.web-app-settings-button,
.web-app-push,
.web-app-offline-queue,
.web-app-admin-link,
.web-app-command-button,
.web-app-pane-toggle,
.web-app-panel-restore,
.web-app-note-action,
.web-app-git-chip,
.web-context-menu-item,
.web-settings-button {
	transition:
		background-color 0.13s ease,
		border-color 0.13s ease,
		color 0.13s ease,
		opacity 0.13s ease;
}

.web-app-sync:hover:not(:disabled),
.web-app-push:hover:not(:disabled),
.web-app-offline-queue:hover:not(:disabled) {
	filter: brightness(1.12);
}

.web-app-sync:disabled,
.web-app-push:disabled,
.web-app-offline-queue:disabled {
	cursor: default;
	border: 1px solid var(--web-app-disabled-border);
	background: var(--web-app-disabled-bg);
	color: var(--web-app-disabled-fg);
	filter: none;
	opacity: 1;
}

.web-app-sync {
	background: var(--web-app-accent);
	color: var(--text-on-accent, #061116);
	border: none;
}

.web-app-settings-button {
	border: 1px solid var(--web-app-border);
	background: var(--interactive-normal, rgba(255, 255, 255, 0.03));
	color: var(--web-app-fg);
}

.web-app-offline-queue {
	border: 1px solid rgba(242, 196, 109, 0.5);
	background: rgba(242, 196, 109, 0.12);
	color: #f6d58b;
}

.web-app-settings-button:hover,
.web-app-settings-button:focus-visible,
.web-app-offline-queue:focus-visible {
	border-color: var(--web-app-accent);
	color: var(--web-app-accent);
	outline: none;
}

.web-app-body {
	position: relative;
	display: flex;
	flex: 1;
	min-height: 0;
	min-width: 0;
	overflow: hidden;
}

.web-app-sidebar {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	flex: 0 0 var(--web-app-sidebar-width);
	min-width: 0;
	overflow: hidden;
	padding: 8px;
	font-size: 13px;
	background: var(--web-app-panel-bg);
}

.web-app-sidebar.is-collapsed {
	display: none;
}

.web-app-pane-toolbar {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	min-height: 32px;
	border-bottom: 1px solid var(--web-app-border);
	background: var(--web-app-bg-alt);
}

.web-app-sidebar-toolbar {
	position: sticky;
	top: -8px;
	z-index: 2;
	justify-content: flex-end;
	margin: -8px -8px 6px;
	padding: 5px 8px;
}

.web-app-workbench-toolbar {
	justify-content: flex-start;
	padding: 5px 8px;
}

.web-app-pane-toggle,
.web-app-panel-restore {
	color: var(--web-app-fg);
	border: 1px solid var(--web-app-border);
	background: var(--interactive-normal, rgba(255, 255, 255, 0.03));
	cursor: pointer;
	font: inherit;
	line-height: 1;
}

.web-app-pane-toggle {
	width: 24px;
	height: 22px;
	border-radius: 4px;
	padding: 0;
}

.web-app-pane-toggle:hover,
.web-app-pane-toggle:focus-visible,
.web-app-panel-restore:hover,
.web-app-panel-restore:focus-visible {
	border-color: var(--web-app-accent);
	color: var(--web-app-accent);
	outline: none;
}

.web-app-panel-restore {
	box-sizing: border-box;
	display: none;
	flex: 0 0 32px;
	align-items: flex-start;
	justify-content: center;
	align-self: stretch;
	padding: 12px 0 0;
	border-top: none;
	border-bottom: none;
	border-radius: 0;
	background: rgba(255, 255, 255, 0.02);
}

.web-app-panel-restore.is-visible {
	display: flex;
}

.web-app-panel-restore-left {
	border-left: none;
}

.web-app-panel-restore-right {
	border-right: none;
}

.web-app-resize-handle {
	box-sizing: border-box;
	position: relative;
	flex: 0 0 8px;
	cursor: col-resize;
	touch-action: none;
	background: transparent;
	outline: none;
}

.web-app-resize-handle::before {
	content: "";
	position: absolute;
	inset: 0 auto 0 3px;
	width: 1px;
	background: var(--web-app-border);
}

.web-app-resize-handle:hover::before,
.web-app-resize-handle:focus-visible::before,
.web-app-resize-handle.is-active::before {
	inset: 0 auto 0 2px;
	width: 3px;
	background: var(--web-app-accent);
}

.web-app-resize-handle.is-collapsed {
	display: none;
}

#app.is-pane-resizing,
#app.is-pane-resizing * {
	cursor: col-resize !important;
	user-select: none;
}

.web-app-folder-children {
	padding-left: 14px;
}

.web-app-file-filter {
	flex: 0 0 auto;
	display: grid;
	gap: 4px;
	margin: 0 0 8px;
}

.web-app-file-filter-input {
	box-sizing: border-box;
	width: 100%;
	min-height: 30px;
	border: 1px solid var(--web-app-border);
	border-radius: 6px;
	background: var(--background-primary, var(--web-app-bg));
	color: var(--text-normal, var(--web-app-fg));
	padding: 5px 9px;
	font: inherit;
	font-size: 12px;
}

.web-app-file-filter-input:focus {
	border-color: var(--web-app-accent);
	outline: none;
	box-shadow: 0 0 0 2px var(--web-app-accent-soft);
}

.web-app-file-filter-input::placeholder {
	color: var(--web-app-muted);
}

.web-app-file-filter-status {
	min-height: 14px;
	color: var(--web-app-muted);
	font-size: 11px;
	line-height: 1.2;
}

.web-app-file-filter-status:empty {
	display: none;
}

.web-app-file-filter-empty {
	padding: 10px 4px;
	color: var(--text-muted, var(--web-app-muted));
	font-size: 12px;
	line-height: 1.35;
}

.web-app-file-list {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
}

.web-app-file-list.is-loading,
.web-app-folder-children.is-loading {
	min-height: 96px;
}

.web-app-file-tree-loading {
	padding: 8px 4px;
}

.web-app-folder-children .web-app-file-tree-loading {
	padding: 6px 0 8px 2px;
}

.web-app-file-list:focus {
	outline: none;
}

.web-app-file-explorer-item {
	box-sizing: border-box;
	border-radius: 4px;
	outline: none;
	transition:
		background-color 0.12s ease,
		color 0.12s ease;
}

.web-app-folder-name {
	cursor: pointer;
	padding: 2px 4px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.web-app-file {
	cursor: pointer;
	padding: 2px 4px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.web-app-file-explorer-item:hover,
.web-app-file-explorer-item.is-focused {
	background: rgba(255, 255, 255, 0.08);
}

.web-app-file-explorer-item:focus-visible {
	outline: 2px solid var(--web-app-accent);
	outline-offset: 1px;
	background: var(--web-app-accent-soft);
}

.web-app-main {
	flex: 1;
	overflow-y: auto;
	padding: 16px 24px;
}

.web-app-note-title {
	margin-top: 0;
	font-size: 14px;
	color: var(--web-app-muted);
}

.web-app-login {
	display: flex;
	flex-direction: column;
	gap: 12px;
	max-width: 360px;
	margin: 18vh auto 0;
}

.web-app-login-title {
	text-align: center;
	margin: 0;
}

.web-app-login-input,
.web-app-login-button {
	padding: 8px 12px;
	border-radius: 6px;
	border: 1px solid var(--web-app-border);
	background: var(--web-app-bg);
	color: var(--web-app-fg);
}

.web-app-login-input[aria-invalid="true"] {
	border-color: #ff7777;
}

.web-app-login-button {
	background: var(--web-app-accent);
	color: white;
	border: none;
	cursor: pointer;
}

.web-app-login-button:disabled {
	cursor: not-allowed;
	border-color: var(--web-app-disabled-border);
	background: var(--web-app-disabled-bg);
	color: var(--web-app-disabled-fg);
	opacity: 1;
}

.web-app-login-telegram,
.web-app-login-fields {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* The explicit display values above would otherwise defeat the hidden
   attribute the login flow toggles. */
.web-app-login [hidden] {
	display: none !important;
}

.web-app-login-button.mod-telegram-link {
	display: block;
	text-align: center;
	text-decoration: none;
}

.web-app-login-telegram-status {
	font-size: 13px;
	text-align: center;
	color: var(--web-app-muted);
	min-height: 1em;
}

.web-app-login-divider {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--web-app-muted);
	font-size: 12px;
	text-transform: uppercase;
}

.web-app-login-divider::before,
.web-app-login-divider::after {
	content: "";
	flex: 1;
	border-top: 1px solid var(--web-app-border);
}

.web-app-login-toggle {
	background: none;
	border: none;
	color: var(--web-app-accent);
	cursor: pointer;
	font-size: 13px;
	padding: 0;
	text-align: center;
}

.web-app-login-warning {
	border: 1px solid #ffb057;
	border-left-width: 5px;
	border-radius: 8px;
	background: rgba(255, 176, 87, 0.14);
	color: var(--web-app-fg);
	padding: 10px 12px;
	font-size: 13px;
	line-height: 1.4;
}

.web-app-login-error {
	color: #ff8c8c;
	text-align: center;
	min-height: 1em;
}

.web-app-login-field-error {
	color: #ff8c8c;
	font-size: 12px;
	min-height: 1em;
	margin-top: -8px;
}

.web-app-boot {
	box-sizing: border-box;
	display: grid;
	gap: 12px;
	width: min(420px, calc(100vw - 32px));
	margin: 18vh auto 0;
	padding: 18px;
	border: 1px solid var(--web-app-border);
	border-radius: 8px;
	background: var(--background-secondary, var(--web-app-bg-alt));
	color: var(--text-normal, var(--web-app-fg));
	box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

.web-app-boot-title {
	margin: 0;
	font-size: 18px;
	line-height: 1.25;
}

.web-app-boot-detail,
.web-app-boot-warning {
	color: var(--text-muted, var(--web-app-muted));
	font-size: 13px;
	line-height: 1.45;
}

.web-app-boot-progress {
	position: relative;
	height: 8px;
	overflow: hidden;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.08);
}

.web-app-boot-progress-bar {
	position: absolute;
	inset: 0 auto 0 0;
	width: 42%;
	border-radius: inherit;
	background: var(--web-app-accent);
	animation: web-app-boot-progress 1.25s ease-in-out infinite;
}

@keyframes web-app-boot-progress {
	0% {
		transform: translateX(-110%);
	}

	100% {
		transform: translateX(260%);
	}
}

.web-app-boot-meta,
.web-app-boot-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.web-app-boot-meta span {
	border: 1px solid var(--web-app-border);
	border-radius: 999px;
	padding: 3px 8px;
	color: var(--text-muted, var(--web-app-muted));
	font-size: 12px;
}

.web-app-boot-warning {
	border: 1px solid rgba(242, 196, 109, 0.4);
	border-radius: 6px;
	background: rgba(242, 196, 109, 0.1);
	padding: 9px 10px;
	color: var(--text-normal, var(--web-app-fg));
}

.web-app-boot-technical {
	color: var(--text-muted, var(--web-app-muted));
	font-size: 12px;
}

.web-app-boot-technical summary {
	cursor: pointer;
}

.web-app-boot-technical-text {
	margin: 6px 0 0;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	font-size: 11px;
}

.web-app-boot-button {
	min-height: 30px;
	padding: 5px 12px;
	border: 1px solid var(--web-app-border);
	border-radius: 6px;
	background: var(--web-app-bg);
	color: var(--web-app-fg);
	cursor: pointer;
	font: inherit;
}

.web-app-boot-button.mod-primary {
	border-color: var(--web-app-accent);
	background: var(--web-app-accent);
	color: white;
}

/* --- Three-pane Obsidian-like layout --- */

.web-app-note-pane {
	box-sizing: border-box;
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	background: var(--background-primary, var(--web-app-bg));
}

.web-app-note-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 24px;
	font-size: 12px;
	color: var(--text-muted, var(--web-app-muted));
	border-bottom: 1px solid var(--web-app-border);
	min-height: 17px;
}

.web-app-note-path {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.web-app-note-actions {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 6px;
}

.web-app-note-action {
	min-width: 48px;
	min-height: 24px;
	padding: 3px 9px;
	border: 1px solid var(--web-app-border);
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.03);
	color: var(--web-app-fg);
	cursor: pointer;
	font: inherit;
}

.web-app-note-action-overflow {
	display: none;
}

.web-app-note-action:hover,
.web-app-note-action:focus-visible {
	border-color: var(--web-app-accent);
	color: white;
	outline: none;
}

.web-app-note-action:disabled {
	cursor: default;
	border-color: var(--web-app-disabled-border);
	background: var(--web-app-disabled-bg);
	color: var(--web-app-disabled-fg);
	opacity: 1;
}

.web-app-note-content {
	box-sizing: border-box;
	flex: 1;
	overflow-y: auto;
	padding: 24px 32px 64px;
}

.web-app-note-content.is-loading {
	display: flex;
	align-items: flex-start;
}

.web-app-note-loading {
	max-width: 720px;
	margin: 8vh auto 0;
	padding: 0;
}

.web-app-note-loading .web-app-loading-line {
	height: 13px;
}

.web-app-note-content.is-editing {
	display: flex;
	padding: 0;
	overflow: hidden;
}

.web-app-note-editor-shell {
	container-type: inline-size;
	display: flex;
	flex: 1 1 auto;
	min-width: 0;
	min-height: 0;
	flex-direction: column;
	background: var(--background-primary, var(--web-app-bg));
}

.web-app-note-editor-toolbar {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 8px 12px;
	border-bottom: 1px solid var(--web-app-border);
	background: var(--background-secondary, var(--web-app-bg-alt));
}

.web-app-note-editor-layout-toggle {
	display: inline-flex;
	min-width: 0;
	padding: 2px;
	border: 1px solid var(--web-app-border);
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.025);
}

.web-app-note-editor-layout-button,
.web-app-note-editor-focus {
	min-height: 26px;
	padding: 3px 9px;
	border: 1px solid transparent;
	border-radius: 4px;
	background: transparent;
	color: var(--text-muted, var(--web-app-muted));
	cursor: pointer;
	font: inherit;
	font-size: 12px;
	font-weight: 650;
}

.web-app-note-editor-layout-button:hover,
.web-app-note-editor-layout-button:focus-visible,
.web-app-note-editor-focus:hover,
.web-app-note-editor-focus:focus-visible {
	border-color: var(--web-app-accent);
	color: var(--text-normal, var(--web-app-fg));
	outline: none;
}

.web-app-note-editor-layout-button.is-active {
	border-color: rgba(88, 166, 255, 0.5);
	background: rgba(88, 166, 255, 0.18);
	color: var(--text-normal, var(--web-app-fg));
}

.web-app-note-editor-focus {
	flex: 0 0 auto;
	border-color: var(--web-app-border);
	background: rgba(255, 255, 255, 0.03);
	color: var(--text-normal, var(--web-app-fg));
}

.web-app-note-editor-focus:disabled {
	cursor: default;
	border-color: var(--web-app-disabled-border);
	background: var(--web-app-disabled-bg);
	color: var(--web-app-disabled-fg);
	opacity: 1;
}

.web-app-note-editor-focus:disabled:hover {
	border-color: var(--web-app-disabled-border);
	color: var(--web-app-disabled-fg);
}

.web-app-note-editor-workspace {
	display: grid;
	flex: 1 1 auto;
	min-height: 0;
	grid-template-columns: minmax(0, 1fr) minmax(260px, 0.85fr);
}

.web-app-note-editor-shell[data-edit-layout="editor"]
	.web-app-note-editor-workspace,
.web-app-note-editor-shell[data-edit-layout="preview"]
	.web-app-note-editor-workspace {
	grid-template-columns: minmax(0, 1fr);
}

.web-app-note-editor-shell[data-edit-layout="editor"]
	.web-app-note-editor-preview-pane,
.web-app-note-editor-shell[data-edit-layout="preview"]
	.web-app-note-editor-pane {
	display: none;
}

.web-app-note-editor-shell[data-edit-layout="editor"]
	.web-app-note-editor-pane {
	border-right: 0;
}

.web-app-note-editor-shell[data-edit-layout="preview"]
	.web-app-note-editor-preview-pane {
	display: flex;
}

.web-app-note-editor-pane,
.web-app-note-editor-preview-pane {
	min-width: 0;
	min-height: 0;
	overflow: hidden;
}

.web-app-note-editor-pane {
	border-right: 1px solid var(--web-app-border);
}

.web-app-note-editor-pane .cm-editor {
	height: 100%;
	background: var(--background-primary, var(--web-app-bg));
	color: var(--text-normal, var(--web-app-fg));
	font-family: var(
		--font-monospace,
		ui-monospace,
		SFMono-Regular,
		Menlo,
		monospace
	);
	font-size: 14px;
	line-height: 1.55;
}

.web-app-note-editor-pane .cm-scroller {
	padding: 18px 0 44px;
	font-family: inherit;
}

.web-app-note-editor-pane .cm-content {
	min-height: 100%;
	padding: 0 24px;
	caret-color: var(--web-app-accent);
}

.web-app-note-editor-pane .cm-line {
	padding: 0;
}

.web-app-note-editor-pane .cm-gutters {
	border-right: 1px solid var(--web-app-border);
	background: var(--background-primary, var(--web-app-bg));
	color: var(--web-app-muted);
}

.web-app-note-editor-pane .cm-activeLine,
.web-app-note-editor-pane .cm-activeLineGutter {
	background: rgba(255, 255, 255, 0.045);
}

.web-app-note-editor-pane .cm-focused {
	outline: none;
}

.web-app-note-editor-preview-pane {
	display: flex;
	flex-direction: column;
	background: var(--background-secondary, var(--web-app-bg-alt));
}

.web-app-note-editor-preview-header {
	flex: 0 0 auto;
	padding: 8px 14px;
	border-bottom: 1px solid var(--web-app-border);
	color: var(--text-muted, var(--web-app-muted));
	font-size: 12px;
}

.web-app-note-editor-preview {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 18px 22px 44px;
}

.web-app-note-editor-preview .markdown-preview-view {
	max-width: none;
	padding: 0;
}

.web-app-note-editor-status {
	flex: 0 0 auto;
	padding: 5px 12px;
	border-top: 1px solid var(--web-app-border);
	background: var(--background-secondary, var(--web-app-bg-alt));
	color: var(--text-muted, var(--web-app-muted));
	font-size: 12px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.web-app-note-content.is-history {
	display: flex;
	padding: 0;
	overflow: hidden;
}

.web-app-note-history {
	display: grid;
	grid-template-columns: minmax(220px, 0.34fr) minmax(0, 1fr);
	flex: 1 1 auto;
	min-width: 0;
	min-height: 0;
	background: var(--background-primary, var(--web-app-bg));
}

.web-app-note-history-list-pane,
.web-app-note-history-detail {
	min-width: 0;
	min-height: 0;
	overflow: hidden;
}

.web-app-note-history-list-pane {
	display: flex;
	flex-direction: column;
	border-right: 1px solid var(--web-app-border);
	background: var(--background-secondary, var(--web-app-bg-alt));
}

.web-app-note-history-list-header {
	flex: 0 0 auto;
	padding: 12px 14px 10px;
	border-bottom: 1px solid var(--web-app-border);
}

.web-app-note-history-title {
	color: var(--text-normal, var(--web-app-fg));
	font-size: 13px;
	font-weight: 700;
}

.web-app-note-history-subtitle {
	margin-top: 2px;
	color: var(--text-muted, var(--web-app-muted));
	font-size: 12px;
}

.web-app-note-history-list {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 6px;
}

.web-app-note-history-item {
	box-sizing: border-box;
	display: flex;
	width: 100%;
	min-width: 0;
	flex-direction: column;
	gap: 3px;
	padding: 8px;
	border: 1px solid transparent;
	border-radius: 6px;
	background: transparent;
	color: var(--text-normal, var(--web-app-fg));
	text-align: left;
	cursor: pointer;
	font: inherit;
}

.web-app-note-history-item:hover,
.web-app-note-history-item:focus-visible,
.web-app-note-history-item.is-active {
	border-color: var(--web-app-border);
	background: rgba(255, 255, 255, 0.055);
	outline: none;
}

.web-app-note-history-item.is-active {
	border-color: var(--web-app-accent);
}

.web-app-note-history-item-subject,
.web-app-note-history-item-meta,
.web-app-note-history-item-path {
	display: block;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.web-app-note-history-item-subject {
	font-size: 12px;
	font-weight: 650;
}

.web-app-note-history-item-meta,
.web-app-note-history-item-path {
	color: var(--text-muted, var(--web-app-muted));
	font-size: 11px;
}

.web-app-note-history-detail {
	display: flex;
	flex-direction: column;
}

.web-app-note-history-detail-header {
	display: flex;
	flex: 0 0 auto;
	align-items: flex-start;
	flex-wrap: wrap;
	gap: 12px;
	padding: 12px 16px;
	border-bottom: 1px solid var(--web-app-border);
	background: var(--background-primary, var(--web-app-bg));
}

.web-app-note-history-detail-meta {
	flex: 1 1 auto;
	min-width: 0;
}

.web-app-note-history-detail-title,
.web-app-note-history-detail-subtitle {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.web-app-note-history-detail-title {
	color: var(--text-normal, var(--web-app-fg));
	font-size: 14px;
	font-weight: 700;
}

.web-app-note-history-detail-actions {
	display: flex;
	flex: 0 0 auto;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: flex-end;
}

.web-app-note-history-detail-subtitle,
.web-app-note-history-compare-label {
	color: var(--text-muted, var(--web-app-muted));
	font-size: 12px;
}

.web-app-note-history-revision-details {
	margin-top: 4px;
	color: var(--text-muted, var(--web-app-muted));
	font-size: 11px;
}

.web-app-note-history-revision-details summary {
	cursor: pointer;
}

.web-app-note-history-revision-detail {
	margin-top: 3px;
	overflow-wrap: anywhere;
}

.web-app-note-history-restore {
	flex: 0 0 auto;
	min-height: 28px;
	padding: 4px 10px;
	border: 1px solid rgba(88, 166, 255, 0.55);
	border-radius: 4px;
	background: rgba(88, 166, 255, 0.12);
	color: var(--text-normal, var(--web-app-fg));
	cursor: pointer;
	font: inherit;
}

.web-app-note-history-restore:hover,
.web-app-note-history-restore:focus-visible {
	border-color: var(--web-app-accent);
	color: white;
	outline: none;
}

.web-app-note-history-restore:disabled {
	cursor: default;
	border-color: var(--web-app-disabled-border);
	background: var(--web-app-disabled-bg);
	color: var(--web-app-disabled-fg);
	opacity: 1;
}

.web-app-note-history-view {
	border-color: var(--web-app-border);
	background: var(--background-secondary, var(--web-app-bg-alt));
}

.web-app-note-history-compare-label {
	flex: 0 0 auto;
	padding: 8px 16px;
	border-bottom: 1px solid var(--web-app-border);
	background: var(--background-secondary, var(--web-app-bg-alt));
}

.web-app-note-history-diff-shell {
	flex: 1 1 auto;
	min-height: 0;
	overflow: auto;
	background: #0f131a;
}

.web-app-note-history-notice,
.web-app-note-history-version-banner {
	margin: 12px 14px 0;
	border: 1px solid rgba(88, 166, 255, 0.35);
	border-radius: 6px;
	background: rgba(88, 166, 255, 0.1);
	color: #cbe3ff;
	padding: 9px 10px;
	font-size: 12px;
	line-height: 1.4;
}

.web-app-note-history-diff-loading {
	margin: 20px;
}

.web-app-note-history-diff {
	box-sizing: border-box;
	min-width: 100%;
	margin: 0;
	padding: 14px 0 42px;
	color: #d8dee9;
	font-family: var(
		--font-monospace,
		ui-monospace,
		SFMono-Regular,
		Menlo,
		monospace
	);
	font-size: 12px;
	line-height: 1.5;
	tab-size: 2;
}

.web-app-note-history-version {
	box-sizing: border-box;
	min-width: 100%;
	margin: 0;
	padding: 14px 16px 42px;
	color: #d8dee9;
	font-family: var(
		--font-monospace,
		ui-monospace,
		SFMono-Regular,
		Menlo,
		monospace
	);
	font-size: 12px;
	line-height: 1.5;
	tab-size: 2;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.web-app-note-history-diff-line {
	display: block;
	min-height: 18px;
	padding: 0 16px;
	white-space: pre;
}

.web-app-note-history-diff-line.is-add {
	background: rgba(34, 197, 94, 0.13);
	color: #9ee6b1;
}

.web-app-note-history-diff-line.is-remove {
	background: rgba(248, 81, 73, 0.14);
	color: #ffb4ad;
}

.web-app-note-history-diff-line.is-hunk {
	background: rgba(88, 166, 255, 0.16);
	color: #9ecbff;
}

.web-app-note-history-empty {
	padding: 18px;
	color: var(--text-muted, var(--web-app-muted));
	font-size: 13px;
	line-height: 1.5;
}

@container (max-width: 760px) {
	.web-app-note-editor-workspace {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: minmax(260px, 1fr) minmax(220px, 0.75fr);
	}

	.web-app-note-editor-pane {
		border-right: 0;
		border-bottom: 1px solid var(--web-app-border);
	}

	.web-app-note-editor-shell[data-edit-layout="editor"]
		.web-app-note-editor-pane,
	.web-app-note-editor-shell[data-edit-layout="preview"]
		.web-app-note-editor-preview-pane {
		border-bottom: 0;
	}
}

@media (max-width: 780px) {
	.web-app-note-history {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: minmax(160px, 0.38fr) minmax(0, 1fr);
	}

	.web-app-note-history-list-pane {
		border-right: 0;
		border-bottom: 1px solid var(--web-app-border);
	}
}

.web-app-note-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	color: var(--web-app-muted);
	text-align: center;
	margin-top: 26vh;
	animation: web-app-fade-in 0.25s ease;
}

.web-app-note-placeholder-icon {
	font-size: 28px;
	line-height: 1;
	color: var(--web-app-accent);
	opacity: 0.55;
}

.web-app-note-placeholder-title {
	font-size: 16px;
	font-weight: 600;
	color: var(--text-muted, var(--web-app-muted));
}

.web-app-note-placeholder-hint {
	font-size: 13px;
	line-height: 1.5;
}

.web-app-note-placeholder-hint .web-app-shortcut-hint {
	padding: 2px 5px;
	margin: 0 1px;
}

@keyframes web-app-fade-in {
	from {
		opacity: 0;
		transform: translateY(4px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

.web-app-note-image {
	max-width: 100%;
}

.web-app-note-raw {
	white-space: pre-wrap;
	font-family: var(--font-monospace, monospace);
	font-size: 13px;
}

.web-app-note-preview-body {
	min-width: 0;
}

.web-app-properties-editor {
	margin-bottom: 18px;
	padding: 10px 12px;
	border: 1px solid var(--web-app-border);
	border-radius: 6px;
	background: color-mix(
		in srgb,
		var(--background-secondary, var(--web-app-panel)) 74%,
		transparent
	);
}

.web-app-properties-editor.is-empty {
	display: flex;
	align-items: center;
	margin-bottom: 10px;
	padding: 0;
	border: 0;
	background: transparent;
}

.web-app-properties-header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 8px;
}

.web-app-properties-title {
	flex: 1 1 auto;
	min-width: 0;
	color: var(--text-normal, var(--web-app-fg));
	font-size: 13px;
	font-weight: 700;
}

.web-app-properties-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.web-app-properties-action,
.web-app-properties-add-empty,
.web-app-property-remove,
.web-app-property-list-remove,
.web-app-property-list-add {
	min-height: 26px;
	padding: 3px 9px;
	border: 1px solid var(--web-app-border);
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.035);
	color: var(--web-app-fg);
	cursor: pointer;
	font: inherit;
	font-size: 12px;
}

.web-app-properties-action:hover,
.web-app-properties-action:focus-visible,
.web-app-properties-add-empty:hover,
.web-app-properties-add-empty:focus-visible,
.web-app-property-remove:hover,
.web-app-property-remove:focus-visible,
.web-app-property-list-remove:hover,
.web-app-property-list-remove:focus-visible,
.web-app-property-list-add:hover,
.web-app-property-list-add:focus-visible {
	border-color: var(--web-app-accent);
	color: white;
	outline: none;
}

.web-app-properties-add-empty {
	min-height: 24px;
	padding: 2px 8px;
	border-style: dashed;
	background: transparent;
	color: var(--text-muted, var(--web-app-muted));
}

.web-app-properties-action:disabled {
	cursor: default;
	border-color: var(--web-app-disabled-border);
	background: var(--web-app-disabled-bg);
	color: var(--web-app-disabled-fg);
	opacity: 1;
}

.web-app-properties-status,
.web-app-properties-empty,
.web-app-property-list-empty {
	color: var(--text-muted, var(--web-app-muted));
	font-size: 12px;
	line-height: 1.45;
}

.web-app-properties-status {
	min-height: 18px;
	margin-bottom: 8px;
}

.web-app-properties-status.is-error {
	color: #ff8c8c;
}

.web-app-properties-rows {
	display: grid;
	gap: 8px;
}

.web-app-property-row {
	display: grid;
	grid-template-columns: minmax(110px, 0.65fr) 118px minmax(180px, 1fr) auto;
	gap: 8px;
	align-items: start;
}

.web-app-property-key,
.web-app-property-type,
.web-app-property-value,
.web-app-property-list-input {
	box-sizing: border-box;
	width: 100%;
	min-width: 0;
	min-height: 30px;
	padding: 5px 8px;
	border: 1px solid var(--web-app-border);
	border-radius: 4px;
	background: var(--background-primary, rgba(255, 255, 255, 0.04));
	color: var(--text-normal, var(--web-app-fg));
	font: inherit;
	font-size: 13px;
}

.web-app-property-key:focus,
.web-app-property-type:focus,
.web-app-property-value:focus,
.web-app-property-list-input:focus {
	border-color: var(--web-app-accent);
	outline: none;
}

.web-app-property-checkbox {
	width: 18px;
	height: 18px;
	margin: 6px 0 0;
	accent-color: var(--interactive-accent, var(--web-app-accent));
}

.web-app-property-value-cell {
	min-width: 0;
}

.web-app-property-list {
	display: grid;
	gap: 6px;
}

.web-app-property-list-item {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 6px;
	align-items: center;
}

.web-app-property-list-add {
	margin-top: 6px;
}

@media (max-width: 760px) {
	.web-app-property-row {
		grid-template-columns: minmax(0, 1fr);
		padding-bottom: 8px;
		border-bottom: 1px solid var(--web-app-border);
	}

	.web-app-property-row:last-child {
		padding-bottom: 0;
		border-bottom: 0;
	}

	.web-app-property-remove {
		justify-self: start;
	}
}

.web-app-related-notes-panel {
	margin-top: 28px;
	padding-top: 18px;
	border-top: 1px solid var(--web-app-border);
}

.web-app-related-notes-header {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	margin-bottom: 10px;
}

.web-app-related-notes-title-group {
	flex: 1 1 auto;
	min-width: 0;
}

.web-app-related-notes-title {
	color: var(--text-normal, var(--web-app-fg));
	font-size: 14px;
	font-weight: 700;
}

.web-app-related-notes-subtitle,
.web-app-related-notes-summary,
.web-app-related-notes-path,
.web-app-related-notes-empty,
.web-app-related-notes-empty-description,
.web-app-related-notes-snippet-heading {
	color: var(--text-muted, var(--web-app-muted));
	font-size: 12px;
	line-height: 1.45;
}

.web-app-related-notes-actions,
.web-app-related-notes-summary {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}

.web-app-related-notes-action {
	min-height: 24px;
	padding: 3px 9px;
	border: 1px solid var(--web-app-border);
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.03);
	color: var(--web-app-fg);
	cursor: pointer;
	font: inherit;
	font-size: 12px;
}

.web-app-related-notes-action:hover,
.web-app-related-notes-action:focus-visible {
	border-color: var(--web-app-accent);
	color: white;
	outline: none;
}

.web-app-related-notes-action:disabled {
	cursor: default;
	border-color: var(--web-app-disabled-border);
	background: var(--web-app-disabled-bg);
	color: var(--web-app-disabled-fg);
	opacity: 1;
}

.web-app-related-notes-action.is-primary {
	border-color: var(--web-app-accent);
	background: var(--web-app-accent);
	color: white;
}

.web-app-related-notes-body {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.web-app-related-notes-summary span {
	display: inline-flex;
	align-items: center;
	min-height: 20px;
	padding: 1px 7px;
	border: 1px solid var(--web-app-border);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.035);
}

.web-app-related-notes-section {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.web-app-related-notes-section-title {
	color: var(--text-muted, var(--web-app-muted));
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
}

.web-app-related-notes-list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 8px;
}

.web-app-related-notes-card {
	min-width: 0;
	padding: 10px;
	border: 1px solid var(--web-app-border);
	border-radius: 6px;
	background: var(--background-secondary, rgba(255, 255, 255, 0.035));
}

.web-app-related-notes-card.is-near-duplicate {
	border-color: rgba(242, 196, 109, 0.65);
	background: rgba(242, 196, 109, 0.08);
}

.web-app-related-notes-card-header {
	display: flex;
	align-items: flex-start;
	gap: 8px;
}

.web-app-related-notes-card-title {
	flex: 1 1 auto;
	min-width: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--text-normal, var(--web-app-fg));
	cursor: pointer;
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	text-align: left;
	overflow-wrap: anywhere;
}

.web-app-related-notes-card-title:hover,
.web-app-related-notes-card-title:focus-visible {
	color: var(--web-app-accent);
	outline: none;
}

.web-app-related-notes-score {
	flex: 0 0 auto;
	color: #78d49f;
	font-size: 12px;
	font-weight: 700;
}

.web-app-related-notes-path {
	margin-top: 2px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.web-app-related-notes-snippets {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-top: 8px;
}

.web-app-related-notes-snippet {
	padding-left: 8px;
	border-left: 2px solid var(--web-app-border);
}

.web-app-related-notes-snippet-text {
	color: var(--text-normal, var(--web-app-fg));
	font-size: 12px;
	line-height: 1.45;
}

.web-app-related-notes-empty {
	padding: 6px 0;
}

.web-app-related-notes-empty-state {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 10px;
	border: 1px solid var(--web-app-border);
	border-radius: 6px;
	background: var(--background-secondary, rgba(255, 255, 255, 0.035));
}

.web-app-related-notes-empty-title {
	color: var(--text-normal, var(--web-app-fg));
	font-size: 13px;
	font-weight: 700;
	line-height: 1.35;
}

.web-app-related-notes-empty-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}

.web-app-workbench {
	box-sizing: border-box;
	position: relative;
	flex: 0 0 var(--web-app-workbench-width);
	min-width: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

/* The workbench toolbar only holds the collapse toggle — float it over
   the tab row instead of spending a whole row on it. */
.web-app-workbench-toolbar {
	position: absolute;
	top: 7px;
	right: 6px;
	z-index: 5;
	min-height: 0;
	padding: 0;
	border-bottom: 0;
	background: transparent;
}

.web-app-workbench-content {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	min-height: 0;
	overflow: hidden;
}

.web-app-workbench-content.is-loading,
.web-app-chat-modal-content.is-loading {
	justify-content: center;
	padding: 18px;
}

.web-app-chat-loading {
	max-width: 420px;
	margin: 0 auto;
}

.web-app-workbench.is-collapsed {
	display: none;
}

body.has-web-app-chat-modal {
	overflow: hidden;
}

body.has-web-shim-modal {
	overflow: hidden;
}

.has-web-app-settings-modal {
	overflow: hidden;
}

.web-shim-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 10002;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(0, 0, 0, 0.62);
}

.web-shim-modal-overlay > .modal {
	position: relative;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	width: min(760px, calc(100vw - 32px));
	max-height: calc(100vh - 32px);
	border: 1px solid var(--web-app-border);
	border-radius: 6px;
	background: var(--background-primary, var(--web-app-bg));
	color: var(--text-normal, var(--web-app-fg));
	box-shadow: 0 22px 70px rgba(0, 0, 0, 0.5);
	overflow: hidden;
}

.web-shim-modal-overlay > .modal.suggest-modal {
	width: min(640px, calc(100vw - 32px));
}

.web-shim-modal-overlay .modal-title {
	min-height: 20px;
	padding: 18px 54px 12px 22px;
	border-bottom: 1px solid var(--web-app-border);
	color: var(--text-normal, var(--web-app-fg));
	font-size: 16px;
	font-weight: 650;
	line-height: 1.3;
}

.web-shim-modal-overlay .modal-content {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 18px 22px 22px;
}

.web-shim-modal-close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 1px solid var(--web-app-border);
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.04);
	color: var(--web-app-fg);
	cursor: pointer;
	font: inherit;
	line-height: 1;
}

.web-shim-modal-close:hover,
.web-shim-modal-close:focus-visible {
	border-color: var(--web-app-accent);
	color: white;
	outline: none;
}

.suggest-modal .prompt-input {
	box-sizing: border-box;
	width: 100%;
	margin-bottom: 12px;
	padding: 9px 10px;
	border: 1px solid var(--web-app-border);
	border-radius: 6px;
	background: var(--background-secondary, var(--web-app-bg-alt));
	color: var(--text-normal, var(--web-app-fg));
	font: inherit;
}

.suggest-modal .prompt-input:focus {
	border-color: var(--web-app-accent);
	outline: none;
}

.prompt-instructions {
	margin-bottom: 10px;
	color: var(--text-muted, var(--web-app-muted));
	font-size: 12px;
}

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

.prompt-instruction {
	display: flex;
	gap: 8px;
	align-items: baseline;
}

.prompt-instruction-command {
	font-family: var(--font-monospace, monospace);
	color: var(--web-app-accent);
}

.suggestion-container {
	display: grid;
	gap: 6px;
}

.suggestion-item,
.suggestion-empty {
	padding: 9px 10px;
	border: 1px solid var(--web-app-border);
	border-radius: 6px;
	background: var(--background-secondary, var(--web-app-bg-alt));
	color: var(--text-normal, var(--web-app-fg));
	font-size: 13px;
	line-height: 1.35;
}

.suggestion-item {
	cursor: pointer;
}

.suggestion-item:hover,
.suggestion-item:focus-visible {
	border-color: var(--web-app-accent);
	outline: none;
}

.suggestion-empty {
	color: var(--text-muted, var(--web-app-muted));
}

.web-app-chat-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.62);
}

.web-app-chat-modal {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 95vw;
	height: calc(100vh - 24px);
	max-width: none;
	max-height: none;
	border: 1px solid var(--web-app-border);
	border-radius: 6px;
	background: var(--web-app-bg);
	box-shadow: 0 22px 70px rgba(0, 0, 0, 0.5);
	overflow: hidden;
}

.web-app-chat-modal-content {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	min-height: 0;
	overflow: hidden;
}

.web-app-chat-modal-close {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 3;
	width: 26px;
	height: 26px;
	padding: 0;
	border: 1px solid var(--web-app-border);
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.04);
	color: var(--web-app-fg);
	cursor: pointer;
	font: inherit;
	line-height: 1;
}

.web-app-chat-modal-close:hover,
.web-app-chat-modal-close:focus-visible {
	border-color: var(--web-app-accent);
	color: white;
	outline: none;
}

.web-app-settings-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 10001;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(0, 0, 0, 0.62);
}

.web-app-settings-modal {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(1040px, calc(100vw - 32px));
	max-height: calc(100vh - 32px);
	border: 1px solid var(--web-app-border);
	border-radius: 6px;
	background: var(--background-primary, var(--web-app-bg));
	box-shadow: 0 22px 70px rgba(0, 0, 0, 0.5);
	overflow: hidden;
}

.web-app-settings-modal-content {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
}

.web-app-settings-modal-close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 1px solid var(--web-app-border);
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.04);
	color: var(--web-app-fg);
	cursor: pointer;
	font: inherit;
	line-height: 1;
}

.web-app-settings-modal-close:hover,
.web-app-settings-modal-close:focus-visible {
	border-color: var(--web-app-accent);
	color: white;
	outline: none;
}

.has-web-app-share-modal {
	overflow: hidden;
}

.web-app-share-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 10002;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(0, 0, 0, 0.62);
}

.web-app-share-modal {
	position: relative;
	box-sizing: border-box;
	display: grid;
	gap: 14px;
	width: min(540px, calc(100vw - 32px));
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	border: 1px solid var(--web-app-border);
	border-radius: 8px;
	background: var(--background-primary, var(--web-app-bg));
	box-shadow: 0 22px 70px rgba(0, 0, 0, 0.5);
	padding: 22px 24px 18px;
}

.web-app-share-modal-close {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 1px solid var(--web-app-border);
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.04);
	color: var(--web-app-fg);
	cursor: pointer;
	font: inherit;
	line-height: 1;
}

.web-app-share-modal-close:hover,
.web-app-share-modal-close:focus-visible {
	border-color: var(--web-app-accent);
	color: white;
	outline: none;
}

.web-app-share-modal-header {
	display: grid;
	gap: 5px;
	padding-right: 32px;
}

.web-app-share-modal-title {
	margin: 0;
	color: var(--text-normal, var(--web-app-fg));
	font-size: 18px;
	line-height: 1.25;
}

.web-app-share-modal-subtitle {
	margin: 0;
	color: var(--text-muted, var(--web-app-muted));
	font-size: 13px;
	line-height: 1.45;
}

.web-app-share-details {
	display: grid;
	gap: 8px;
	border: 1px solid var(--web-app-border);
	border-radius: 8px;
	background: var(--background-secondary, var(--web-app-bg-alt));
	padding: 10px;
}

.web-app-share-detail {
	display: grid;
	grid-template-columns: 88px minmax(0, 1fr);
	gap: 10px;
	align-items: start;
}

.web-app-share-detail-label {
	color: var(--text-muted, var(--web-app-muted));
	font-size: 12px;
	font-weight: 700;
}

.web-app-share-detail-value {
	min-width: 0;
	color: var(--text-normal, var(--web-app-fg));
	font-size: 13px;
	line-height: 1.35;
	overflow-wrap: anywhere;
}

.web-app-share-scope {
	display: grid;
	gap: 7px;
	color: var(--text-normal, var(--web-app-fg));
	font-size: 13px;
	line-height: 1.45;
}

.web-app-share-scope h3 {
	margin: 4px 0 0;
	font-size: 13px;
	line-height: 1.25;
}

.web-app-share-scope-list {
	display: grid;
	gap: 5px;
	margin: 0;
	padding-left: 18px;
	color: var(--text-muted, var(--web-app-muted));
}

.web-app-share-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 8px;
	border-top: 1px solid var(--web-app-border);
	padding-top: 12px;
}

.web-app-share-button {
	min-height: 32px;
	padding: 5px 12px;
	border: 1px solid var(--web-app-border);
	border-radius: 6px;
	background: var(--background-secondary, var(--web-app-bg-alt));
	color: var(--web-app-fg);
	cursor: pointer;
	font: inherit;
}

.web-app-share-button:hover,
.web-app-share-button:focus-visible {
	border-color: var(--web-app-accent);
	outline: none;
}

.web-app-share-button.mod-primary {
	border-color: var(--web-app-accent);
	background: var(--web-app-accent);
	color: white;
}

.web-settings {
	padding: 22px 28px 32px;
}

.web-settings-header {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto auto;
	gap: 12px;
	align-items: start;
	padding-right: 32px;
}

.web-settings-title {
	margin: 0;
	font-size: 20px;
	line-height: 1.25;
}

.web-settings-subtitle,
.web-settings-section-description,
.web-settings-status {
	color: var(--text-muted, var(--web-app-muted));
	font-size: 13px;
	line-height: 1.4;
}

.web-settings-status {
	min-width: 92px;
	padding-top: 5px;
	text-align: right;
}

.web-settings-status.is-success {
	color: #78d49f;
}

.web-settings-status.is-error {
	color: #ff8c8c;
}

.web-settings-status.is-pending {
	color: #f2c46d;
}

.web-settings-actions,
.web-settings-backend-actions {
	display: flex;
	gap: 8px;
	align-items: center;
}

.web-settings-section {
	padding-top: 22px;
	margin-top: 22px;
	border-top: 1px solid var(--web-app-border);
}

.web-settings-section h3 {
	margin: 0 0 4px;
	font-size: 15px;
	line-height: 1.3;
}

.web-settings-section-description {
	margin-bottom: 10px;
}

.web-settings .setting-item {
	display: grid;
	grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1fr);
	gap: 16px;
	align-items: center;
	padding: 10px 0;
	border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.web-settings .setting-item-info {
	min-width: 0;
}

.web-settings .setting-item-name {
	font-size: 13px;
	font-weight: 600;
}

.web-settings .setting-item-description {
	margin-top: 3px;
	color: var(--text-muted, var(--web-app-muted));
	font-size: 12px;
	line-height: 1.35;
}

.web-settings .setting-item-control {
	display: flex;
	justify-content: flex-end;
	min-width: 0;
}

.web-settings input[type="text"],
.web-settings input[type="password"],
.web-settings input[type="number"],
.web-settings input[type="range"],
.web-settings select,
.web-settings textarea {
	width: min(100%, 420px);
	box-sizing: border-box;
	border: 1px solid var(--web-app-border);
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.03);
	color: var(--web-app-fg);
	font: inherit;
}

.web-settings input[type="text"],
.web-settings input[type="password"],
.web-settings input[type="number"],
.web-settings select,
.web-settings textarea {
	padding: 6px 8px;
}

.web-settings textarea {
	min-height: 92px;
	resize: vertical;
	font-family: var(--font-monospace, ui-monospace, monospace);
	font-size: 12px;
	line-height: 1.45;
}

.web-settings .checkbox-container {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.web-settings-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	min-height: 28px;
	padding: 5px 11px;
	border: 1px solid var(--web-app-border);
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.03);
	color: var(--web-app-fg);
	cursor: pointer;
	font: inherit;
}

.web-settings-button-primary {
	background: var(--web-app-accent);
	border-color: var(--web-app-accent);
	color: white;
}

.web-settings-button-compact {
	min-height: 24px;
	padding: 3px 8px;
	font-size: 12px;
}

.web-settings-button:hover:not(:disabled),
.web-settings-button:focus-visible:not(:disabled) {
	border-color: var(--web-app-accent);
	color: white;
	outline: none;
}

.web-settings-button:disabled {
	cursor: default;
	border-color: var(--web-app-disabled-border);
	background: var(--web-app-disabled-bg);
	color: var(--web-app-disabled-fg);
	opacity: 1;
}

.web-settings-backend {
	padding: 10px 0 12px;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.web-settings-backend-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 0 0 4px;
}

.web-settings-backend-title {
	font-size: 13px;
	font-weight: 700;
}

@media (max-width: 760px) {
	.web-settings {
		padding: 20px 18px 28px;
	}

	.web-settings-header {
		grid-template-columns: 1fr;
		padding-right: 34px;
	}

	.web-settings-actions {
		flex-wrap: wrap;
	}

	.web-settings-status {
		min-width: 0;
		text-align: left;
	}

	.web-settings .setting-item {
		grid-template-columns: 1fr;
		gap: 8px;
	}

	.web-settings .setting-item-control {
		justify-content: flex-start;
	}

	.web-settings input[type="text"],
	.web-settings input[type="password"],
	.web-settings input[type="number"],
	.web-settings input[type="range"],
	.web-settings select,
	.web-settings textarea {
		width: 100%;
	}

	.web-settings-backend-header {
		align-items: flex-start;
		flex-direction: column;
	}
}

.web-app-file.is-active {
	background: var(--web-app-accent-soft);
	color: var(--text-accent, var(--web-app-accent));
}

.web-app-file.is-active.is-focused,
.web-app-file.is-active:focus-visible {
	background: color-mix(in srgb, var(--web-app-accent) 30%, transparent);
}

/* --- Obsidian-style markdown preview --- */

.web-app-note-content .markdown-preview-view {
	max-width: 720px;
	margin: 0 auto;
	font-family: var(--font-text, inherit);
	font-size: 16px;
	line-height: 1.6;
	color: var(--text-normal, var(--web-app-fg));
}

.markdown-rendered h1,
.markdown-rendered h2,
.markdown-rendered h3,
.markdown-rendered h4 {
	font-weight: 600;
	line-height: 1.25;
	margin: 1em 0 0.4em;
	color: var(--text-normal, var(--web-app-fg));
}

.markdown-rendered h1 {
	font-size: 1.8em;
}

.markdown-rendered h2 {
	font-size: 1.45em;
}

.markdown-rendered h3 {
	font-size: 1.2em;
}

.markdown-rendered p {
	margin: 0.6em 0;
}

.markdown-rendered a.internal-link {
	color: var(--text-accent, #9db5ff);
	text-decoration: none;
	cursor: pointer;
}

.markdown-rendered a.internal-link:hover {
	text-decoration: underline;
}

.markdown-rendered a.internal-link.is-unresolved {
	opacity: 0.55;
}

.markdown-rendered a.tag {
	background: var(--background-secondary, #292b30);
	color: var(--text-accent, #9db5ff);
	border-radius: 12px;
	padding: 1px 8px;
	font-size: 0.85em;
	text-decoration: none;
}

.markdown-rendered mark {
	background: rgba(255, 208, 0, 0.35);
	color: inherit;
	border-radius: 2px;
	padding: 0 2px;
}

.markdown-rendered code {
	background: var(--background-secondary, #292b30);
	font-family: var(--font-monospace, monospace);
	font-size: 0.85em;
	border-radius: 3px;
	padding: 1px 5px;
}

.markdown-rendered pre {
	background: var(--background-secondary, #292b30);
	border-radius: 6px;
	padding: 12px 16px;
	overflow-x: auto;
}

.markdown-rendered pre code {
	background: transparent;
	padding: 0;
	font-size: 0.85em;
}

.markdown-rendered blockquote {
	border-left: 3px solid var(--interactive-accent, #7c9cff);
	margin: 0.6em 0;
	padding: 0 0 0 16px;
	color: var(--text-muted, var(--web-app-muted));
}

.markdown-rendered ul,
.markdown-rendered ol {
	padding-inline-start: 26px;
	margin: 0.4em 0;
}

.markdown-rendered li {
	margin: 0.15em 0;
}

.markdown-rendered li:has(> input.task-list-item-checkbox) {
	list-style: none;
	margin-inline-start: -18px;
}

.markdown-rendered input.task-list-item-checkbox {
	accent-color: var(--interactive-accent, #7c9cff);
	margin-right: 6px;
}

.markdown-rendered table {
	border-collapse: collapse;
	margin: 0.8em 0;
}

.markdown-rendered th,
.markdown-rendered td {
	border: 1px solid var(--background-modifier-border, #41454d);
	padding: 5px 12px;
}

.markdown-rendered th {
	background: var(--background-secondary, #292b30);
	font-weight: 600;
}

.markdown-rendered hr {
	border: none;
	border-top: 1px solid var(--background-modifier-border, #41454d);
	margin: 1.4em 0;
}

.markdown-rendered img {
	max-width: 100%;
	border-radius: 4px;
}

/* Callouts */

.markdown-rendered .callout {
	border-radius: 6px;
	border-left: 3px solid var(--interactive-accent, #7c9cff);
	background: rgba(124, 156, 255, 0.1);
	padding: 10px 14px;
	margin: 0.8em 0;
}

.markdown-rendered .callout-title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	color: var(--text-accent, #9db5ff);
}

.markdown-rendered .callout-content > p:first-child {
	margin-top: 0.4em;
}

.markdown-rendered .callout-content > p:last-child {
	margin-bottom: 0;
}

.markdown-rendered .callout[data-callout="warning"],
.markdown-rendered .callout[data-callout="caution"],
.markdown-rendered .callout[data-callout="attention"] {
	border-left-color: #f2c46d;
	background: rgba(242, 196, 109, 0.12);
}

.markdown-rendered .callout[data-callout="warning"] .callout-title {
	color: #f2c46d;
}

.markdown-rendered .callout[data-callout="danger"],
.markdown-rendered .callout[data-callout="error"],
.markdown-rendered .callout[data-callout="failure"],
.markdown-rendered .callout[data-callout="bug"] {
	border-left-color: #ff8c8c;
	background: rgba(255, 140, 140, 0.12);
}

.markdown-rendered .callout[data-callout="danger"] .callout-title,
.markdown-rendered .callout[data-callout="error"] .callout-title {
	color: #ff8c8c;
}

.markdown-rendered .callout[data-callout="success"],
.markdown-rendered .callout[data-callout="check"] {
	border-left-color: #78d49f;
	background: rgba(120, 212, 159, 0.12);
}

.markdown-rendered .callout[data-callout="success"] .callout-title {
	color: #78d49f;
}

/* Frontmatter properties */

.markdown-rendered .metadata-container {
	border: 1px solid var(--background-modifier-border, #41454d);
	border-radius: 6px;
	padding: 8px 12px;
	margin-bottom: 16px;
	font-size: 13px;
}

.markdown-rendered .metadata-property {
	display: flex;
	gap: 12px;
	padding: 2px 0;
}

.markdown-rendered .metadata-property-key {
	color: var(--text-muted, var(--web-app-muted));
	min-width: 110px;
}

.web-app-git-chip {
	appearance: none;
	background: color-mix(
		in srgb,
		var(--background-secondary, var(--web-app-panel)) 82%,
		transparent
	);
	font-family: var(--font-monospace, monospace);
	font-size: 11px;
	color: var(--text-muted, var(--web-app-muted));
	border: 1px solid var(--web-app-border);
	border-radius: 10px;
	padding: 2px 10px;
	white-space: nowrap;
	cursor: pointer;
}

.web-app-git-chip:hover,
.web-app-git-chip:focus-visible,
.web-app-git-chip[aria-expanded="true"] {
	color: var(--text-normal, var(--web-app-fg));
	border-color: var(--interactive-accent, var(--web-app-accent));
	outline: none;
}

.web-app-git-chip.is-attention {
	color: var(--text-normal, var(--web-app-fg));
	border-color: color-mix(
		in srgb,
		var(--interactive-accent, var(--web-app-accent)) 55%,
		var(--web-app-border)
	);
}

.web-app-git-popover {
	position: fixed;
	z-index: 10020;
	width: min(420px, calc(100vw - 24px));
	max-height: min(640px, calc(100vh - 24px));
	overflow: auto;
	background: var(--background-primary, var(--web-app-bg));
	color: var(--text-normal, var(--web-app-fg));
	border: 1px solid var(--web-app-border);
	border-radius: 8px;
	box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
	padding: 14px;
	font-size: 12px;
}

.web-app-git-popover-header,
.web-app-git-popover-actions,
.web-app-git-info-row,
.web-app-git-submodule {
	display: flex;
	align-items: center;
	gap: 10px;
}

.web-app-git-popover-header {
	justify-content: space-between;
	margin-bottom: 12px;
}

.web-app-git-popover-title {
	font-size: 14px;
	font-weight: 700;
}

.web-app-git-popover-close {
	width: 28px;
	height: 28px;
	border: 1px solid var(--web-app-border);
	border-radius: 6px;
	background: transparent;
	color: var(--text-muted, var(--web-app-muted));
	cursor: pointer;
}

.web-app-git-popover-close:hover,
.web-app-git-popover-close:focus-visible {
	color: var(--text-normal, var(--web-app-fg));
	border-color: var(--interactive-accent, var(--web-app-accent));
	outline: none;
}

.web-app-git-metrics {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	margin-bottom: 12px;
}

.web-app-git-metric {
	min-width: 0;
	border: 1px solid var(--web-app-border);
	border-radius: 6px;
	padding: 8px;
	background: var(--background-secondary, var(--web-app-panel));
}

.web-app-git-metric.is-attention {
	border-color: color-mix(
		in srgb,
		var(--interactive-accent, var(--web-app-accent)) 58%,
		var(--web-app-border)
	);
}

.web-app-git-metric.is-danger {
	border-color: var(--text-error, #ff6b6b);
}

.web-app-git-metric-label,
.web-app-git-info-label {
	display: block;
	color: var(--text-muted, var(--web-app-muted));
	font-size: 11px;
}

.web-app-git-metric-value,
.web-app-git-info-value {
	display: block;
	min-width: 0;
	overflow-wrap: anywhere;
}

.web-app-git-info-row {
	justify-content: space-between;
	align-items: flex-start;
	border-top: 1px solid var(--web-app-border);
	padding: 8px 0;
}

.web-app-git-info-value {
	text-align: right;
	max-width: 70%;
}

.web-app-git-section {
	border-top: 1px solid var(--web-app-border);
	padding-top: 10px;
	margin-top: 4px;
}

.web-app-git-section-title {
	margin: 0 0 8px;
	font-size: 12px;
}

.web-app-git-submodules {
	display: grid;
	gap: 6px;
}

.web-app-git-submodule {
	justify-content: space-between;
	align-items: flex-start;
	border: 1px solid var(--web-app-border);
	border-radius: 6px;
	padding: 8px;
	background: color-mix(
		in srgb,
		var(--background-secondary, var(--web-app-panel)) 72%,
		transparent
	);
}

.web-app-git-submodule-path {
	font-family: var(--font-monospace, monospace);
	font-size: 11px;
	overflow-wrap: anywhere;
}

.web-app-git-submodule-state {
	color: var(--text-muted, var(--web-app-muted));
	text-align: right;
	min-width: 110px;
}

.web-app-git-guidance {
	margin: 0;
	padding-left: 18px;
	color: var(--text-muted, var(--web-app-muted));
}

.web-app-git-guidance li + li {
	margin-top: 5px;
}

.web-app-git-popover-actions {
	justify-content: flex-end;
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid var(--web-app-border);
}

.web-app-git-popover-actions button {
	border: 1px solid var(--web-app-border);
	border-radius: 6px;
	background: var(--background-secondary, var(--web-app-panel));
	color: var(--text-normal, var(--web-app-fg));
	padding: 5px 10px;
	cursor: pointer;
}

.web-app-git-popover-actions button:disabled {
	cursor: not-allowed;
	border-color: var(--web-app-disabled-border);
	background: var(--web-app-disabled-bg);
	color: var(--web-app-disabled-fg);
	opacity: 1;
}

.web-app-git-popover-muted {
	margin: 0;
	color: var(--text-muted, var(--web-app-muted));
}

.web-app-push {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	background: var(--interactive-accent, var(--web-app-accent));
	color: var(--text-on-accent, white);
	border: none;
	border-radius: 6px;
	min-height: 28px;
	padding: 4px 12px;
	cursor: pointer;
	font-size: 13px;
}

.web-app-new-note-button {
	font-size: 14px;
}

.web-app-repo-select {
	box-sizing: border-box;
	min-height: 28px;
	background: var(--web-app-bg);
	color: var(--web-app-fg);
	border: 1px solid var(--web-app-border);
	border-radius: 6px;
	padding: 4px 8px;
	font-size: 12px;
	transition: border-color 0.13s ease;
}

.web-app-repo-select:hover,
.web-app-repo-select:focus-visible {
	border-color: var(--web-app-accent);
	outline: none;
}

.web-app-admin-link {
	display: inline-flex;
	align-items: center;
	box-sizing: border-box;
	min-height: 28px;
	color: var(--web-app-fg);
	text-decoration: none;
	font-size: 13px;
	border: 1px solid var(--web-app-border);
	border-radius: 6px;
	padding: 4px 12px;
	background: var(--interactive-normal, rgba(255, 255, 255, 0.03));
}

.web-app-admin-link:hover,
.web-app-admin-link:focus-visible {
	border-color: var(--web-app-accent);
	color: var(--web-app-accent);
	outline: none;
}

/* Tablets: side panels become overlay drawers over the note pane. Phones
   (≤640px) use the bottom tab bar instead — see the block further down. */
@media (min-width: 641px) and (max-width: 1080px) {
	#app {
		--web-app-sidebar-width: min(320px, calc(100vw - 56px));
		--web-app-workbench-width: min(460px, calc(100vw - 56px));
	}

	.web-app-header {
		flex-wrap: wrap;
		gap: 8px;
		padding: 8px 12px;
	}

	.web-app-title {
		min-width: 0;
	}

	.web-app-repo-select {
		max-width: min(180px, 45vw);
	}

	.web-app-git-chip {
		flex: 1 1 180px;
		min-width: 0;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.web-app-note-pane {
		flex: 1 1 100%;
		width: 100%;
	}

	.web-app-sidebar,
	.web-app-workbench {
		position: absolute;
		top: 0;
		bottom: 0;
		z-index: 20;
		max-width: calc(100vw - 48px);
		box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
	}

	.web-app-sidebar {
		left: 0;
		width: min(var(--web-app-sidebar-width), 320px, calc(100vw - 56px));
		border-right: 1px solid var(--web-app-border);
	}

	.web-app-workbench {
		right: 0;
		width: min(var(--web-app-workbench-width), 460px, calc(100vw - 56px));
		border-left: 1px solid var(--web-app-border);
		background: var(--background-primary, var(--web-app-bg));
	}

	.web-app-resize-handle {
		display: none;
	}

	.web-app-panel-restore.is-visible {
		position: absolute;
		top: 0;
		bottom: 0;
		z-index: 21;
		width: 32px;
	}

	.web-app-panel-restore-left {
		left: 0;
	}

	.web-app-panel-restore-right {
		right: 0;
	}
}

@media (min-width: 641px) and (max-width: 1080px) {
	#app:has(.web-app-workbench:not(.is-collapsed))
		.web-app-sidebar:not(.is-collapsed) {
		display: none;
	}
}

/* --- Mobile shell: bottom tab bar + single full-screen pane --- */

/* Hidden outside the phone breakpoint. */
.web-app-tabbar {
	display: none;
}

.web-app-header-overflow {
	display: none;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 38px;
	min-height: 34px;
	padding: 0;
	border: 1px solid var(--web-app-border);
	border-radius: 6px;
	background: var(--interactive-normal, rgba(255, 255, 255, 0.03));
	color: var(--web-app-fg);
	font: inherit;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	touch-action: manipulation;
}

.web-app-header-overflow:focus-visible {
	border-color: var(--web-app-accent);
	color: var(--web-app-accent);
	outline: none;
}

@media (max-width: 1080px) {
	.web-app-header-overflow {
		display: inline-flex;
	}

	.web-app-git-chip,
	.web-app-repo-select,
	.web-app-vault-name,
	.web-app-header-secondary {
		display: none;
	}
}

@media (max-width: 640px) {
	#app {
		height: 100dvh;
		--web-app-sidebar-width: 100%;
		--web-app-workbench-width: 100%;
		-webkit-tap-highlight-color: transparent;
	}

	/* Compact single-row header; secondary actions live in the ⋯ menu. */
	.web-app-header {
		flex-wrap: nowrap;
		gap: 6px;
		padding: 6px 10px;
		padding-top: max(6px, env(safe-area-inset-top));
	}

	.web-app-title {
		flex: 0 0 auto;
		min-width: max-content;
		overflow: visible;
		text-overflow: clip;
		white-space: nowrap;
		font-size: 14px;
	}

	.web-app-title-full {
		display: none;
	}

	.web-app-title-mark {
		display: inline;
	}

	.web-app-status,
	.web-app-header-secondary,
	.web-app-repo-select {
		display: none;
	}

	.web-app-sync,
	.web-app-command-button {
		flex: 0 0 auto;
		margin-left: 0;
		min-height: 34px;
		padding: 4px 10px;
	}

	.web-app-command-button .web-app-shortcut-hint {
		display: none;
	}

	.web-app-header-overflow {
		display: inline-flex;
	}

	/* One pane at a time, chosen by the tab bar (or by opening a note). */
	.web-app-body {
		display: grid;
		grid-template-columns: minmax(0, 1fr);
	}

	.web-app-sidebar,
	.web-app-note-pane,
	.web-app-workbench {
		display: none;
		position: relative;
		inset: auto;
		grid-area: 1 / 1;
		width: 100%;
		height: 100%;
		max-width: none;
		border: 0;
		box-shadow: none;
	}

	#app[data-mobile-pane="files"] .web-app-sidebar,
	#app[data-mobile-pane="files"] .web-app-sidebar.is-collapsed {
		display: flex;
		flex-direction: column;
	}

	#app[data-mobile-pane="files"] .web-app-file-list {
		flex: 1 1 auto;
		min-height: 0;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

	#app[data-mobile-pane="note"] .web-app-note-pane {
		display: flex;
		flex-direction: column;
	}

	#app[data-mobile-pane="chat"] .web-app-workbench,
	#app[data-mobile-pane="chat"] .web-app-workbench.is-collapsed {
		display: flex;
		flex-direction: column;
	}

	/* Desktop pane chrome has no role here. */
	.web-app-pane-toggle-sidebar,
	.web-app-pane-toggle-workbench,
	.web-app-workbench-toolbar,
	.web-app-resize-handle {
		display: none;
	}

	.web-app-panel-restore,
	.web-app-panel-restore.is-visible {
		display: none;
	}

	/* Bottom tab bar: kept deliberately slim — icons with whisper labels. */
	.web-app-tabbar {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 4px;
		flex: 0 0 auto;
		padding: 2px 10px calc(2px + env(safe-area-inset-bottom));
		border-top: 1px solid var(--web-app-border);
		background: var(--web-app-bg-alt);
	}

	.web-app-tabbar-button {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 1px;
		min-height: 42px;
		padding: 3px 0;
		border: 0;
		border-radius: 8px;
		background: transparent;
		color: var(--web-app-muted);
		font: inherit;
		font-size: 10px;
		line-height: 1.2;
		cursor: pointer;
		touch-action: manipulation;
	}

	.web-app-tabbar-button.is-active {
		color: var(--text-accent, var(--web-app-accent));
		background: var(--web-app-accent-soft);
	}

	.web-app-tabbar-button:focus-visible {
		outline: 2px solid var(--web-app-accent);
		outline-offset: -2px;
	}

	.web-app-tabbar-icon svg {
		display: block;
		width: 20px;
		height: 20px;
	}

	/* File explorer: roomy touch rows. */
	.web-app-sidebar {
		padding: 8px 10px;
		font-size: 15px;
	}

	.web-app-sidebar-toolbar {
		margin: -8px -10px 6px;
		padding: 6px 10px;
	}

	.web-app-new-note-button {
		width: auto;
		min-height: 36px;
		padding: 0 14px;
		border-radius: 8px;
	}

	.web-app-file,
	.web-app-folder-name {
		padding: 9px 8px;
	}

	.web-app-file-explorer-item {
		border-radius: 8px;
	}

	.web-app-folder-children {
		padding-left: 16px;
	}

	/* Note pane: path on top, actions in a swipeable row below it. */
	.web-app-note-header {
		flex-direction: column;
		align-items: stretch;
		gap: 6px;
		padding: 8px 12px;
	}

	.web-app-note-path {
		min-width: 0;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.web-app-note-actions {
		display: flex;
		width: 100%;
		flex-wrap: nowrap;
		justify-content: flex-start;
		gap: 8px;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.web-app-note-actions::-webkit-scrollbar {
		display: none;
	}

	.web-app-note-action {
		flex: 0 0 auto;
		min-height: 38px;
		padding: 6px 14px;
		border-radius: 8px;
	}

	.web-app-note-action-secondary {
		display: none;
	}

	.web-app-note-action-overflow {
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}

	.web-app-note-content {
		padding: 16px 16px 32px;
	}

	.web-app-note-editor-toolbar {
		display: none;
	}

	/* Editing on a phone: full-screen editor, no split preview (the
	   Preview action saves and switches to reading view instead). */
	.web-app-note-editor-workspace {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: minmax(0, 1fr);
	}

	.web-app-note-editor-shell[data-edit-layout]
		.web-app-note-editor-preview-pane,
	.web-app-note-editor-preview-pane {
		display: none;
	}

	.web-app-note-editor-shell[data-edit-layout] .web-app-note-editor-pane,
	.web-app-note-editor-pane {
		display: block;
		border-right: 0;
		border-bottom: 0;
	}

	.web-app-note-editor-pane .cm-gutters {
		display: none;
	}

	.web-app-note-editor-pane .cm-scroller {
		padding: 12px 0 28px;
		font-size: 16px;
	}

	.web-app-note-editor-pane .cm-content {
		padding: 0 14px;
	}

	/* 16px inputs keep iOS Safari from zooming the page on focus. */
	.web-app-workbench .chat-input-row textarea,
	.web-app-chat-modal .chat-input-row textarea,
	.web-app-palette-input,
	.web-settings input[type="text"],
	.web-settings input[type="password"],
	.web-settings input[type="number"],
	.web-settings select,
	.web-settings textarea {
		font-size: 16px;
	}

	/* Chat composer: the control deck below the input collapses behind a
	   gear toggle next to Send, so the conversation owns the screen. */
	.web-app-workbench
		.chat-input-buttons-container.is-controls-collapsed
		.chat-button-row,
	.web-app-chat-modal
		.chat-input-buttons-container.is-controls-collapsed
		.chat-button-row {
		display: none;
	}

	.web-app-workbench .chat-controls-send,
	.web-app-chat-modal .chat-controls-send {
		flex-direction: row;
		align-items: stretch;
		gap: 6px;
	}

	.web-app-workbench .chat-controls-send .chat-controls-collapse-toggle,
	.web-app-chat-modal .chat-controls-send .chat-controls-collapse-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}

	.web-app-workbench .chat-controls-send .chat-controls-collapse-toggle,
	.web-app-chat-modal .chat-controls-send .chat-controls-collapse-toggle {
		width: 36px;
		min-height: 42px;
		border-radius: 10px;
	}

	.web-app-workbench .chat-controls-collapse-toggle[aria-expanded="true"],
	.web-app-chat-modal .chat-controls-collapse-toggle[aria-expanded="true"] {
		border-color: var(--interactive-accent, var(--web-app-accent));
	}

	.web-app-workbench
		.chat-input-buttons-container:not(.is-controls-collapsed)::before,
	.web-app-chat-modal
		.chat-input-buttons-container:not(.is-controls-collapsed)::before {
		content: "";
		position: fixed;
		inset: 0;
		z-index: 10000;
		background: rgba(15, 23, 42, 0.38);
		backdrop-filter: blur(2px);
	}

	.web-app-workbench
		.chat-input-buttons-container:not(.is-controls-collapsed)
		.chat-button-row,
	.web-app-chat-modal
		.chat-input-buttons-container:not(.is-controls-collapsed)
		.chat-button-row {
		display: block;
	}

	.web-app-workbench
		.chat-input-buttons-container:not(.is-controls-collapsed)
		.chat-controls-combined,
	.web-app-chat-modal
		.chat-input-buttons-container:not(.is-controls-collapsed)
		.chat-controls-combined {
		position: fixed;
		right: 10px;
		bottom: calc(58px + env(safe-area-inset-bottom));
		left: 10px;
		z-index: 10001;
		display: block;
		width: auto;
		max-height: min(64dvh, 520px);
		padding: 14px;
		overflow-y: auto;
		border-radius: 16px 16px 0 0;
		background: var(--background-primary, var(--web-app-bg));
		box-shadow: 0 -18px 48px rgba(15, 23, 42, 0.28);
		overscroll-behavior: contain;
	}

	.web-app-workbench
		.chat-input-buttons-container:not(.is-controls-collapsed)
		.chat-controls-main,
	.web-app-chat-modal
		.chat-input-buttons-container:not(.is-controls-collapsed)
		.chat-controls-main {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
		align-items: stretch;
		width: 100%;
	}

	.web-app-workbench
		.chat-input-buttons-container:not(.is-controls-collapsed)
		.chat-composer-control-section,
	.web-app-chat-modal
		.chat-input-buttons-container:not(.is-controls-collapsed)
		.chat-composer-control-section {
		display: flex;
		min-width: 0;
		padding: 10px;
		border: 1px solid var(--background-modifier-border);
		border-radius: 12px;
		background: var(--background-secondary, var(--web-app-bg-alt));
	}

	.web-app-workbench
		.chat-input-buttons-container:not(.is-controls-collapsed)
		.chat-composer-status-section,
	.web-app-workbench
		.chat-input-buttons-container:not(.is-controls-collapsed)
		.chat-composer-model-section,
	.web-app-chat-modal
		.chat-input-buttons-container:not(.is-controls-collapsed)
		.chat-composer-status-section,
	.web-app-chat-modal
		.chat-input-buttons-container:not(.is-controls-collapsed)
		.chat-composer-model-section {
		grid-column: 1 / -1;
	}

	.web-app-workbench
		.chat-input-buttons-container:not(.is-controls-collapsed)
		.chat-composer-section-label,
	.web-app-chat-modal
		.chat-input-buttons-container:not(.is-controls-collapsed)
		.chat-composer-section-label {
		display: block;
	}

	.web-app-workbench
		.chat-input-buttons-container:not(.is-controls-collapsed)
		.chat-composer-section-body,
	.web-app-chat-modal
		.chat-input-buttons-container:not(.is-controls-collapsed)
		.chat-composer-section-body {
		display: flex;
		width: 100%;
		align-items: stretch;
		gap: 8px;
	}

	.web-app-workbench
		.chat-input-buttons-container:not(.is-controls-collapsed)
		.chat-composer-group-button,
	.web-app-workbench
		.chat-input-buttons-container:not(.is-controls-collapsed)
		.chat-tools-toggle,
	.web-app-chat-modal
		.chat-input-buttons-container:not(.is-controls-collapsed)
		.chat-composer-group-button,
	.web-app-chat-modal
		.chat-input-buttons-container:not(.is-controls-collapsed)
		.chat-tools-toggle {
		width: 100%;
		min-height: 42px;
		justify-content: flex-start;
		padding: 8px 10px;
	}

	.web-app-workbench
		.chat-input-buttons-container:not(.is-controls-collapsed)
		.chat-composer-tools-cluster,
	.web-app-workbench
		.chat-input-buttons-container:not(.is-controls-collapsed)
		.chat-composer-voice-cluster,
	.web-app-chat-modal
		.chat-input-buttons-container:not(.is-controls-collapsed)
		.chat-composer-tools-cluster,
	.web-app-chat-modal
		.chat-input-buttons-container:not(.is-controls-collapsed)
		.chat-composer-voice-cluster {
		width: 100%;
		padding: 0;
		border: 0;
		background: transparent;
	}

	.web-app-workbench
		.chat-input-buttons-container:not(.is-controls-collapsed)
		.chat-composer-model-button,
	.web-app-chat-modal
		.chat-input-buttons-container:not(.is-controls-collapsed)
		.chat-composer-model-button {
		max-width: none;
	}

	.web-app-workbench
		.chat-input-buttons-container:not(.is-controls-collapsed)
		.chat-composer-button-detail,
	.web-app-chat-modal
		.chat-input-buttons-container:not(.is-controls-collapsed)
		.chat-composer-button-detail {
		max-width: 100%;
	}

	/* Footer popups (tool list, advanced actions) become bottom sheets:
	   pinned above the tab bar, never taller than the viewport, and
	   scrollable inside. */
	.web-app-workbench .chat-tools-menu-panel,
	.web-app-chat-modal .chat-tools-menu-panel,
	.web-app-workbench .chat-command-menu-panel,
	.web-app-chat-modal .chat-command-menu-panel {
		position: fixed;
		left: 10px;
		right: 10px;
		top: auto;
		bottom: calc(58px + env(safe-area-inset-bottom));
		width: auto;
		min-width: 0;
		max-height: min(55dvh, 440px);
		overflow-y: auto;
		z-index: 10001;
		overscroll-behavior: contain;
	}

	/* Command palette as a near-full-screen sheet. */
	.web-app-palette-overlay {
		padding: max(8px, env(safe-area-inset-top)) 8px 8px;
	}

	.web-app-palette {
		max-height: calc(100dvh - 16px);
	}

	.web-app-palette-item {
		min-height: 44px;
	}

	.web-app-palette-item-title-line {
		flex-direction: column;
		align-items: flex-start;
		gap: 2px;
	}

	/* Menus (header ⋯, context menus) get finger-sized rows. */
	.web-context-menu {
		min-width: 200px;
	}

	.web-context-menu-item {
		min-height: 44px;
	}

	/* Modals take over the whole screen. */
	.web-app-chat-modal-overlay,
	.web-app-settings-modal-overlay,
	.web-shim-modal-overlay {
		padding: 0;
	}

	.web-app-chat-modal,
	.web-app-settings-modal,
	.web-shim-modal-overlay > .modal {
		box-sizing: border-box;
		width: 100vw;
		height: 100dvh;
		max-height: 100dvh;
		border-right: 0;
		border-left: 0;
		border-radius: 0;
		padding-bottom: env(safe-area-inset-bottom);
	}

	.web-app-share-modal-overlay {
		align-items: flex-end;
		padding: 0;
	}

	.web-app-share-modal {
		width: 100vw;
		max-height: calc(100dvh - 42px);
		border-right: 0;
		border-bottom: 0;
		border-left: 0;
		border-radius: 8px 8px 0 0;
		padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
	}

	.web-app-share-detail {
		grid-template-columns: minmax(0, 1fr);
		gap: 2px;
	}

	.web-app-share-actions {
		position: sticky;
		bottom: calc(-16px - env(safe-area-inset-bottom));
		margin: 0 -16px calc(-16px - env(safe-area-inset-bottom));
		padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
		background: var(--background-primary, var(--web-app-bg));
	}

	.web-app-share-button {
		flex: 1 1 130px;
		min-height: 42px;
	}
}

/* Touch devices at any width: keep primary controls finger-sized. */
@media (pointer: coarse) {
	.web-app-pane-toggle {
		width: 32px;
		height: 30px;
	}

	.web-app-note-action,
	.web-app-sync,
	.web-app-command-button,
	.web-app-settings-button,
	.web-app-push {
		min-height: 34px;
	}

	.web-app-file,
	.web-app-folder-name {
		padding-top: 7px;
		padding-bottom: 7px;
	}
}

.web-app-workbench .ai-assistant-view-tabs.is-compact {
	padding: 6px 38px 0 8px;
	max-height: none;
	overflow: visible;
}

.web-app-workbench .ai-assistant-view-tabs.is-compact .ai-assistant-view-tab {
	max-width: 92px;
	min-height: 32px;
	padding: 5px 7px;
	font-size: 12px;
}

.web-app-workbench
	.ai-assistant-view-tabs.is-compact
	.ai-assistant-view-tab-label-full {
	display: none;
}

.web-app-workbench
	.ai-assistant-view-tabs.is-compact
	.ai-assistant-view-tab-label-short {
	display: inline;
}

.web-app-workbench .ai-assistant-view-tab-more-menu {
	right: auto;
	left: 0;
	max-width: min(260px, calc(100vw - 24px));
}

.web-app-workbench .chat-modal-footer {
	gap: 7px;
	padding: 8px;
	border-top: 1px solid var(--web-app-border);
	background: var(--web-app-bg-alt);
}

/* Input row: textarea with the send button beside it. */
.web-app-workbench .chat-input-row {
	flex-direction: row;
	align-items: stretch;
	gap: 7px;
}

.web-app-workbench .chat-input-row textarea {
	min-height: 42px;
	border-radius: 10px;
}

.web-app-workbench .chat-controls-send {
	justify-content: flex-end;
	align-items: stretch;
}

.web-app-workbench .chat-controls-send button {
	width: 44px;
	min-height: 42px;
	border-radius: 10px;
}

/* Controls: stacked rows that wrap gracefully at panel width. */
.web-app-workbench .chat-controls-combined {
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas:
		"main"
		"trailing";
	align-items: stretch;
	gap: 6px;
	padding: 7px 8px;
}

.web-app-workbench .chat-controls-main,
.web-app-workbench .chat-controls-trailing {
	width: 100%;
	min-width: 0;
}

.web-app-workbench .chat-controls-main {
	flex-wrap: wrap;
	row-gap: 6px;
}

.web-app-workbench .chat-composer-actions {
	align-items: flex-start;
	min-width: 0;
}

.web-app-workbench .chat-controls-trailing {
	justify-content: flex-start;
	margin-left: 0;
	flex-wrap: wrap;
	row-gap: 6px;
}

/* Selectors and grouped composer controls share rows without widening panes. */
.web-app-workbench .chat-composer-model-button {
	flex: 1 1 170px;
	max-width: 100%;
	min-width: 0;
}

.web-app-workbench .chat-composer-tools-cluster,
.web-app-workbench .chat-composer-voice-cluster {
	max-width: 100%;
}

.web-app-workbench .chat-composer-button-detail {
	max-width: min(145px, 40vw);
}

.web-app-workbench .chat-model-selector-inline {
	flex: 1 1 170px;
	max-width: none;
	min-width: 0;
}

.web-app-workbench .chat-backend-selector-inline {
	flex: 1 1 130px;
	max-width: none;
	min-width: 0;
	margin-left: auto;
}

.web-app-workbench .chat-metrics-group {
	flex: 0 1 auto;
	margin-left: auto;
}

.web-app-workbench .chat-button-row button {
	min-width: 30px;
}

/* History: the results/preview split assumes a wide modal; stack it in
   the side panel so neither pane gets crushed. */
.web-app-workbench .chat-forest-shell {
	grid-template-columns: minmax(0, 1fr);
	grid-template-rows: minmax(200px, 1fr) minmax(180px, 0.9fr);
}

/* Model picker: stack list/detail panes in the side panel. */
.web-app-workbench .openrouter-picker-layout {
	grid-template-columns: minmax(0, 1fr);
	min-height: 0;
}

/* Friendly empty state while no conversation is loaded. */
.web-app-workbench .virtualized-chat-content:empty::before,
.web-app-chat-modal .virtualized-chat-content:empty::before {
	content: "✦\A\A Start a conversation\A Ask about your notes, or attach the open note for context.";
	display: block;
	margin: 16vh auto 0;
	max-width: 240px;
	white-space: pre-line;
	text-align: center;
	color: var(--web-app-muted);
	font-size: 13px;
	line-height: 1.55;
	animation: web-app-fade-in 0.25s ease;
}

@media (max-width: 640px) {
	#app[data-mobile-pane="files"]
		.web-app-workbench
		.virtualized-chat-content:empty::before,
	#app[data-mobile-pane="note"]
		.web-app-workbench
		.virtualized-chat-content:empty::before {
		content: none;
		display: none;
	}
}

.web-app-palette-overlay {
	position: fixed;
	inset: 0;
	z-index: 10002;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 12vh 16px 16px;
	background: rgba(0, 0, 0, 0.45);
}

.web-app-palette {
	display: flex;
	flex-direction: column;
	width: min(620px, 100%);
	max-height: min(520px, 76vh);
	border: 1px solid var(--web-app-border);
	border-radius: 8px;
	background: var(--background-primary, var(--web-app-bg));
	box-shadow: 0 22px 70px rgba(0, 0, 0, 0.5);
	overflow: hidden;
}

.web-app-palette-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 12px 8px;
	border-bottom: 1px solid var(--web-app-border);
}

.web-app-palette-title-group {
	min-width: 0;
}

.web-app-palette-title {
	color: var(--web-app-fg);
	font-size: 14px;
	font-weight: 600;
}

.web-app-palette-subtitle {
	margin-top: 2px;
	color: var(--text-muted, var(--web-app-muted));
	font-size: 12px;
}

.web-app-palette-shortcut {
	flex: 0 0 auto;
	padding: 4px 6px;
}

.web-app-palette-input {
	flex: 0 0 auto;
	padding: 12px 14px;
	border: none;
	border-bottom: 1px solid var(--web-app-border);
	background: transparent;
	color: var(--web-app-fg);
	font: inherit;
	font-size: 15px;
	outline: none;
}

.web-app-palette-input::placeholder {
	color: var(--web-app-muted);
}

.web-app-palette-results {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 6px;
}

.web-app-palette-group {
	padding: 9px 8px 4px;
	color: var(--web-app-muted-strong);
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
}

.web-app-palette-item {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 12px;
	padding: 7px 10px;
	border-radius: 5px;
	cursor: pointer;
	font-size: 13.5px;
	color: var(--web-app-fg);
}

.web-app-palette-item.is-selected {
	background: var(--web-app-accent-soft);
}

.web-app-palette-item.is-disabled {
	cursor: default;
	color: var(--web-app-disabled-fg);
	opacity: 1;
}

.web-app-palette-item-body {
	display: flex;
	min-width: 0;
	flex-direction: column;
	gap: 2px;
}

.web-app-palette-item-title-line {
	display: flex;
	min-width: 0;
	align-items: baseline;
	gap: 10px;
}

.web-app-palette-item-text {
	flex: 0 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.web-app-palette-item-hint {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	text-align: right;
	color: var(--web-app-muted);
	font-size: 12px;
}

.web-app-palette-item-description {
	color: var(--web-app-muted);
	font-size: 12px;
	white-space: normal;
}

.web-app-palette-item-shortcut {
	padding: 4px 5px;
}

.web-app-palette-item-action {
	color: var(--web-app-accent);
}

.web-app-palette-match {
	color: var(--web-app-accent);
	font-weight: 600;
}

.web-app-palette-empty {
	padding: 14px 12px;
	color: var(--web-app-muted);
	font-size: 13px;
	text-align: center;
}

.web-app-palette-footer {
	flex: 0 0 auto;
	padding: 7px 12px;
	border-top: 1px solid var(--web-app-border);
	color: var(--web-app-muted);
	font-size: 12px;
}

/* Mobile: keep compact tabs finger-sized while reserving text for the
   active tab and the overflow selector. */
@media (max-width: 640px) {
	.web-app-workbench .ai-assistant-view-tabs,
	.web-app-workbench .ai-assistant-view-tabs.is-compact {
		flex-wrap: nowrap;
		align-items: center;
		gap: 4px;
		padding: 6px 8px;
		max-height: none;
		overflow: visible;
	}

	.web-app-workbench .ai-assistant-view-tabs .ai-assistant-view-tab {
		flex: 0 0 auto;
		max-width: none;
		min-width: 38px;
		min-height: 36px;
		justify-content: center;
		padding: 4px 8px;
		border: 1px solid var(--web-app-border);
		border-radius: 7px;
	}

	.web-app-workbench
		.ai-assistant-view-tabs
		.ai-assistant-view-tab:not(.is-active):not(
			.ai-assistant-view-tab-more-button
		)
		.ai-assistant-view-tab-label {
		display: none;
	}

	.web-app-workbench
		.ai-assistant-view-tabs
		.ai-assistant-view-tab.is-active
		.ai-assistant-view-tab-label-full {
		display: inline;
	}

	.web-app-workbench
		.ai-assistant-view-tabs
		.ai-assistant-view-tab.is-active
		.ai-assistant-view-tab-label-short {
		display: none;
	}

	.web-app-workbench
		.ai-assistant-view-tab-more-button
		.ai-assistant-view-tab-label {
		display: inline;
		max-width: min(42vw, 150px);
	}

	.web-app-workbench .ai-assistant-view-tab-icon {
		margin: 0;
	}

	.web-app-workbench .ai-assistant-view-tab-more {
		flex: 0 0 auto;
		min-width: max-content;
	}

	.web-app-workbench .ai-assistant-view-tab-more-button {
		width: auto;
		min-width: 82px;
		max-width: min(48vw, 170px);
		padding-inline: 10px;
	}

	.web-app-workbench .ai-assistant-view-tab-more-button::before {
		content: none;
	}

	/* The More dropdown anchors to a stretched wrapper now; keep it on
	   screen at the right edge. */
	.web-app-workbench .ai-assistant-view-tab-more-menu {
		left: auto;
		right: 0;
		max-height: min(55dvh, 420px);
		overflow-y: auto;
	}
}
