/*
 * The suite shell: the suite's own neutral palette, the system UI face, one accent.
 * Tokens live in themes.css (light and dark); this file sets type, controls and the layout.
 * Global element rules are guarded with :where(:not(.pptxv ...)) so the PowerPoint viewer,
 * which renders into the light DOM, keeps its own styles.
 */
:root {
	--font-ui: 'Segoe UI Variable Text', 'Segoe UI', system-ui, Arial, sans-serif;
	--font-display: 'Segoe UI Variable Display', 'Segoe UI', system-ui, Arial, sans-serif;
	--font-mono: ui-monospace, 'Cascadia Mono', Consolas, Menlo, monospace;
	--radius: 4px;
	--radius-panel: 8px;
	--header-h: 52px;
	/* Motion: one easing, four durations (docs/pages-design.md). */
	--ease: cubic-bezier(0.22, 1, 0.36, 1);
	--ease-exit: cubic-bezier(0.65, 0, 0.35, 1);
	--press: 0.12s;
	--fast: 0.2s;
	--open: 0.32s;
	--enter: 0.65s;
	font-family: var(--font-ui);
	font-size: 13px;
	line-height: 1.5;
	font-synthesis: none;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	color: var(--text);
	background: var(--canvas);
}
* {
	box-sizing: border-box;
}
body {
	margin: 0;
	height: var(--app-h, 100dvh);
	overflow: hidden;
	background: var(--canvas);
	color: var(--text);
}
@media (prefers-reduced-motion: no-preference) {
	html.theme-anim body,
	html.theme-anim .suite-header,
	html.theme-anim .workspace-sidebar,
	html.theme-anim .tabs,
	html.theme-anim .statusbar,
	html.theme-anim .library-section,
	html.theme-anim .create-row,
	html.theme-anim .create-row button,
	html.theme-anim .assistant,
	html.theme-anim .document-commandbar,
	html.theme-anim .search,
	html.theme-anim th,
	html.theme-anim td {
		transition:
			background-color var(--open) var(--ease),
			color var(--open) var(--ease),
			border-color var(--open) var(--ease);
	}
	/* The home settles in once, on the first paint of the workspace. */
	body.entering .home > * {
		animation: rise var(--enter) var(--ease) both;
	}
	body.entering .home > :nth-child(2) {
		animation-delay: 0.08s;
	}
	body.entering .home > :nth-child(3) {
		animation-delay: 0.16s;
	}
	body.entering .home > :nth-child(4) {
		animation-delay: 0.24s;
	}
	body.entering .home > :nth-child(5) {
		animation-delay: 0.32s;
	}
	body.entering .create-row > button {
		animation: rise var(--enter) var(--ease) both;
		animation-delay: calc(0.2s + var(--i, 0) * 0.06s);
	}
	@keyframes rise {
		from {
			opacity: 0;
			transform: translateY(16px);
		}
		to {
			opacity: 1;
			transform: none;
		}
	}
}

/* Secondary labels: counts, kinds, states, column names. */
.hud,
.sort-label,
#file-count,
#save-state,
.statusbar,
.workspace-breadcrumb,
.nav-caption,
.local-label,
.search kbd,
.section-heading > span,
.launcher-heading span,
.account-topline,
.profile-active,
.file-name small,
.location-label,
.sidebar-footer small,
.workspace-switch small,
.app-tag,
.form-footer small {
	font-size: 11px;
	color: var(--muted);
}

/* Controls */
button:where(:not(.pptxv *, [class*='pptxv-'], [class*='pptxv-'] *)),
input:where(:not(.pptxv *, [class*='pptxv-'], [class*='pptxv-'] *)),
textarea:where(:not(.pptxv *, [class*='pptxv-'], [class*='pptxv-'] *)) {
	font: inherit;
	letter-spacing: inherit;
}
button:where(:not(.pptxv *, [class*='pptxv-'], [class*='pptxv-'] *)) {
	cursor: pointer;
	border: 1px solid transparent;
	border-radius: var(--radius);
	background: transparent;
	color: inherit;
	padding: 7px 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	transition:
		background-color var(--fast) var(--ease),
		border-color var(--fast) var(--ease),
		color var(--fast) var(--ease),
		transform var(--fast) var(--ease);
}
button:where(:not(.pptxv *, [class*='pptxv-'], [class*='pptxv-'] *)):hover {
	background: var(--hover);
}
@media (prefers-reduced-motion: no-preference) {
	button:where(:not(.pptxv *, [class*='pptxv-'], [class*='pptxv-'] *)):active {
		transform: scale(0.985);
		transition-duration: var(--press);
	}
}
@media (prefers-reduced-motion: no-preference) {
	button:where(:not(.pptxv *, [class*='pptxv-'], [class*='pptxv-'] *)):active {
		transform: scale(0.985);
		transition-duration: var(--press);
	}
}
@media (prefers-reduced-motion: no-preference) {
	button:where(:not(.pptxv *, [class*='pptxv-'], [class*='pptxv-'] *)):active {
		transform: scale(0.985);
		transition-duration: var(--press);
	}
}
button:where(:not(.pptxv *, [class*='pptxv-'], [class*='pptxv-'] *)):focus-visible,
a:focus-visible,
summary:focus-visible {
	outline: 2px solid var(--blue);
	outline-offset: 1px;
}
button:where(:not(.pptxv *, [class*='pptxv-'], [class*='pptxv-'] *)):disabled {
	opacity: 0.45;
	cursor: default;
}
input:where(:not(.pptxv *, [class*='pptxv-'], [class*='pptxv-'] *)),
textarea:where(:not(.pptxv *, [class*='pptxv-'], [class*='pptxv-'] *)) {
	border: 1px solid var(--line-strong);
	border-radius: var(--radius);
	padding: 8px 10px;
	background: var(--surface);
	color: var(--text);
}
input:where(:not(.pptxv *, [class*='pptxv-'], [class*='pptxv-'] *))::placeholder,
textarea:where(:not(.pptxv *, [class*='pptxv-'], [class*='pptxv-'] *))::placeholder {
	color: var(--faint);
}
input:where(:not(.pptxv *, [class*='pptxv-'], [class*='pptxv-'] *)):focus,
textarea:where(:not(.pptxv *, [class*='pptxv-'], [class*='pptxv-'] *)):focus {
	outline: 2px solid var(--blue);
	outline-offset: -1px;
	border-color: var(--blue);
}
/* Commands share one size and padding wherever they appear. */
.primary,
.outline,
.page-actions button,
.document-commandbar button,
.file-toolbar button,
.form-footer button,
.file-heading > button,
.start-change,
.install-app,
.update-app,
.embedded-file,
.storage-menu > button,
#dialog-content form > .primary,
#dialog-content form > button,
.disk-results-heading button,
.search-issue button,
.connected-folders button,
.photo-label,
#dialog-content > button {
	font-size: 12px;
	font-weight: 600;
	padding: 8px 14px;
	line-height: 1.2;
}
.primary {
	background: var(--blue);
	color: var(--accent-fg);
	border-color: var(--blue);
}
.primary:hover {
	background: var(--blue);
	color: var(--accent-fg);
	filter: brightness(0.92);
}
.primary:disabled {
	filter: grayscale(1);
}
.outline,
.page-actions button:not(.primary),
.document-commandbar button:not(.primary),
.form-footer button:not(.primary),
.embedded-file,
.storage-menu > button,
.connected-folders button,
#dialog-content form > button:not(.primary),
#dialog-content > button:not(.primary),
.disk-results-heading button,
.search-issue button {
	border-color: var(--line-strong);
}
.text-link {
	color: var(--accent-ink);
	padding: 4px 0;
	font-size: 12px;
	background: none;
}
.text-link:hover {
	text-decoration: underline;
	background: transparent;
}
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
}
[hidden] {
	display: none !important;
}

/* Type */
h1:where(:not(.pptxv *, [class*='pptxv-'], [class*='pptxv-'] *)),
h2:where(:not(.pptxv *, [class*='pptxv-'], [class*='pptxv-'] *)),
h3:where(:not(.pptxv *, [class*='pptxv-'], [class*='pptxv-'] *)) {
	font-family: var(--font-display);
	font-weight: 600;
	letter-spacing: -0.01em;
	color: var(--ink-strong);
	margin: 0;
}
h1:where(:not(.pptxv *, [class*='pptxv-'], [class*='pptxv-'] *)) {
	font-size: 30px;
	line-height: 1.1;
	letter-spacing: -0.02em;
}
h2:where(:not(.pptxv *, [class*='pptxv-'], [class*='pptxv-'] *)) {
	font-size: 17px;
	line-height: 1.25;
	margin-bottom: 12px;
}
h3:where(:not(.pptxv *, [class*='pptxv-'], [class*='pptxv-'] *)) {
	font-size: 15px;
	line-height: 1.3;
	margin-bottom: 6px;
}
p:where(:not(.pptxv *, [class*='pptxv-'], [class*='pptxv-'] *)) {
	line-height: 1.55;
	max-width: 62ch;
}

/* The app tile: a solid square in the product's colour with its letter. */
.app-badge {
	display: inline-grid;
	place-items: center;
	flex-shrink: 0;
	width: 24px;
	height: 24px;
	border-radius: 3px;
	font-family: var(--font-display);
	font-size: 13px;
	line-height: 1;
	font-weight: 700;
	background: var(--app);
	box-shadow: inset -5px 0 #ffffff25;
	color: #fff;
}

/* The ring motif: three faint rings that draw in once, the outer one turning slowly. It sits
   behind the start screen's centre, the home heading and the hub intro (and the docs heroes). */
.rings {
	position: absolute;
	z-index: -1;
	fill: none;
	stroke: var(--line);
	stroke-width: 0.22;
	overflow: visible;
	pointer-events: none;
}
.rings circle:nth-child(1) {
	stroke: var(--blue);
	opacity: 0.45;
	stroke-dasharray: 0.6 1.6;
}
.rings circle:nth-child(3) {
	stroke-dasharray: 0.4 1.2;
}
.rings--home {
	width: 460px;
	height: 460px;
	right: -40px;
	top: -170px;
	opacity: 0.8;
}
@media (prefers-reduced-motion: no-preference) {
	.rings circle {
		transform-origin: 50% 50%;
		transform: rotate(-90deg);
		animation: ring-draw 1.4s var(--ease) both;
	}
	.rings circle:nth-child(2) {
		animation-delay: 0.1s;
	}
	.rings circle:nth-child(3) {
		animation-delay: 0.2s;
	}
	/* The site's one ambient motion: the outer ring turns once every two minutes. */
	.rings circle:nth-child(1) {
		animation:
			ring-draw 1.4s var(--ease) both,
			ring-turn 120s linear 1.4s infinite;
	}
	@keyframes ring-draw {
		from {
			opacity: 0;
			transform: rotate(-120deg) scale(0.92);
		}
		to {
			transform: rotate(-90deg) scale(1);
		}
	}
	@keyframes ring-turn {
		from {
			transform: rotate(-90deg);
		}
		to {
			transform: rotate(270deg);
		}
	}
}
@media (max-width: 1100px) {
	.rings--home {
		display: none;
	}
}

/* Maturity tags, beside an app's name wherever it appears. */
.app-tag {
	display: inline-block;
	font-style: normal;
	font-size: 10px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.01em;
	padding: 2px 5px;
	border-radius: 3px;
	border: 1px solid color-mix(in srgb, var(--tone, var(--blue)) 40%, transparent);
	color: var(--tone, var(--accent-ink));
	margin-left: 7px;
	vertical-align: 2px;
	/* The accent as text: 4.5:1 on the rail, the canvas and the current item's selected fill. */
	--tone: var(--accent-ink);
}
.app-tag[data-tone='alpha'] {
	--tone: #b07a17;
}
.app-tag[data-tone='new'] {
	--tone: var(--ok);
}
:root[data-theme='dark'] .app-tag[data-tone='alpha'] {
	--tone: #e0a94a;
}
.app-badge--docs {
	--app: var(--muted);
	background: var(--sunken);
	box-shadow: none;
	border: 1px solid var(--line-strong);
	color: var(--text);
}
.app-badge--docs .ui-icon {
	width: 60%;
	height: 60%;
}

/* Header */
.suite-header {
	height: var(--header-h);
	background: var(--canvas);
	border-bottom: 1px solid var(--line);
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 0 16px 0 10px;
}
.suite-header > button {
	min-width: 34px;
	height: 34px;
	padding: 7px;
	color: var(--muted);
}
.suite-header > button:hover {
	color: var(--text);
}
.brand {
	display: flex;
	align-items: center;
	gap: 9px;
	min-width: 196px;
	color: var(--ink-strong);
	text-decoration: none;
	font-family: var(--font-display);
	font-size: 15px;
	font-weight: 500;
	letter-spacing: -0.01em;
}
.brand strong {
	font-weight: 700;
	margin-left: -5px;
}
.brand-symbol {
	width: 20px;
	height: 20px;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2px;
	padding: 3px;
	background: var(--blue);
	border-radius: 3px;
}
.brand-symbol i {
	background: #fff;
	border-radius: 1px;
}
.brand-symbol i:nth-child(2) {
	opacity: 0.45;
}
.brand-symbol i:nth-child(3) {
	opacity: 0.7;
}
.brand .app-badge {
	width: 22px;
	height: 22px;
	margin-right: 2px;
}
.search {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: auto;
	width: min(560px, 44vw);
	height: 34px;
	background: var(--sunken);
	border: 1px solid var(--control-line);
	border-radius: 6px;
	padding: 0 8px 0 10px;
	color: var(--muted);
	transition:
		background-color var(--fast),
		border-color var(--fast);
}
.search:focus-within {
	background: var(--surface);
	border-color: var(--blue);
	outline: 1px solid var(--blue);
	color: var(--text);
}
.search input {
	width: 100%;
	border: 0;
	background: transparent;
	padding: 4px 0;
	outline: 0;
	font-size: 13px;
	color: var(--text);
}
.search input:focus {
	outline: 0;
	border: 0;
}
.search > span:first-child {
	display: flex;
}
.search kbd {
	font-family: var(--font-mono);
	border: 1px solid var(--line-strong);
	border-radius: 3px;
	padding: 0 5px;
	font-size: 10px;
	line-height: 16px;
}
#assistant-toggle {
	padding: 7px 12px;
	gap: 7px;
	font-size: 13px;
	color: var(--accent-ink);
}
#assistant-toggle[aria-expanded='true'] {
	background: var(--selected);
	color: var(--accent-ink);
}
#mobile-search-toggle {
	display: none;
}
.suite-header .profile-button {
	padding: 0;
	margin-left: 2px;
	min-width: 0;
	border-radius: 50%;
}
.ui-icon {
	width: 18px;
	height: 18px;
	flex: none;
}

/* Layout */
.suite-layout {
	display: flex;
	height: calc(var(--app-h, 100dvh) - var(--header-h));
}
.workspace-sidebar {
	flex: none;
	width: 228px;
	background: var(--rail);
	display: flex;
	flex-direction: column;
	border-right: 1px solid var(--line);
	padding: 14px 10px 10px;
}
.workspace-switch {
	width: 100%;
	text-align: left;
	justify-content: start;
	padding: 8px 6px 8px 4px;
	gap: 10px;
	margin-bottom: 14px;
}
.workspace-emblem {
	width: 30px;
	height: 30px;
	display: grid;
	place-items: center;
	border: 1px solid var(--line);
	background: var(--surface);
	color: var(--accent-ink);
	border-radius: 8px;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 14px;
}
/* The emblem is a logo, not text: the button is named by the workspace it shows. */
.workspace-emblem::before {
	content: 'O';
}
.workspace-switch > span:nth-child(2) {
	flex: 1;
	min-width: 0;
}
.workspace-switch strong,
.workspace-switch small {
	display: block;
	white-space: nowrap;
	text-overflow: ellipsis;
	overflow: hidden;
}
.workspace-switch strong {
	font-size: 12.5px;
	font-weight: 600;
}
.workspace-switch small {
	margin-top: 2px;
	font-size: 9.5px;
}
.workspace-caret {
	/* The switcher caret is a glyph: muted text keeps it at 4.5:1 on the sidebar. */
	color: var(--muted);
}
.app-rail {
	width: 100%;
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1;
	overflow-y: auto;
}
.app-rail button,
.app-rail a {
	position: relative;
	display: inline-flex;
	align-items: center;
	flex-direction: row;
	justify-content: start;
	min-height: 34px;
	padding: 6px 10px;
	gap: 11px;
	border-radius: var(--radius);
	font-size: 13px;
	color: var(--muted);
	text-decoration: none;
	transition:
		background-color var(--fast),
		color var(--fast);
}
.app-rail button:hover,
.app-rail a:hover {
	color: var(--text);
	background: var(--hover);
}
.app-rail a .ui-icon {
	width: 17px;
	height: 17px;
}
.app-rail .app-tag {
	margin-left: auto;
	font-size: 9px;
}
.app-rail button .ui-icon {
	width: 17px;
	height: 17px;
}
.app-rail .app-badge {
	width: 20px;
	height: 20px;
	font-size: 11px;
}
.app-rail button[aria-current='true'] {
	background: var(--selected);
	color: var(--accent-ink);
	font-weight: 600;
}
.app-rail button[aria-current='true']:before {
	content: '';
	position: absolute;
	left: 0;
	top: 8px;
	bottom: 8px;
	width: 3px;
	border-radius: 2px;
	background: var(--blue);
}
.nav-caption {
	padding: 18px 10px 6px;
	font-size: 11px;
	font-weight: 600;
	color: var(--muted);
}
.app-rail > .nav-caption:first-child {
	padding-top: 2px;
}
.sidebar-footer {
	display: flex;
	gap: 9px;
	align-items: center;
	padding: 14px 4px 2px;
	border-top: 1px solid var(--line);
	margin-top: 12px;
}
.sidebar-footer strong,
.sidebar-footer small {
	display: block;
}
.sidebar-footer strong {
	font-size: 11.5px;
	font-weight: 500;
}
.sidebar-footer small {
	margin-top: 2px;
	font-size: 9.5px;
}
.sidebar-footer button {
	margin-left: auto;
	padding: 3px 6px;
	color: var(--muted);
}
.storage-dot {
	display: inline-block;
	width: 6px;
	height: 6px;
	background: var(--ok);
	border-radius: 50%;
	flex: none;
}
.suite-body {
	min-width: 0;
	flex: 1;
	display: flex;
	flex-direction: column;
}

/* A newer build is ready: the banner sits above the tabs until the user reloads. */
.update-banner {
	flex: none;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 14px;
	background: var(--selected);
	border-bottom: 1px solid var(--line);
	font-size: 12.5px;
}
.update-banner > span {
	flex: 1;
	min-width: 0;
}
.update-banner button {
	padding: 5px 10px;
	font-size: 12px;
}
.update-banner button:not(.primary) {
	color: var(--muted);
}
.account-version {
	margin: 0;
	padding: 0 18px 14px;
	font-size: 11px;
	color: var(--muted);
}

/* Tab strip and command bar: one row. In the office layout the bar sits at the right end of the
   tabs; in Simple view it wraps onto a line of its own (workspace-simple.css). */
.tab-row {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	flex: none;
	border-bottom: 1px solid var(--line);
	background: var(--canvas);
}

/* Tabs */
.tabs {
	display: flex;
	align-items: stretch;
	height: 38px;
	flex: 1 1 0;
	min-width: 0;
	overflow: auto;
	background: var(--canvas);
	padding: 4px 8px 0;
	gap: 2px;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
	scroll-padding-inline: 8px;
}
@media (max-width: 640px) {
	/* Tabs fade out at the right edge instead of being cut mid-letter. */
	.tabs {
		padding-right: 28px;
		mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
	}
}
.tabs::-webkit-scrollbar {
	display: none;
}
.tabs > button,
.file-tab > button {
	flex: none;
	height: 33px;
	white-space: nowrap;
	border-radius: var(--radius) var(--radius) 0 0;
	font-size: 12px;
	max-width: 240px;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var(--muted);
	border-color: transparent;
}
.tabs > button:hover,
.file-tab > button:hover {
	color: var(--text);
}
.tabs [aria-selected='true'] {
	background: var(--surface);
	color: var(--text);
	font-weight: 600;
	border: 1px solid var(--line);
	border-bottom: 2px solid var(--blue);
}
.tabs .app-badge {
	width: 16px;
	height: 16px;
	font-size: 9px;
}
/* A long file name truncates; the app badge before it never shrinks or clips. */
.file-tab > button:first-child {
	justify-content: flex-start;
	min-width: 0;
}
.file-tab .tab-name {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.file-tab {
	display: flex;
	flex: none;
}
/* The close button is at least a 24px target (WCAG 2.5.8) whatever width the font gives the glyph. */
.file-tab > button:last-child {
	min-width: 24px;
	padding: 4px 7px;
}

/* Work area */
.work-row {
	position: relative;
	isolation: isolate;
	display: flex;
	flex: 1;
	min-height: 0;
}
.work-main {
	flex: 1;
	min-width: 0;
	position: relative;
	overflow: hidden;
}
.editor-area {
	height: 100%;
	display: flex;
	flex-direction: column;
}
.document-commandbar {
	height: 40px;
	flex: none;
	display: flex;
	align-items: center;
	gap: 4px;
	border-bottom: 1px solid var(--line);
	background: var(--surface);
	padding: 0 8px;
	overflow: auto;
	white-space: nowrap;
}
/* The bar belongs to the open document: it is not shown on the start page, chat, cloud or Teams. */
body:not([data-view='editor']) .document-commandbar {
	display: none;
}
/* Office layout: the bar is the right end of the tab row, under the app's own title bar and
   ribbon. Its file commands move into the More menu. */
body[data-layout='office'] .document-commandbar {
	flex: none;
	height: auto;
	border-bottom: 0;
	background: transparent;
	padding: 0 6px;
	overflow: visible;
}
body[data-layout='office'] .document-commandbar [data-menu] {
	display: none;
}
body[data-layout='office'] #actions-more {
	display: inline-flex;
}
.document-commandbar button {
	font-size: 10.5px;
	padding: 6px 10px;
}
.document-commandbar button:not(.primary) {
	border-color: transparent;
}
.document-commandbar > span {
	margin-left: auto;
	margin-right: 10px;
}
#editors {
	position: relative;
	flex: 1;
	min-height: 0;
}
.document-host {
	position: absolute;
	inset: 0;
	min-width: 0;
	min-height: 0;
	background: var(--surface);
	color: var(--text);
}
/* The browser's own Print never prints the assistant's suggestions before they are applied. */
@media print {
	.document-host[data-preview] {
		display: none;
	}
}
.document-host > docx-editor,
.document-host > xlsx-editor {
	display: block;
	width: 100%;
	height: 100%;
}
/* The Visio viewer lays itself out as a flex column on :host; forcing block here would win over
   :host, collapse that column and let the canvas push the ribbon out of view. */
.document-host > visio-viewer {
	width: 100%;
	height: 100%;
}
.teams-host,
.teams-host > teams-app {
	display: block;
	height: 100%;
	width: 100%;
}
.statusbar {
	height: 25px;
	flex: none;
	border-top: 1px solid var(--line);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 14px;
	background: var(--canvas);
	font-size: 10px;
	gap: 20px;
}
.statusbar > span:first-child {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Assistant */
.assistant {
	width: 340px;
	flex: none;
	border-left: 1px solid var(--line);
	background: var(--surface);
	display: flex;
	flex-direction: column;
	min-height: 0;
}
.assistant > header {
	height: 46px;
	padding: 0 14px;
	border-bottom: 1px solid var(--line);
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.assistant h2 {
	margin: 0;
	font-size: 15px;
}
/* Dialogs */
dialog {
	border: 1px solid var(--line);
	border-radius: var(--radius-panel);
	box-shadow: 0 14px 60px #0003;
	padding: 0;
	width: min(520px, 92vw);
	max-height: 85dvh;
	background: var(--surface);
	color: var(--text);
}
dialog::backdrop {
	background: #0005;
}
dialog > header {
	padding: 16px 20px 14px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid var(--line);
}
dialog h2 {
	margin: 0;
	font-size: 18px;
}
#dialog-close {
	padding: 4px 8px;
	font-size: 18px;
	line-height: 1;
	color: var(--muted);
}
#dialog-content {
	padding: 20px;
	overflow: auto;
	max-height: 68dvh;
}
#dialog-content > p,
#dialog-content form > p {
	margin-top: 0;
	color: var(--muted);
}
#dialog-content label {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 16px;
	font-weight: 500;
}
#dialog-content input {
	width: 100%;
	font-weight: 400;
}
#dialog-content .context-option {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 10px;
	font-size: 13px;
	font-weight: 400;
	margin-bottom: 10px;
}
#dialog-content .context-option input {
	width: auto;
	accent-color: var(--blue);
}
.embedded-file {
	display: flex;
	width: 100%;
	margin: 8px 0;
	padding: 12px;
	justify-content: start;
	font-weight: 400;
	font-size: 13px;
}
.cloud-recovery-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 18px;
}
#onedrive-conflict-details summary {
	cursor: pointer;
	font-size: 13px;
}
.cloud-conflict-details {
	max-height: 220px;
	overflow: auto;
	font-size: 13px;
}
.cloud-conflict-details ul {
	margin: 4px 0 8px;
	padding-left: 18px;
}

/* Forced colours: selected, current and pressed states keep a system highlight. */
@media (forced-colors: active) {
	.app-rail button[aria-current='true'],
	.tabs [aria-selected='true'] {
		forced-color-adjust: none;
		border-color: Highlight;
		background: Highlight;
		color: HighlightText;
	}
	.app-rail button[aria-current='true']:before {
		background: Highlight;
	}
	.app-rail button[aria-current='true'] .app-tag {
		border-color: HighlightText;
		color: HighlightText;
	}
}

/*
 * The palette: the suite's neutral greys and white surfaces, with the accent (--blue) set at
 * runtime from the appearance settings. Dark mode keeps the same surfaces reversed.
 */
:root {
	--canvas: #f7f8fa;
	--surface: #fff;
	--sunken: #eceef2;
	--rail: #f0f2f5;
	--surface-alt: #fafafa;
	--ink: #242424;
	--ink-strong: #1b1b1b;
	--text: var(--ink);
	--muted: #616161;
	--faint: #8a8a8a;
	--subtle: #777;
	--line: #e3e6eb;
	--line-strong: #c6cbd3;
	/* Form control boundaries (search, fields): 3:1 on every surface. */
	--control-line: #8a8886;
	--hover: #ebebeb;
	--blue: #0f6cbd;
	--accent-ink: #0f6cbd;
	--accent-fg: #fff;
	--selected: #e7eef8;
	--ok: #16856a;
	--danger: #c4314b;
	color-scheme: light;
}
:root[data-theme='dark'] {
	--canvas: #181a1e;
	--surface: #202228;
	--sunken: #121418;
	--rail: #1c1e23;
	--surface-alt: #252830;
	--ink: #f0f0f0;
	--ink-strong: #fff;
	--muted: #b5b5b5;
	--faint: #8d8d8d;
	--subtle: #aaa;
	--line: #34383f;
	--line-strong: #4d535d;
	--control-line: #8a8886;
	--hover: #2e3138;
	--blue: #479ef5;
	--accent-ink: #7ab8ff;
	--accent-fg: #141414;
	--selected: #29384c;
	--ok: #4fc08a;
	--danger: #ff8585;
	color-scheme: dark;
}

/* Appearance settings */
fieldset:where(:not(.pptxv *, [class*='pptxv-'], [class*='pptxv-'] *)) {
	border: 0;
	margin: 0 0 18px;
	padding: 0;
}
legend:where(:not(.pptxv *, [class*='pptxv-'], [class*='pptxv-'] *)) {
	font-weight: 600;
	margin: 0 0 12px;
	padding: 0;
}
#theme-picker {
	padding: 7px;
}

/* The host skin is split by surface so account and editor styles stay independent. */
/* Popovers, the app launcher, the start chooser and the standalone product pages. */
.shell-popover {
	position: fixed;
	inset: calc(var(--header-h) + 8px) 12px auto auto;
	margin: 0;
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 0;
	background: var(--surface);
	color: var(--text);
	box-shadow:
		0 12px 45px #0003,
		0 2px 8px #0001;
	width: 360px;
	max-width: calc(100vw - 24px);
	max-height: calc(var(--app-h, 100dvh) - var(--header-h) - 24px);
	overflow: auto;
}
.shell-popover::backdrop {
	background: transparent;
}
.app-launcher {
	inset: calc(var(--header-h) + 8px) auto auto 10px;
	width: 348px;
	padding: 18px 18px 8px;
}
.launcher-heading {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 14px;
}
.launcher-heading h2 {
	margin: 0;
	font-size: 15px;
}
.launcher-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1px;
	background: var(--line);
	border: 1px solid var(--line);
	border-radius: var(--radius-panel);
	overflow: hidden;
}
.launcher-grid button,
.launcher-grid a {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	font-size: 12px;
	padding: 16px 8px 14px;
	border: 0;
	border-radius: 0;
	background: var(--surface);
	color: var(--text);
	text-decoration: none;
	transition: background-color var(--fast);
}
.launcher-grid button:hover,
.launcher-grid a:hover {
	background: var(--selected);
	transform: translateY(-2px);
}
.launcher-grid .app-badge {
	width: 32px;
	height: 32px;
	font-size: 16px;
}
.standalone-links {
	margin: 10px 0 0;
	padding: 12px 0 6px;
	border-top: 1px solid var(--line);
}
.standalone-links summary {
	cursor: pointer;
	color: var(--muted);
	font-size: 12px;
}
.standalone-links a {
	display: inline-block;
	padding: 10px 14px 0 0;
	color: var(--accent-ink);
	font-size: 12px;
}
.start-change {
	margin: 6px 0 8px;
	color: var(--accent-ink);
	border-color: transparent;
	padding-left: 0;
}
.install-app,
.check-updates {
	margin: 0 18px 6px;
	color: var(--accent-ink);
}
.check-updates {
	margin-bottom: 10px;
}
.update-app {
	margin-right: auto;
	border: 0;
	background: none;
	color: var(--accent-ink);
	cursor: pointer;
	padding: 0 8px;
}

/* The start screen: the workspace in the centre, the products on a ring, the docs beneath. */
.start-screen {
	position: fixed;
	inset: 0;
	z-index: 50;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 18px;
	padding: 24px;
	overflow: auto;
	background: var(--canvas);
	color: var(--text);
	--stage: min(600px, 78vmin);
	--radius: calc(var(--stage) * 0.4);
}
.start-tools {
	position: absolute;
	top: 14px;
	right: 14px;
	display: flex;
	gap: 4px;
}
.start-close,
.start-theme {
	width: 36px;
	height: 36px;
	padding: 0;
	font-size: 22px;
	color: var(--muted);
}
.start-theme .ui-icon {
	width: 18px;
	height: 18px;
}
.start-heading {
	text-align: center;
	max-width: 60ch;
}
.start-heading h1 {
	font-size: 28px;
}
.start-heading p {
	margin: 8px auto 0;
	color: var(--muted);
	font-size: 14px;
}
.start-stage {
	position: relative;
	width: var(--stage);
	height: var(--stage);
	flex: none;
}
.rings--start {
	inset: 0;
	width: 100%;
	height: 100%;
}
.start-card {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 12px;
	text-align: left;
	padding: 12px 14px;
	border: 1px solid var(--line);
	border-radius: var(--radius-panel);
	background: var(--surface);
	color: var(--text);
	box-shadow: 0 2px 8px #0001;
	transition:
		background-color var(--fast) var(--ease),
		border-color var(--fast) var(--ease),
		transform var(--fast) var(--ease),
		box-shadow var(--fast) var(--ease);
}
.start-card:hover,
.start-card:focus-visible {
	background: var(--surface);
	border-color: var(--blue);
	transform: translateY(-2px);
	box-shadow: 0 10px 28px #0002;
}
.start-card:active {
	transform: translateY(-1px) scale(0.99);
}
.start-card > span:not(.app-badge) {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}
.start-card strong {
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
}
.start-card small {
	font-size: 11px;
	color: var(--muted);
}
.start-card .app-tag {
	font-size: 9px;
	vertical-align: 1px;
}
.start-card .app-badge {
	width: 32px;
	height: 32px;
	font-size: 16px;
}
.start-center {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: calc(var(--stage) * 0.42);
	flex-direction: column;
	text-align: center;
	gap: 10px;
	padding: 20px 18px;
	border-color: var(--line-strong);
}
.start-center:hover,
.start-center:focus-visible {
	transform: translate(-50%, calc(-50% - 2px));
}
.start-center:active {
	transform: translate(-50%, calc(-50% - 1px)) scale(0.99);
}
.start-center > span:not(.app-badge) {
	align-items: center;
	text-align: center;
}
.start-center strong {
	font-family: var(--font-display);
	font-size: 17px;
	white-space: normal;
}
.start-center small {
	white-space: normal;
}
.start-center .app-badge {
	width: 44px;
	height: 44px;
	font-size: 22px;
}
.start-orbit {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%) rotate(var(--angle)) translate(var(--radius))
		rotate(calc(-1 * var(--angle)));
}
.start-docs {
	flex: none;
	min-width: min(420px, 100%);
}
/* Beneath the ring: the documentation and the sample files, side by side where they fit. */
.start-more {
	flex: none;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	max-width: 100%;
}
/* A fixed minimum: a percentage here is ignored while the row measures itself, and the row
   then comes out too narrow for both cards and wraps. */
.start-more .start-docs {
	min-width: 320px;
}
.start-docs .app-badge {
	width: 32px;
	height: 32px;
}

/* Entrance: the rings draw (styles.css), the centre settles, the products arrive one by one. */
@media (prefers-reduced-motion: no-preference) {
	.start-heading,
	.start-docs {
		animation: rise var(--enter) var(--ease) both;
	}
	.start-docs {
		animation-delay: 0.6s;
	}
	.start-center {
		animation: start-center var(--enter) var(--ease) 0.15s both;
	}
	@keyframes start-center {
		from {
			opacity: 0;
			transform: translate(-50%, -50%) scale(0.92);
		}
		to {
			opacity: 1;
			transform: translate(-50%, -50%) scale(1);
		}
	}
	.start-orbit > .start-card {
		animation: start-orbit var(--enter) var(--ease) both;
		animation-delay: calc(0.3s + var(--i) * 0.07s);
	}
	@keyframes start-orbit {
		from {
			opacity: 0;
			transform: translateY(10px) scale(0.94);
		}
		to {
			opacity: 1;
			transform: none;
		}
	}
}

/* Narrow or short screens: the same buttons as a list. */
@media (max-width: 860px), (max-height: 640px) {
	.start-screen {
		justify-content: flex-start;
		padding: 56px 16px 32px;
		gap: 14px;
	}
	.start-heading h1 {
		font-size: 22px;
	}
	.start-stage {
		width: min(100%, 420px);
		height: auto;
		display: grid;
		gap: 8px;
	}
	.rings--start {
		display: none;
	}
	.start-center,
	.start-orbit {
		position: static;
		transform: none;
		width: auto;
	}
	.start-center {
		flex-direction: row;
		text-align: left;
		padding: 12px 14px;
	}
	.start-center > span:not(.app-badge) {
		align-items: flex-start;
		text-align: left;
	}
	.start-center .app-badge {
		width: 32px;
		height: 32px;
		font-size: 16px;
	}
	.start-orbit > .start-card,
	.start-docs {
		width: 100%;
	}
	.start-docs {
		min-width: 0;
		width: min(100%, 420px);
	}
	.start-more {
		flex-direction: column;
		gap: 8px;
		width: min(100%, 420px);
	}
	.start-more .start-docs {
		min-width: 0;
		width: 100%;
	}
	.start-center:hover,
	.start-center:focus-visible {
		transform: translateY(-2px);
	}
	@media (prefers-reduced-motion: no-preference) {
		.start-center {
			animation: rise var(--enter) var(--ease) both;
		}
	}
}
/* Keep the unhydrated workspace hidden until boot.js shows the start screen or main.js finishes
   hydrating navigation, icons and local files. */
html[data-boot='pending'] body > :not(dialog, .start-screen) {
	visibility: hidden;
}
/* On slower connections, show a quiet spinner if boot takes longer than a brief beat. */
html[data-boot='pending'] body::after {
	content: '';
	position: fixed;
	top: 50%;
	left: 50%;
	width: 28px;
	height: 28px;
	margin: -14px 0 0 -14px;
	border: 2px solid var(--line);
	border-top-color: var(--blue);
	border-radius: 50%;
	opacity: 0;
	pointer-events: none;
	animation:
		boot-show 0.2s ease 0.25s forwards,
		boot-spin 0.8s linear 0.25s infinite;
}
@keyframes boot-show {
	to {
		opacity: 1;
	}
}
@keyframes boot-spin {
	to {
		transform: rotate(360deg);
	}
}
@media (prefers-reduced-motion: reduce) {
	html[data-boot='pending'] body::after {
		animation: boot-show 0.2s ease 0.25s forwards;
	}
}
/* The root asks what to open before the suite loads: show only the start screen until then. */
body[data-start] > :not(dialog, .start-screen) {
	visibility: hidden;
}
/* Standalone apps share the workspace without displaying the suite navigation rail. */
body[data-product] .workspace-sidebar {
	display: none;
}
body [hidden] {
	display: none !important;
}

/* Home: the heading, the create tiles and the document library. */
.home {
	position: relative;
	isolation: isolate;
	height: 100%;
	/* The ring motif reaches past the right edge; it must not add a horizontal scrollbar. */
	overflow: hidden auto;
	padding: 28px 40px 40px;
	max-width: 1360px;
	margin: auto;
}
.workspace-breadcrumb {
	display: flex;
	gap: 8px;
	margin-bottom: 22px;
}
.workspace-breadcrumb > span:first-child {
	color: var(--faint);
}
.page-heading {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 30px;
}
.page-heading h1 {
	font-size: 38px;
	letter-spacing: -0.025em;
	max-width: 14ch;
}
#welcome {
	margin: 10px 0 0;
	font-size: 14px;
	color: var(--muted);
}
.page-actions {
	display: flex;
	gap: 6px;
	flex: none;
}
.page-actions button {
	height: 36px;
	white-space: nowrap;
}
.page-actions .ui-icon {
	width: 15px;
	height: 15px;
}

/* Create tiles: one joined grid of cards. */
.create-section {
	margin-bottom: 34px;
}
.section-heading {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	margin-bottom: 12px;
}
.section-heading h2 {
	margin: 0;
	font-size: 15px;
}
.create-row {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1px;
	background: var(--line);
	border: 1px solid var(--line);
	border-radius: var(--radius-panel);
	overflow: hidden;
	box-shadow: 0 1px 2px #00000008;
}
.create-row button {
	display: grid;
	grid-template-columns: 36px 1fr auto;
	grid-template-rows: auto auto;
	align-items: start;
	text-align: left;
	justify-content: start;
	border: 0;
	border-radius: 0;
	background: var(--surface);
	padding: 20px 18px 22px;
	gap: 4px 14px;
	min-height: 104px;
	position: relative;
	transition:
		background-color var(--fast) var(--ease),
		transform var(--fast) var(--ease);
}
.create-row > button > .ui-icon {
	grid-row: span 2;
	width: 36px;
	height: 36px;
	padding: 8px;
	border-radius: 3px;
	background: var(--selected);
	color: var(--accent-ink);
}
.create-row button:hover {
	background: var(--selected);
	transform: translateY(-2px);
	z-index: 1;
}
.create-row button:active {
	transform: translateY(-1px) scale(0.99);
}
.create-row button:focus-visible {
	outline-offset: -2px;
	z-index: 1;
}
.create-row .app-badge {
	grid-row: span 2;
	width: 36px;
	height: 36px;
	font-size: 20px;
}
.create-row span:not(.app-badge) {
	font-family: var(--font-display);
	font-weight: 600;
	font-size: 14px;
	letter-spacing: -0.01em;
	line-height: 1.3;
	padding-top: 1px;
}
.create-row small {
	grid-column: 2 / 4;
	color: var(--muted);
	font-size: 12px;
	line-height: 1.45;
}
.create-row button::after {
	content: '';
	grid-column: 3;
	grid-row: 1;
	width: 22px;
	height: 22px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background:
		linear-gradient(var(--faint), var(--faint)) center / 9px 1px no-repeat,
		linear-gradient(var(--faint), var(--faint)) center / 1px 9px no-repeat;
	transition:
		border-color var(--fast),
		background-color var(--fast);
}
.create-row button:hover::after {
	border-color: var(--blue);
	background:
		linear-gradient(var(--blue), var(--blue)) center / 9px 1px no-repeat,
		linear-gradient(var(--blue), var(--blue)) center / 1px 9px no-repeat;
}

/* Library */
.library-section {
	border: 1px solid var(--line);
	border-radius: var(--radius-panel);
	background: var(--surface);
	overflow: hidden;
}
.file-heading {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 18px 20px 6px;
}
.file-heading h2 {
	margin: 0;
	font-size: 16px;
}
.file-heading > span {
	margin-right: auto;
}
.file-heading > button {
	padding: 6px 10px;
	border-color: transparent;
	color: var(--muted);
}
.file-heading > button:hover {
	color: var(--text);
}
.file-toolbar {
	display: flex;
	align-items: center;
	gap: 2px;
	padding: 8px 16px 10px;
	border-bottom: 1px solid var(--line);
	overflow-x: auto;
}
.file-toolbar button {
	padding: 6px 10px;
	border-color: transparent;
	color: var(--muted);
	white-space: nowrap;
}
.file-toolbar button:hover {
	color: var(--text);
}
.file-toolbar button[aria-pressed='true'] {
	background: var(--selected);
	color: var(--accent-ink);
	border-color: transparent;
}
.file-toolbar > .sort-label {
	margin-left: auto;
	white-space: nowrap;
}
.file-table {
	overflow: auto;
}
table:where(:not(.pptxv *, [class*='pptxv-'], [class*='pptxv-'] *)) {
	border-collapse: collapse;
	width: 100%;
	text-align: left;
	font-size: 12.5px;
}
th:where(:not(.pptxv *, [class*='pptxv-'], [class*='pptxv-'] *)) {
	font-size: 11px;
	font-weight: 400;
	color: var(--muted);
	height: 36px;
	border-bottom: 1px solid var(--line);
	padding: 0 12px;
	background: var(--surface-alt);
}
td:where(:not(.pptxv *, [class*='pptxv-'], [class*='pptxv-'] *)) {
	height: 56px;
	border-bottom: 1px solid var(--line);
	padding: 0 12px;
	color: var(--muted);
}
th:where(:not(.pptxv *, [class*='pptxv-'], [class*='pptxv-'] *)):first-child,
td:where(:not(.pptxv *, [class*='pptxv-'], [class*='pptxv-'] *)):first-child {
	padding-left: 20px;
}
th:where(:not(.pptxv *, [class*='pptxv-'], [class*='pptxv-'] *)):first-child {
	width: 46%;
}
td:where(:not(.pptxv *, [class*='pptxv-'], [class*='pptxv-'] *)):first-child {
	color: var(--text);
}
tr:where(:not(.pptxv *, [class*='pptxv-'], [class*='pptxv-'] *)):hover td {
	background: var(--surface-alt);
}
.file-name {
	padding: 0;
	gap: 12px;
	text-align: left;
	font-size: 13px;
	max-width: 100%;
}
.file-name:hover {
	background: transparent;
	text-decoration: underline;
	text-underline-offset: 3px;
}
.file-name span:last-child {
	overflow-wrap: anywhere;
}
.file-name strong {
	font-weight: 500;
	display: block;
}
.file-name small {
	display: block;
	margin-top: 3px;
	font-size: 10px;
}
.location-label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 11px;
}
.location-label .ui-icon {
	width: 14px;
	height: 14px;
}
.file-actions {
	white-space: nowrap;
	text-align: right;
}
.file-actions button {
	padding: 5px;
	color: var(--muted);
}
.file-actions button:hover {
	color: var(--text);
}
.file-actions .ui-icon {
	width: 16px;
	height: 16px;
}
.file-actions [aria-pressed='true'] {
	color: var(--accent-ink);
}
.file-actions [aria-pressed='true'] svg {
	fill: var(--selected);
}
.empty {
	text-align: center;
	padding: 48px 20px 44px;
	color: var(--muted);
}
.empty h3 {
	font-size: 15px;
}
.empty p {
	font-size: 12.5px;
	margin: 4px auto;
}
.empty .text-link {
	margin-top: 10px;
}
.empty-documents {
	position: relative;
	width: 90px;
	height: 74px;
	margin: 0 auto 22px;
}
.empty-page {
	display: block;
	position: absolute;
	border: 1px solid var(--line);
	border-radius: 5px;
	width: 46px;
	height: 58px;
	background: var(--surface);
}
.empty-page.back {
	top: 1px;
	left: 16px;
	transform: rotate(-10deg);
	background: var(--canvas);
}
.empty-page.front {
	top: 9px;
	left: 32px;
	transform: rotate(5deg);
	box-shadow: 0 3px 8px #00000008;
	padding: 14px 9px;
}
.empty-page i {
	display: block;
	height: 3px;
	background: var(--line);
	margin-bottom: 5px;
}
.empty-page i:first-child {
	background: var(--blue);
	opacity: 0.65;
	width: 15px;
}
.workspace-note {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--muted);
	font-size: 11.5px;
	margin: 14px 0 0;
}
#dialog .create-row {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Forced colours: selected, current and pressed states keep a system highlight. */
@media (forced-colors: active) {
	.file-toolbar button[aria-pressed='true'],
	.file-actions [aria-pressed='true'] {
		forced-color-adjust: none;
		border-color: Highlight;
		background: Highlight;
		color: HighlightText;
	}
}

/* The account manager, workspace switcher and storage menu. */
.avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--selected);
	color: var(--accent-ink);
	font-size: 11px;
	font-weight: 600;
	flex: none;
	overflow: hidden;
	border: 1px solid color-mix(in srgb, var(--blue) 15%, transparent);
}
.avatar[data-initials]::before {
	content: attr(data-initials);
}
.avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.avatar-large {
	width: 64px;
	height: 64px;
	font-size: 22px;
}
.suite-header .profile-button .avatar {
	width: 30px;
	height: 30px;
}
.account-topline {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 14px 18px;
	border-bottom: 1px solid var(--line);
}
.local-label {
	background: var(--canvas);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 3px 6px;
	font-size: 10px;
}
.account-identity {
	display: flex;
	gap: 16px;
	align-items: center;
	padding: 18px 18px 20px;
}
.account-identity > div {
	min-width: 0;
}
.account-identity h2 {
	font-size: 18px;
	margin: 0 0 3px;
	overflow-wrap: anywhere;
}
.account-identity p {
	margin: 0;
	font-size: 12px;
	color: var(--muted);
	overflow-wrap: anywhere;
}
.account-workspace {
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 12px 18px;
	background: var(--canvas);
	border-block: 1px solid var(--line);
}
.account-workspace strong {
	display: block;
	font-size: 12.5px;
	font-weight: 600;
}
.account-workspace small {
	display: block;
	color: var(--muted);
	font-size: 11px;
	margin-top: 2px;
}
.account-actions {
	padding: 6px;
	border-bottom: 1px solid var(--line);
}
.account-actions button {
	width: 100%;
	justify-content: start;
	padding: 9px 12px;
	gap: 12px;
	font-size: 12.5px;
}
.account-services {
	padding: 12px 14px;
	border-bottom: 1px solid var(--line);
}
.profile-switcher {
	padding: 12px 6px 6px;
}
.profile-switcher h3 {
	font-size: 11px;
	font-weight: 500;
	color: var(--muted);
	margin: 0 12px 8px;
}
.profile-switcher button {
	display: flex;
	width: 100%;
	justify-content: start;
	text-align: left;
	padding: 9px 12px;
	gap: 12px;
}
.profile-switcher button[aria-current='true'] {
	background: var(--selected);
}
.profile-switcher button strong {
	font-size: 12.5px;
	font-weight: 500;
	display: block;
}
.profile-switcher button small {
	display: block;
	font-size: 11px;
	margin-top: 2px;
	color: var(--muted);
}
.profile-active {
	margin-left: auto;
}
.profile-switcher [data-profile-add] {
	font-size: 12.5px;
	color: var(--accent-ink);
}
.account-feedback {
	color: var(--danger);
	padding: 10px 18px;
	font-size: 12px;
}
.account-footnote {
	font-size: 11px;
	color: var(--muted);
	padding: 12px 18px;
	margin: 0;
	border-top: 1px solid var(--line);
	background: var(--canvas);
}
.workspace-menu {
	inset: calc(var(--header-h) + 56px) auto auto 10px;
}
.storage-menu {
	inset: auto auto 36px 10px;
	padding: 16px;
}
.workspace-menu-heading {
	padding: 18px 18px 0;
}
.workspace-menu h2,
.storage-menu h2 {
	margin: 0 0 6px;
	font-size: 16px;
}
.workspace-menu p,
.storage-menu p {
	color: var(--muted);
	font-size: 12px;
	margin: 0 0 12px;
}
.storage-menu > button {
	margin: 0 6px 6px 0;
}
.storage-note {
	margin-top: 10px;
}
.connected-folders {
	margin-top: 12px;
}
.connected-folders > div {
	padding: 12px 0;
	border-top: 1px solid var(--line);
}
.connected-folders strong,
.connected-folders small {
	display: block;
	overflow-wrap: anywhere;
}
.connected-folders small {
	color: var(--muted);
	margin: 4px 0 8px;
}
.connected-folders button {
	margin-right: 4px;
	padding: 5px 9px;
}

/* Forced colours: selected, current and pressed states keep a system highlight. */
@media (forced-colors: active) {
	.profile-switcher button[aria-current='true'] {
		forced-color-adjust: none;
		border-color: Highlight;
		background: Highlight;
		color: HighlightText;
	}
}

/* Narrow layouts: the sidebar collapses to tiles, the search moves under the header. */
@media (max-width: 1100px) {
	.workspace-sidebar {
		width: 196px;
	}
	.home {
		padding: 24px;
	}
	.brand {
		min-width: 170px;
	}
	.create-row {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.page-heading h1 {
		font-size: 32px;
	}
	.section-heading > span {
		display: none;
	}
	.assistant {
		width: 300px;
	}
	.document-commandbar > span {
		display: none;
	}
}
@media (max-width: 700px) {
	:root {
		--header-h: 52px;
	}
	.suite-header {
		padding: 0 10px 0 6px;
		gap: 4px;
	}
	.brand {
		min-width: 0;
		font-size: 14px;
		gap: 7px;
	}
	.brand-symbol {
		width: 18px;
		height: 18px;
	}
	.search {
		display: none;
	}
	#mobile-search-toggle {
		display: inline-flex;
		margin-left: auto;
	}
	#assistant-toggle {
		padding: 7px;
	}
	#assistant-toggle span {
		display: none;
	}
	.suite-header #profile-toggle {
		display: inline-flex;
		flex: none;
	}
	.suite-header > button {
		min-width: 32px;
	}
	.workspace-sidebar {
		width: 56px;
		padding: 10px 4px;
	}
	.workspace-switch,
	.sidebar-footer,
	.nav-caption {
		display: none;
	}
	.app-rail button,
	.app-rail a {
		flex-direction: column;
		gap: 4px;
		padding: 8px 0;
		min-height: 50px;
		font-size: 8.5px;
		text-align: center;
	}
	.app-rail [data-sites] {
		display: none;
	}
	.app-rail button[aria-current='true']:before {
		top: 10px;
		bottom: 10px;
	}
	.app-rail .app-badge {
		width: 20px;
		height: 20px;
	}
	.home {
		padding: 20px 14px;
	}
	.workspace-breadcrumb {
		margin-bottom: 16px;
		gap: 6px;
	}
	.page-heading {
		gap: 8px;
		margin-bottom: 24px;
	}
	h1,
	.page-heading h1 {
		font-size: 26px;
	}
	.app-rail .app-tag {
		display: none;
	}
	#welcome {
		font-size: 12px;
	}
	.page-actions button {
		padding: 7px 9px;
		font-size: 10px;
	}
	.page-actions .ui-icon {
		display: none;
	}
	.section-heading h2 {
		font-size: 14px;
	}
	.create-section {
		margin-bottom: 26px;
	}
	.create-row button {
		padding: 14px 10px 16px;
		grid-template-columns: 26px 1fr auto;
		gap: 3px 9px;
		min-height: 80px;
	}
	.create-row .app-badge,
	.create-row > button > .ui-icon {
		width: 26px;
		height: 26px;
		font-size: 13px;
	}
	.create-row > button > .ui-icon {
		padding: 6px;
	}
	.create-row span:not(.app-badge) {
		font-size: 12px;
	}
	.create-row small {
		font-size: 10.5px;
	}
	.create-row button::after {
		display: none;
	}
	.file-heading {
		padding: 16px 12px 4px;
	}
	.file-heading h2 {
		font-size: 14px;
	}
	.file-heading > span {
		display: none;
	}
	.file-toolbar {
		padding: 8px 8px 10px;
	}
	.file-toolbar button {
		padding: 6px 8px;
		font-size: 10px;
	}
	.sort-label {
		display: none;
	}
	th:first-child,
	td:first-child {
		padding-left: 12px;
	}
	th,
	td {
		padding: 0 6px;
	}
	th:nth-child(2),
	td:nth-child(2),
	th:nth-child(3),
	td:nth-child(3),
	th:nth-child(4),
	td:nth-child(4) {
		display: none;
	}
	.file-name {
		font-size: 12px;
		gap: 8px;
	}
	.file-actions button {
		padding: 4px;
	}
	.file-actions button[data-download] {
		display: none;
	}
	.empty {
		padding: 34px 14px;
	}
	.empty h3 {
		font-size: 13.5px;
	}
	.empty p {
		font-size: 11.5px;
	}
	.workspace-note {
		font-size: 10.5px;
		align-items: baseline;
	}
	.statusbar {
		padding: 0 8px;
	}
	.statusbar > span:last-child {
		display: none;
	}
	.assistant {
		position: absolute;
		inset: 0;
		width: auto;
		z-index: 10;
		box-shadow: -5px 0 20px #0002;
	}
	.tabs {
		padding: 4px 3px 0;
	}
	.tabs > button {
		padding: 6px 8px;
	}
	.file-tab > button {
		max-width: 185px;
	}
	.shell-popover {
		inset: calc(var(--header-h) + 6px) 8px auto auto;
		max-width: calc(100vw - 16px);
	}
	.app-launcher {
		inset: calc(var(--header-h) + 6px) auto auto 8px;
	}
	.search-expanded .suite-header {
		height: 96px;
		flex-wrap: wrap;
		padding-bottom: 8px;
	}
	.search-expanded .search {
		display: flex;
		order: 10;
		width: 100%;
		flex-basis: 100%;
		height: 32px;
		margin: 0 4px;
	}
	.search-expanded .suite-layout {
		height: calc(var(--app-h, 100dvh) - 96px);
	}
	.search-expanded .shell-popover {
		top: 104px;
		max-height: calc(var(--app-h, 100dvh) - 120px);
	}
}
@media (prefers-reduced-motion: no-preference) {
	.shell-popover:popover-open,
	.workspace-context-menu[open] {
		animation: panel-in var(--open) var(--ease);
	}
	dialog[open]:not(.workspace-context-menu) {
		animation: dialog-in var(--open) var(--ease);
	}
	dialog[open]::backdrop {
		animation: fade-in var(--open) var(--ease);
	}
	@keyframes panel-in {
		from {
			opacity: 0;
			transform: translateY(-6px) scale(0.98);
		}
		to {
			opacity: 1;
			transform: none;
		}
	}
	@keyframes dialog-in {
		from {
			opacity: 0;
			transform: scale(0.98);
		}
		to {
			opacity: 1;
			transform: none;
		}
	}
	@keyframes fade-in {
		from {
			opacity: 0;
		}
		to {
			opacity: 1;
		}
	}
}

/* The profile editor and attachment previews. */
dialog:has(.profile-form) {
	width: min(600px, 94vw);
}
dialog:has(.profile-form) #dialog-content {
	padding: 0;
	max-height: calc(85dvh - 62px);
}
.profile-form {
	padding: 0 22px;
}
.profile-form-identity {
	display: flex;
	align-items: center;
	gap: 22px;
	padding: 22px 0;
	border-bottom: 1px solid var(--line);
}
#dialog-content .photo-label {
	display: inline-flex;
	padding: 7px 12px;
	margin: 0;
	border: 1px solid var(--line-strong);
	border-radius: var(--radius);
	cursor: pointer;
	font-weight: 500;
}
.photo-label:hover {
	background: var(--hover);
}
.photo-label:has(+ input:focus-visible) {
	outline: 2px solid var(--blue);
}
.photo-help {
	margin: 8px 0 2px;
	color: var(--muted);
	font-size: 11px;
}
.profile-fields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 18px;
	padding-top: 22px;
}
#dialog-content .profile-fields label {
	margin: 0;
	gap: 7px;
	font-size: 12px;
	font-weight: 500;
	min-width: 0;
}
.profile-fields input {
	min-width: 0;
	width: 100%;
	height: 36px;
	font-weight: 400;
}
.profile-fields small {
	font-size: 11px;
	font-weight: 400;
	color: var(--muted);
}
.profile-privacy {
	margin: 20px 0 12px;
	font-size: 11.5px;
	color: var(--muted);
}
.form-error {
	color: var(--danger);
	font-size: 12px;
}
.form-error:empty {
	display: none;
}
.form-footer {
	position: sticky;
	bottom: 0;
	display: flex;
	justify-content: end;
	gap: 6px;
	padding: 14px 0;
	background: var(--surface);
	border-top: 1px solid var(--line);
}
.attachment-preview img,
.attachment-preview video {
	max-width: 100%;
	max-height: 45dvh;
	display: block;
	margin: 12px auto;
}
.attachment-preview audio {
	max-width: 100%;
	display: block;
	margin: 12px 0;
}
@media (max-width: 700px) {
	.profile-form {
		padding: 0 16px;
	}
	.profile-fields {
		grid-template-columns: 1fr;
		gap: 16px;
		padding-top: 18px;
	}
	.profile-form-identity {
		padding: 18px 0;
		gap: 16px;
	}
	.profile-fields input {
		font-size: 16px;
	}
	.profile-form .form-footer button {
		min-height: 40px;
	}
}

/* File context menus, disk search results and file locations. */
.workspace-context-menu {
	position: fixed;
	inset: auto;
	margin: 0;
	padding: 4px;
	width: 240px;
	max-width: calc(100vw - 16px);
	background: var(--surface);
	color: var(--text);
	border: 1px solid var(--line);
	border-radius: 7px;
	box-shadow: 0 6px 24px #0003;
}
.workspace-context-menu button {
	display: flex;
	justify-content: start;
	width: 100%;
	min-height: 34px;
	text-align: left;
	font-size: 12.5px;
}
.file-undo {
	color: var(--accent-ink);
	margin-left: 12px;
}
.file-location {
	overflow-wrap: anywhere;
	font-family: var(--font-mono);
	font-size: 12px;
	padding: 10px 12px;
	background: var(--sunken);
	border-radius: var(--radius);
}
#disk-search {
	margin-bottom: 24px;
	padding: 16px 20px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-panel);
}
.disk-results-heading {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}
.disk-results-heading h3 {
	margin: 0 auto 0 0;
}
.disk-results-heading span,
.search-progress,
.search-issue {
	font-size: 12px;
	color: var(--muted);
}
.disk-results-heading button,
.search-issue button {
	padding: 5px 9px;
}
#disk-search ul {
	list-style: none;
	margin: 10px 0 0;
	padding: 0;
	max-height: 320px;
	overflow: auto;
}
#disk-search li {
	display: flex;
	align-items: center;
	border-top: 1px solid var(--line);
}
#disk-search li > button:first-child {
	display: block;
	text-align: left;
	flex: 1;
	min-width: 0;
	padding: 10px 8px;
}
#disk-search strong,
#disk-search small {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
#disk-search strong {
	font-weight: 500;
}
#disk-search small {
	color: var(--muted);
	font-size: 11px;
	margin-top: 3px;
}
#disk-search li > button:last-child {
	font-size: 11px;
	color: var(--muted);
}
@media (max-width: 700px) {
	.workspace-menu,
	.storage-menu {
		inset: calc(var(--header-h) + 8px) 10px auto;
	}
	.workspace-context-menu button {
		min-height: 42px;
	}
	.file-heading {
		flex-wrap: wrap;
	}
}

/* OneDrive (cloud) view: the shared browser element inherits the suite's --office-* tokens. */
.cloud-view {
	height: 100%;
	overflow: auto;
	padding: 24px 28px 32px;
	background: var(--canvas);
	box-sizing: border-box;
}
.cloud-view[hidden] {
	display: none;
}
.cloud-view-head h1 {
	margin: 0 0 6px;
	font-size: 22px;
}
.cloud-view-head p {
	margin: 0 0 18px;
	color: var(--muted);
	max-width: 72ch;
}
.cloud-view office-ui-cloud-files {
	max-width: 1040px;
	min-height: 420px;
	padding: 12px;
	border: 1px solid var(--line);
	border-radius: var(--radius-panel);
	background: var(--surface);
}
@media (max-width: 640px) {
	.cloud-view {
		padding: 16px;
	}
	.cloud-view office-ui-cloud-files {
		padding: 8px;
	}
}

/* Phone behaviour of the shell: the actions bar folds into a More menu, the chrome folds away in
   landscape and touch targets reach 44px. apps/office-suite/src/shell.js sets the data attributes
   and --app-h (the visible viewport height, which tracks the address bar and keyboard). */
#actions-more,
#chrome-toggle {
	display: none;
}
#actions-more {
	margin-left: auto;
	min-width: 32px;
}
.actions-menu {
	width: auto;
	min-width: 180px;
	padding: 4px;
}
.actions-menu:popover-open {
	display: flex;
	flex-direction: column;
}
.actions-menu button {
	justify-content: flex-start;
	width: 100%;
	padding: 9px 12px;
	font-size: 13px;
	white-space: nowrap;
}

@media (max-width: 640px) {
	.document-commandbar [data-menu],
	.document-commandbar > span {
		display: none;
	}
	#actions-more {
		display: inline-flex;
	}
	.document-commandbar {
		overflow: visible;
	}
	/* A phone gives the bar its own full-width line in both layouts (the office and Simple
	   rules are less specific than this). */
	html body[data-layout] .document-commandbar {
		flex: 1 0 100%;
		border-top: 1px solid var(--line);
		border-bottom: 0;
		background: var(--surface);
	}
}

/* A single open document needs no tab strip on a phone; the brand returns home. */
body[data-hide-tabs='true'] .tabs {
	display: none;
}

/* Phone landscape: only the editor, plus a toggle that brings the chrome back. */
body[data-collapsible='true'] #chrome-toggle {
	display: inline-flex;
	position: fixed;
	right: 4px;
	top: 8px;
	z-index: 30;
	width: 32px;
	height: 32px;
	min-width: 0;
	padding: 0;
	border-radius: 50%;
	border: 1px solid var(--line);
	background: var(--surface, #fff);
	color: var(--text, inherit);
	box-shadow: 0 2px 8px #0003;
}
body[data-collapsible='true'] #chrome-toggle[aria-expanded='true'] .ui-icon {
	transform: rotate(180deg);
}
body[data-chrome='collapsed'] .suite-header,
body[data-chrome='collapsed'] .tabs,
body[data-chrome='collapsed'] .document-commandbar,
body[data-chrome='collapsed'] .workspace-sidebar,
body[data-chrome='collapsed'] .statusbar {
	display: none;
}
body[data-chrome='collapsed'] .suite-layout {
	height: var(--app-h, 100dvh);
}
/* The toggle owns a slim column beside the editor, so it never covers an editor control. */
body[data-collapsible='true'][data-chrome='collapsed'] .suite-layout {
	margin-right: 52px;
}

@media (pointer: coarse) {
	.brand,
	.suite-header > button,
	.document-commandbar button,
	.tabs > button,
	.file-tab > button,
	.actions-menu button {
		min-height: 44px;
	}
	.suite-header > button,
	.document-commandbar button,
	.file-tab > button:last-child {
		min-width: 44px;
	}
	.document-commandbar {
		height: 52px;
	}
	.tabs {
		height: 48px;
	}
	.tabs > button,
	.file-tab > button {
		height: 44px;
	}
	body[data-collapsible='true'] #chrome-toggle {
		width: 44px;
		height: 44px;
	}
}

/* Narrow screens: the app rail is an off-canvas drawer opened by the title bar's grid button. */
.drawer-scrim {
	display: none;
}
@media (max-width: 640px) {
	body[data-drawer='true']:not([data-product]) .workspace-sidebar {
		position: fixed;
		inset: 0 auto 0 0;
		z-index: 50;
		width: min(280px, 85vw);
		padding: 18px 12px 12px;
		transform: translateX(-100%);
		visibility: hidden;
		box-shadow: 4px 0 24px #0004;
	}
	body[data-drawer='true']:not([data-product]) .workspace-switch,
	body[data-drawer='true']:not([data-product]) .sidebar-footer {
		display: flex;
	}
	body[data-drawer='true']:not([data-product]) .nav-caption {
		display: block;
	}
	body[data-drawer='true']:not([data-product]) .app-rail button,
	body[data-drawer='true']:not([data-product]) .app-rail a {
		flex-direction: row;
		justify-content: flex-start;
		text-align: left;
		min-height: 44px;
		padding: 8px 12px;
		gap: 13px;
		font-size: 13px;
	}
	body[data-drawer='true']:not([data-product]) .app-rail .app-badge {
		width: 20px;
		height: 23px;
		font-size: 13px;
	}
	body[data-drawer='true']:not([data-product]) .app-rail button[aria-current='true']:before {
		height: 18px;
	}
	body[data-drawer-open='true'][data-drawer='true']:not([data-product]) .workspace-sidebar {
		transform: none;
		visibility: visible;
	}
	body[data-drawer-open='true'] .drawer-scrim {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 40;
		background: #0006;
	}
	body[data-chrome='collapsed'] .workspace-sidebar {
		display: flex;
	}
}
@media (max-width: 640px) and (prefers-reduced-motion: no-preference) {
	/* Animate only once the first layout is applied, so the drawer never slides in on load. */
	body[data-shell-ready]:not([data-product])[data-drawer='true']:not([data-product])
		.workspace-sidebar {
		transition:
			transform 0.18s ease-out,
			visibility 0.18s;
	}
}

/*
 * Chat: the chat page, the assistant pane and the ask bar on the home page. Same palette and
 * controls as the rest of the shell; the thread is centred and capped for reading.
 */

/* The chat page: history on the left, the conversation centred on the right. */
.chat-view {
	display: flex;
	height: 100%;
	min-height: 0;
	background: var(--canvas);
}
.chat-view[hidden] {
	display: none;
}
.chat-history {
	width: 260px;
	flex: none;
	display: flex;
	flex-direction: column;
	border-right: 1px solid var(--line);
	background: var(--surface);
	min-height: 0;
}
.chat-history-top {
	padding: 14px 12px 8px;
	display: grid;
	gap: 10px;
}
.chat-new {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 600;
	padding: 8px 12px;
}
.chat-search {
	display: flex;
	align-items: center;
	gap: 6px;
	border: 1px solid var(--control-line);
	border-radius: var(--radius);
	padding: 0 8px;
	background: var(--canvas);
	color: var(--muted);
}
.chat-search:focus-within {
	outline: 2px solid var(--blue);
	outline-offset: 1px;
}
.chat-search input {
	border: 0;
	background: none;
	padding: 7px 0;
	width: 100%;
	font-size: 12px;
	outline: none;
}
.chat-list {
	overflow: auto;
	flex: 1;
	padding: 0 8px 12px;
}
.chat-list .nav-caption {
	display: block;
	padding: 14px 8px 4px;
}
.chat-list-item {
	display: flex;
	align-items: center;
	border-radius: var(--radius);
	position: relative;
}
.chat-list-item:hover,
.chat-list-item[aria-current='true'] {
	background: var(--selected);
}
.chat-list-item > button {
	display: block;
	flex: 1;
	min-width: 0;
	text-align: left;
	border: 0;
	background: none;
	padding: 7px 8px;
	font-size: 13px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var(--text);
}
.chat-list-item[aria-current='true'] > button {
	font-weight: 600;
	color: var(--accent-ink);
}
.chat-item-actions {
	display: none;
	padding-right: 4px;
}
.chat-list-item:hover .chat-item-actions,
.chat-list-item:focus-within .chat-item-actions {
	display: flex;
}
.chat-item-actions button,
.chat-msg-actions button,
.assistant-actions button,
.chat-history-toggle {
	border: 0;
	background: none;
	padding: 4px;
	border-radius: var(--radius);
	color: var(--muted);
	display: inline-flex;
}
.chat-item-actions button:hover,
.chat-msg-actions button:hover,
.assistant-actions button:hover,
.chat-history-toggle:hover {
	background: var(--hover);
	color: var(--text);
}
.chat-item-actions .ui-icon,
.chat-msg-actions .ui-icon {
	width: 15px;
	height: 15px;
}
.chat-list-empty {
	color: var(--muted);
	font-size: 12px;
	padding: 16px 8px;
}
.chat-main {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
}
.chat-header {
	height: 46px;
	flex: none;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 0 20px;
	border-bottom: 1px solid var(--line);
	background: var(--surface);
}
.chat-header h2 {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}
.chat-history-toggle {
	display: none;
}
.chat-page-chat {
	flex: 1;
	min-height: 0;
}

/* One chat: thread above, composer below; both share the reading width. */
.chat {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: 0;
	--chat-width: 780px;
}
.chat-thread {
	flex: 1;
	overflow: hidden auto;
	padding: 24px max(20px, calc((100% - var(--chat-width)) / 2)) 12px;
}
.chat[data-empty] .chat-thread {
	display: flex;
	flex-direction: column;
}
/* Bottom-aligned while it fits, scrollable from the top when it does not. */
.chat[data-empty] .chat-thread > :first-child {
	margin-top: auto;
}
.chat-composer {
	margin: 0 max(16px, calc((100% - var(--chat-width)) / 2)) 16px;
	border: 1px solid var(--control-line);
	border-radius: var(--radius-panel);
	background: var(--surface);
	box-shadow: 0 2px 10px #0000000f;
	padding: 10px 10px 8px;
}
.chat-composer:focus-within {
	border-color: var(--blue);
	box-shadow:
		0 0 0 1px var(--blue),
		0 2px 12px #0000001a;
}
.chat-composer textarea {
	width: 100%;
	border: 0;
	resize: none;
	background: none;
	font-size: 14px;
	line-height: 1.5;
	padding: 4px 6px;
	outline: none;
	max-height: 220px;
	min-height: 28px;
	overflow: hidden;
}
.chat-composer-bar {
	display: flex;
	align-items: center;
	gap: 4px;
	margin-top: 4px;
}
.chat-tool {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	border: 1px solid transparent;
	background: none;
	color: var(--muted);
	font-size: 12px;
	padding: 5px 8px;
	border-radius: var(--radius);
	min-width: 0;
}
.chat-tool:hover {
	background: var(--hover);
	color: var(--text);
}
.chat-tool .ui-icon {
	width: 16px;
	height: 16px;
	flex: none;
}
.chat-model span {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	max-width: 220px;
}
.chat-model .ui-icon:first-child {
	color: var(--accent-ink);
}
.chat-send,
.chat-stop {
	margin-left: auto;
	width: 34px;
	height: 34px;
	padding: 0;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
}
.chat-send .ui-icon {
	width: 18px;
	height: 18px;
	stroke-width: 2;
}
.chat-stop {
	width: auto;
	padding: 0 12px;
	border-radius: 17px;
	gap: 6px;
	font-size: 12px;
	font-weight: 600;
	border: 1px solid var(--line-strong);
	background: var(--surface);
}
.chat-stop .ui-icon {
	width: 14px;
	height: 14px;
}
.chat-attachments {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 0 2px 8px;
}
.chat-attachments[hidden] {
	display: none;
}
.chat-chip,
.chat-msg-files span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border: 1px solid var(--line);
	background: var(--canvas);
	border-radius: var(--radius);
	padding: 3px 4px 3px 4px;
	font-size: 12px;
	max-width: 260px;
}
.chat-chip > span:not(.app-badge) {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}
.chat-chip button {
	border: 0;
	background: none;
	padding: 0 4px;
	color: var(--muted);
	font-size: 15px;
	line-height: 1;
}
.chat-chip .app-badge,
.chat-msg-files .app-badge,
.ai-change-list .app-badge {
	width: 18px;
	height: 18px;
	font-size: 10px;
	flex: none;
}

/* Messages */
.chat-msg {
	display: flex;
	gap: 12px;
	margin: 0 0 22px;
}
.chat-msg.from-user {
	flex-direction: column;
	align-items: flex-end;
	gap: 2px;
}
.chat-bubble {
	background: var(--selected);
	border-radius: 14px 14px 4px 14px;
	padding: 10px 14px;
	max-width: 82%;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	font-size: 14px;
	line-height: 1.55;
}
.chat-msg-files {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 8px;
}
.chat-msg-files span {
	background: var(--surface);
}
.chat-avatar {
	width: 30px;
	height: 30px;
	flex: none;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--blue);
	color: var(--accent-fg);
}
.chat-avatar .ui-icon {
	width: 17px;
	height: 17px;
}
.chat-body {
	flex: 1;
	min-width: 0;
}
.chat-meta {
	font-size: 12px;
	font-weight: 600;
	color: var(--muted);
	margin: 5px 0 4px;
}
.chat-msg-actions {
	display: flex;
	gap: 2px;
	opacity: 0;
	transition: opacity 0.15s;
}
.chat-msg:hover .chat-msg-actions,
.chat-msg:focus-within .chat-msg-actions,
.chat-msg:last-child .chat-msg-actions {
	opacity: 1;
}
.chat-error {
	color: var(--danger);
	font-size: 13px;
}
.chat-note {
	color: var(--muted);
	font-size: 12px;
}
.chat-typing {
	display: inline-flex;
	gap: 4px;
	padding: 8px 0;
}
.chat-typing i {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--faint);
	animation: chat-typing 1.2s infinite ease-in-out;
}
.chat-typing i:nth-child(2) {
	animation-delay: 0.15s;
}
.chat-typing i:nth-child(3) {
	animation-delay: 0.3s;
}
@keyframes chat-typing {
	0%,
	80%,
	100% {
		opacity: 0.3;
		transform: translateY(0);
	}
	40% {
		opacity: 1;
		transform: translateY(-3px);
	}
}

/* Markdown in replies */
.md {
	font-size: 14px;
	line-height: 1.6;
	overflow-wrap: anywhere;
}
.md > :first-child {
	margin-top: 0;
}
.md > :last-child {
	margin-bottom: 0;
}
.md p,
.md ul,
.md ol,
.md blockquote,
.md .md-table,
.md .md-code {
	margin: 0 0 12px;
}
.md ul,
.md ol {
	padding-left: 22px;
}
.md li + li {
	margin-top: 3px;
}
.md h3,
.md h4,
.md h5,
.md h6 {
	margin: 18px 0 8px;
	font-size: 15px;
	line-height: 1.3;
}
.md h3 {
	font-size: 17px;
}
.md a {
	color: var(--accent-ink);
}
.md code {
	font-family: var(--font-mono);
	font-size: 12.5px;
	background: var(--sunken);
	border-radius: 3px;
	padding: 1px 4px;
}
.md blockquote {
	border-left: 3px solid var(--line-strong);
	padding: 2px 0 2px 12px;
	color: var(--muted);
}
.md hr {
	border: 0;
	border-top: 1px solid var(--line);
	margin: 16px 0;
}
.md-code {
	border: 1px solid var(--line);
	border-radius: var(--radius-panel);
	overflow: hidden;
}
.md-code figcaption {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 4px 10px;
	background: var(--sunken);
	font-size: 11px;
	color: var(--muted);
}
.md-code figcaption button {
	border: 0;
	background: none;
	font-size: 11px;
	color: var(--muted);
	padding: 2px 4px;
}
.md-code pre {
	margin: 0;
	padding: 12px;
	overflow: auto;
	background: var(--surface-alt);
}
.md-code pre code {
	background: none;
	padding: 0;
}
.md-table {
	overflow: auto;
}
.md-table table {
	border-collapse: collapse;
	font-size: 13px;
}
.md-table th,
.md-table td {
	border: 1px solid var(--line);
	padding: 5px 10px;
	text-align: left;
}
.md-table th {
	background: var(--sunken);
}

/* Cards under a reply: proposed edits and new files. */
.ai-proposal,
.ai-create-card {
	border: 1px solid var(--line);
	border-left: 3px solid var(--blue);
	border-radius: var(--radius-panel);
	background: var(--surface);
	padding: 12px 14px;
	margin: 12px 0;
	font-size: 13px;
}
.ai-proposal p {
	margin: 6px 0;
	color: var(--muted);
}
.ai-card-heading {
	display: flex;
	align-items: center;
	gap: 10px;
}
.ai-card-heading > span:not(.app-badge) {
	display: grid;
	min-width: 0;
}
.ai-card-heading small {
	color: var(--muted);
	font-size: 12px;
}
.ai-change-list,
.ai-outline {
	margin: 8px 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 4px;
}
.ai-change-list li {
	display: flex;
	gap: 8px;
	align-items: flex-start;
}
.ai-outline {
	padding-left: 40px;
	color: var(--muted);
	font-size: 12px;
}
.ai-outline .more {
	font-style: italic;
}
.ai-proposal details summary {
	cursor: pointer;
	font-size: 12px;
	color: var(--muted);
}
.ai-card-actions {
	display: flex;
	gap: 8px;
	margin-top: 10px;
}
.ai-card-actions:empty {
	display: none;
}
.ai-card-actions button {
	font-size: 12px;
	font-weight: 600;
	padding: 7px 14px;
}

/* The empty chat page: greeting, then the composer, then starters for each app. */
.chat-hero {
	position: relative;
	text-align: center;
	padding: 40px 0 22px;
	isolation: isolate;
}
.chat-hero .rings {
	position: absolute;
	width: 420px;
	left: 50%;
	top: -150px;
	transform: translateX(-50%);
	z-index: -1;
	fill: none;
	stroke: var(--line);
	stroke-width: 0.35;
	pointer-events: none;
}
.chat-hero-mark {
	width: 48px;
	height: 48px;
	border-radius: 14px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--blue);
	color: var(--accent-fg);
	box-shadow: 0 6px 20px color-mix(in srgb, var(--blue) 35%, transparent);
}
.chat-hero-mark .ui-icon {
	width: 26px;
	height: 26px;
}
.chat-hero h1 {
	font-family: var(--font-display);
	font-size: 34px;
	font-weight: 600;
	margin: 16px 0 6px;
	letter-spacing: -0.01em;
}
.chat-hero > p {
	color: var(--muted);
	margin: 0 auto 26px;
	max-width: 520px;
	font-size: 15px;
}
.chat-starters {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	text-align: left;
}
.chat-starters button {
	text-align: left;
	display: flex;
	gap: 12px;
	align-items: flex-start;
	border: 1px solid var(--line);
	background: var(--surface);
	border-radius: var(--radius-panel);
	padding: 12px 14px;
	transition:
		border-color 0.15s,
		box-shadow 0.15s;
}
.chat-starters button:hover {
	border-color: var(--line-strong);
	box-shadow: 0 3px 12px #00000014;
}
.chat-starters strong {
	display: block;
	font-size: 13px;
}
.chat-starters small {
	color: var(--muted);
	font-size: 12px;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.chat-files-badge,
.chat-badge {
	background: var(--surface-alt);
	color: var(--accent-ink);
	border: 1px solid var(--line);
}
.chat-badge {
	background: var(--blue);
	color: var(--accent-fg);
	border: 0;
}
.chat-files-badge .ui-icon,
.chat-badge .ui-icon {
	width: 60%;
	height: 60%;
}

/* The assistant pane reuses the chat at a narrower width. */
.assistant > header {
	gap: 8px;
}
.assistant-actions {
	display: flex;
	gap: 2px;
}
.assistant-actions .ui-icon {
	width: 16px;
	height: 16px;
}
.assistant-chat {
	flex: 1;
	min-height: 0;
}
.assistant-chat .chat-thread {
	padding: 16px 14px 8px;
}
.assistant-chat .chat-composer {
	margin: 0 10px 10px;
}
.assistant-chat .chat-model span {
	max-width: 120px;
}
.assistant-chat .chat-msg {
	gap: 8px;
}
.assistant-chat .chat-avatar {
	width: 24px;
	height: 24px;
}
.assistant-chat .chat-avatar .ui-icon {
	width: 14px;
	height: 14px;
}
.assistant-chat .chat-bubble {
	max-width: 92%;
	font-size: 13px;
}
.assistant-chat .md {
	font-size: 13px;
}
.assistant-intro {
	padding: 0 2px 8px;
}
.assistant-intro .chat-hero-mark {
	width: 34px;
	height: 34px;
	border-radius: 10px;
}
.assistant-intro .chat-hero-mark .ui-icon {
	width: 19px;
	height: 19px;
}
.assistant-intro h3 {
	margin: 10px 0 4px;
	font-size: 15px;
}
.assistant-intro p {
	margin: 0 0 12px;
}
.assistant-suggestions {
	display: grid;
	gap: 6px;
}
.assistant-suggestions button {
	text-align: left;
	border: 1px solid var(--line);
	background: var(--surface);
	border-radius: var(--radius-panel);
	padding: 8px 10px;
	font-size: 12px;
}
.assistant-suggestions button:hover {
	border-color: var(--blue);
	color: var(--accent-ink);
}

/* The document command bar's AI button and the home page's ask bar. */
.document-commandbar button.ask-ai {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--accent-ink);
	border-color: color-mix(in srgb, var(--blue) 45%, var(--line-strong));
}
.document-commandbar .ask-ai .ui-icon {
	width: 15px;
	height: 15px;
}
.home-ask {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 4px 0 28px;
	padding: 6px 6px 6px 14px;
	border: 1px solid var(--line-strong);
	border-radius: var(--radius-panel);
	background: var(--surface);
	box-shadow: 0 2px 10px #0000000f;
	max-width: 760px;
}
.home-ask:focus-within {
	border-color: var(--blue);
	box-shadow: 0 0 0 1px var(--blue);
}
#home-ask-symbol {
	color: var(--accent-ink);
	display: inline-flex;
}
.home-ask input {
	flex: 1;
	border: 0;
	background: none;
	font-size: 14px;
	padding: 8px 0;
	outline: none;
	min-width: 0;
}
.tabs [data-chat] .ui-icon {
	width: 14px;
	height: 14px;
	margin-right: 6px;
	vertical-align: -2px;
	color: var(--accent-ink);
}

@media (max-width: 900px) {
	.chat-history {
		position: absolute;
		z-index: 5;
		top: 0;
		bottom: 0;
		left: 0;
		box-shadow: 5px 0 20px #0002;
		transform: translateX(-105%);
		transition: transform 0.2s;
	}
	.chat-view {
		position: relative;
	}
	.chat-view.history-open .chat-history {
		transform: none;
	}
	.chat-history-toggle {
		display: inline-flex;
	}
}
@media (max-width: 700px) {
	.chat-starters {
		grid-template-columns: minmax(0, 1fr);
	}
	.chat-hero h1 {
		font-size: 26px;
	}
	.chat-model span {
		max-width: 110px;
	}
	.document-commandbar .ask-ai span {
		display: none;
	}
	/* Icon only: a plain bar button, not an outlined box. */
	.document-commandbar button.ask-ai {
		border-color: transparent;
		background: none;
		box-shadow: none;
		padding: 6px 8px;
	}
	.document-commandbar button.ask-ai:hover {
		background: var(--hover);
	}
	.document-commandbar button.ask-ai:focus:not(:focus-visible) {
		outline: none;
		box-shadow: none;
	}
}
.chat-history-back {
	display: none;
}
/* A phone shows the chat list or one conversation, each full screen, with a back button. */
@media (max-width: 640px) {
	.chat-history {
		width: 100%;
		border-right: 0;
		box-shadow: none;
		visibility: hidden;
		transition:
			transform 0.2s,
			visibility 0.2s;
	}
	.chat-view.history-open .chat-history {
		visibility: visible;
	}
	.chat-history-top {
		grid-template-columns: 1fr 1fr;
	}
	.chat-history-back,
	.chat-search {
		grid-column: 1 / -1;
	}
	.chat-join {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: 6px;
		min-height: 40px;
	}
	.chat-new {
		min-height: 40px;
	}
	.chat-history .chat-history-back {
		display: inline-flex;
		align-items: center;
		justify-self: start;
		gap: 4px;
		border: 0;
		background: none;
		padding: 6px 8px 6px 2px;
		font-size: 13px;
		font-weight: 600;
		color: var(--accent-ink);
		min-height: 36px;
	}
	.chat-history-back .ui-icon {
		width: 18px;
		height: 18px;
	}
	.chat-header {
		padding: 0 10px;
	}
	.chat-share span {
		display: none;
	}
}

/* The model dialog's provider list matches the dialog's text fields. */
.ai-settings-form select {
	display: block;
	width: 100%;
	margin-top: 6px;
	padding: 8px 10px;
	border: 1px solid var(--line-strong);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--text);
	font: inherit;
	font-size: 13px;
}
.ai-provider-note:empty {
	display: none;
}
.ai-provider-note {
	color: var(--muted);
	font-size: 12px;
}

.chat-history[hidden] {
	display: none;
}

/* @ mentions: a list above the composer, open tabs first. */
.chat-composer {
	position: relative;
}
.chat-mentions {
	position: absolute;
	left: 8px;
	right: 8px;
	bottom: calc(100% + 6px);
	max-height: 280px;
	overflow: auto;
	background: var(--surface);
	border: 1px solid var(--line-strong);
	border-radius: var(--radius-panel);
	box-shadow: 0 10px 30px #00000029;
	padding: 6px;
	z-index: 6;
}
.chat-mentions[hidden] {
	display: none;
}
.chat-mentions .nav-caption {
	display: block;
	padding: 6px 8px 2px;
}
.chat-mentions button {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	border: 0;
	background: none;
	padding: 6px 8px;
	border-radius: var(--radius);
	font-size: 13px;
	text-align: left;
}
.chat-mentions button[aria-selected='true'],
.chat-mentions button:hover {
	background: var(--selected);
}
.chat-mentions .app-badge {
	width: 18px;
	height: 18px;
	font-size: 10px;
}
.chat-mentions p {
	margin: 6px 8px;
	color: var(--muted);
	font-size: 12px;
}

/* Proposed edits: one row per change with its before-and-after. */
.ai-change-list {
	gap: 10px;
}
.ai-change-list > .ai-change {
	display: grid;
	gap: 6px;
	padding: 8px 10px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--canvas);
}
.ai-change > label {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-weight: 400;
}
.ai-change small {
	color: var(--muted);
}
.ai-change.skipped .ai-diff,
.ai-change.skipped .ai-cell-diff {
	opacity: 0.45;
}
.ai-diff {
	font-size: 13px;
	line-height: 1.55;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}
.ai-diff del,
.ai-cell-diff del {
	background: color-mix(in srgb, var(--danger) 16%, transparent);
	color: var(--danger);
	text-decoration: line-through;
	border-radius: 2px;
}
.ai-diff ins,
.ai-cell-diff ins {
	background: color-mix(in srgb, var(--ok) 18%, transparent);
	color: var(--ok);
	text-decoration: none;
	border-radius: 2px;
}
.ai-cell-diff {
	border-collapse: collapse;
	font-size: 12px;
	width: 100%;
}
.ai-cell-diff th,
.ai-cell-diff td {
	text-align: left;
	padding: 3px 8px;
	border-bottom: 1px solid var(--line);
	font-family: var(--font-mono);
}
.ai-cell-diff th {
	font-family: var(--font-ui);
	color: var(--muted);
	font-weight: 600;
}
/* What a spreadsheet edit recalculates beyond the cells it types into. */
.ai-change-effects {
	list-style: none;
}
.ai-effects:not(:empty) {
	margin: 4px 0 8px;
}
.ai-effects p {
	margin: 0 0 4px;
	font-size: 12px;
	color: var(--muted);
}
.ai-card-actions {
	flex-wrap: wrap;
}

/* Reply versions after regenerating. */
.chat-versions {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	font-size: 12px;
	color: var(--muted);
	margin-right: 4px;
}
.chat-versions button {
	border: 0;
	background: none;
	padding: 2px 6px;
	border-radius: var(--radius);
	font-size: 15px;
	line-height: 1;
	color: var(--muted);
}
.chat-versions button:disabled {
	opacity: 0.35;
}
.chat-versions button:not(:disabled):hover {
	background: var(--hover);
	color: var(--text);
}

/* Version history dialog. */
.version-list ol {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 6px;
	max-height: 360px;
	overflow: auto;
}
.version-list li {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 10px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
}
.version-list li > span {
	flex: 1;
	display: grid;
	min-width: 0;
}
.version-list small,
.version-empty {
	color: var(--muted);
	font-size: 12px;
}
.version-list button {
	font-size: 12px;
	font-weight: 600;
	padding: 6px 12px;
}

/* The model menu and assistant settings. */
.workspace-context-menu hr {
	border: 0;
	border-top: 1px solid var(--line);
	margin: 4px 0;
}
.workspace-context-menu [role='menuitemradio'] {
	padding-left: 28px;
	position: relative;
}
.workspace-context-menu [aria-checked='true']::before {
	content: '';
	position: absolute;
	left: 10px;
	top: 50%;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--blue);
	transform: translateY(-50%);
}
.ai-preferences h3 {
	font-size: 13px;
	margin: 18px 0 8px;
}
.ai-preferences textarea {
	width: 100%;
	resize: vertical;
}
.ai-preferences input[type='range'] {
	width: 100%;
}
.ai-managed {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	background: var(--selected);
	border-radius: var(--radius);
	padding: 8px 10px;
	font-size: 12px;
}
.ai-managed .ui-icon {
	width: 16px;
	height: 16px;
	flex: none;
	color: var(--accent-ink);
}
.ai-models {
	display: grid;
	gap: 6px;
}
.ai-models > div {
	display: flex;
	align-items: center;
	gap: 6px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 6px 8px;
}
.ai-models > div > span {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}
.ai-models > div > span > span {
	display: grid;
}
.ai-models small {
	color: var(--muted);
	font-size: 11px;
}
.ai-models button {
	font-size: 12px;
	padding: 5px 10px;
}
.ai-provider-mark {
	width: 24px;
	height: 24px;
	border-radius: 6px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--blue);
	color: var(--accent-fg);
	font-weight: 700;
	font-size: 12px;
	flex: none;
}
.ai-context-form .nav-caption {
	display: block;
	margin: 12px 0 4px;
}
.ai-change-file {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 4px;
	font-size: 12px;
	min-width: 0;
}
.ai-change-file strong {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}
.ai-change-file .app-badge {
	width: 18px;
	height: 18px;
	font-size: 10px;
	flex: none;
}

/* The assistant exists only when the deployment configures it (ai-config.json). */
body:not([data-ai='on']) .ai-only {
	display: none !important;
}

/* Shared chats: the join and share buttons, the history mark, and who is here. */
.chat-history-top {
	grid-template-columns: 1fr auto;
}
.chat-history-top .chat-search {
	grid-column: 1 / -1;
}
.chat-join,
.chat-share {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	padding: 6px 10px;
}
.chat-share {
	margin-left: auto;
	flex: none;
}
.chat-list-shared {
	display: inline-flex;
	vertical-align: -3px;
	margin-right: 4px;
	color: var(--accent-ink);
}
.chat-list-shared .ui-icon {
	width: 14px;
	height: 14px;
}
.chat-people {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0 max(16px, calc((100% - var(--chat-width)) / 2)) 6px;
	font-size: 12px;
	color: var(--muted);
	min-width: 0;
}
.chat-people[hidden] {
	display: none;
}
.chat-shared-mark {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-weight: 600;
	color: var(--accent-ink);
}
.chat-shared-mark .ui-icon {
	width: 14px;
	height: 14px;
}
.chat-person {
	display: inline-grid;
	place-items: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--person);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	flex: none;
}
.chat-people-state {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}
.chat-author {
	display: block;
	text-align: right;
	font-size: 11px;
	color: var(--muted);
	margin: 0 4px 2px;
	order: -1;
}
.chat-share-form input[readonly] {
	font-family: var(--mono, ui-monospace, monospace);
	font-size: 12px;
}
.chat-share-reach {
	font-size: 12px;
	color: var(--muted);
}

/* Dropping a tab or a file on a chat attaches it. */
.chat.drop-target .chat-composer {
	border-color: var(--blue);
	box-shadow: 0 0 0 2px var(--blue);
}
.chat.drop-target .chat-composer::after {
	content: 'Drop to attach';
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	border-radius: inherit;
	background: color-mix(in srgb, var(--surface) 88%, transparent);
	color: var(--accent-ink);
	font-weight: 600;
	pointer-events: none;
}

/* Reordering tabs: the dragged tab fades and a bar marks where it will land. */
.file-tab.dragging {
	opacity: 0.45;
}
.file-tab.drop-before {
	box-shadow: inset 2px 0 0 var(--blue);
}
.file-tab.drop-after {
	box-shadow: inset -2px 0 0 var(--blue);
}

/* Assistant suggestions shown in the document: a panel floating over the editor. */
.review-panel {
	position: absolute;
	right: 16px;
	bottom: 16px;
	z-index: 20;
	width: min(360px, calc(100% - 32px));
	max-height: min(60%, 520px);
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 12px;
	border: 1px solid var(--line-strong);
	border-radius: var(--radius-panel);
	background: var(--surface);
	color: var(--text);
	box-shadow: 0 8px 28px #0000002e;
	font-size: 13px;
}
.review-head {
	display: flex;
	align-items: center;
	gap: 8px;
}
.review-collapse {
	margin-left: auto;
	padding: 0 8px;
	line-height: 22px;
}
.review-panel.folded > :not(.review-head) {
	display: none;
}
.review-help {
	margin: 0;
	color: var(--muted);
	font-size: 12px;
}
.review-list {
	list-style: none;
	margin: 0;
	padding: 0;
	overflow: auto;
	min-height: 0;
	display: grid;
	gap: 6px;
}
.review-item {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 4px 8px;
	align-items: start;
	padding: 8px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
}
.review-item .ai-diff {
	grid-column: 1;
	min-width: 0;
	overflow-wrap: anywhere;
	line-height: 1.5;
}
/* Cell suggestions list one cell per line. */
.review-item .ai-diff > span {
	display: block;
}
.review-item.skipped .ai-diff {
	opacity: 0.5;
	text-decoration: line-through;
}
.review-where {
	justify-self: start;
	padding: 0;
	border: 0;
	background: none;
	color: var(--accent-ink);
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
}
.review-where:disabled {
	color: var(--muted);
	cursor: default;
}
.review-toggle {
	grid-row: 1 / span 2;
	grid-column: 2;
	font-size: 12px;
	padding: 4px 10px;
}
.review-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

/* Forced colours: selected, current and pressed states keep a system highlight. */
@media (forced-colors: active) {
	.chat-list-item[aria-current='true'],
	.chat-list-item[aria-current='true'] > button,
	.chat-mentions button[aria-selected='true'] {
		forced-color-adjust: none;
		border-color: Highlight;
		background: Highlight;
		color: HighlightText;
	}
	.workspace-context-menu [aria-checked='true']::before {
		background: Highlight;
	}
}

/*
 * Settings (apps/office-suite/src/settings-dialog.js): the panes the suite slots into the shared
 * office-ui-options-dialog. The rail, headline, section titles and rows are the shared element's
 * own; these rules give the slotted panes the same arrangement, in the suite palette.
 */
.settings-pane {
	font-size: 12px;
	line-height: 1.5;
}
.settings-pane p {
	max-width: none;
}
.settings-pane section {
	margin: 0 0 18px;
}
.settings-pane h3 {
	margin: 0 0 6px;
	padding-bottom: 2px;
	border-bottom: 1px solid var(--line);
	color: var(--muted);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}
.settings-desc {
	margin: 0 0 10px;
	color: var(--muted);
}
.settings-note {
	margin: 8px 0 0;
	color: var(--faint);
}
.settings-pane a {
	color: var(--accent-ink);
}
.settings-pane button[type='button'] {
	min-height: 28px;
	padding: 0 12px;
	border: 1px solid var(--line-strong);
	border-radius: var(--radius);
	background: var(--surface);
	color: inherit;
	font: inherit;
	cursor: pointer;
}
.settings-pane button[type='button']:hover {
	background: var(--hover);
}
.settings-pane button[type='button']:focus-visible,
.settings-pane input:focus-visible + .theme-preview,
.settings-pane input:focus-visible + .settings-swatch {
	outline: 2px solid var(--blue);
	outline-offset: 2px;
}

/* General > Appearance: theme cards and accent swatches. */
.settings-pane fieldset {
	margin: 4px 0 14px;
}
.settings-pane legend {
	margin: 0 0 8px;
	font-size: 12px;
	font-weight: 600;
}
.settings-modes {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
}
.settings-modes label,
.settings-accents label {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	margin: 0;
	font-weight: 400;
	text-align: center;
	cursor: pointer;
}
/* The radio covers its card invisibly, so the card is the hit target. */
.settings-modes input,
.settings-accents input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
	z-index: 1;
}
.settings-modes input:checked ~ span:last-child,
.settings-accents input:checked ~ span:last-child {
	font-weight: 600;
}
.theme-preview {
	--p-canvas: #f7f8fa;
	--p-bar: #fff;
	--p-rail: #f0f2f5;
	--p-line: #e3e6eb;
	position: relative;
	display: block;
	width: 100%;
	height: 72px;
	overflow: hidden;
	border: 1px solid var(--line-strong);
	border-radius: var(--radius-panel);
	background: var(--p-canvas);
}
.theme-preview.dark {
	--p-canvas: #181a1e;
	--p-bar: #202228;
	--p-rail: #1c1e23;
	--p-line: #34383f;
}
.theme-preview i {
	position: absolute;
}
.theme-preview i:nth-child(1) {
	inset: 0 0 auto;
	height: 12px;
	border-bottom: 1px solid var(--p-line);
	background: var(--p-bar);
}
.theme-preview i:nth-child(2) {
	top: 13px;
	bottom: 0;
	left: 0;
	width: 22%;
	border-right: 1px solid var(--p-line);
	background: var(--p-rail);
}
.theme-preview i:nth-child(3) {
	top: 24px;
	left: 32%;
	width: 44%;
	height: 7px;
	border-radius: 2px;
	background: var(--blue);
	box-shadow:
		0 13px 0 var(--p-line),
		0 26px 0 var(--p-line);
}
/* System: the light card's left half beside the dark card's right half. */
.theme-preview.system {
	background: linear-gradient(90deg, #f7f8fa 50%, #181a1e 50%);
}
.theme-preview.system i:nth-child(1) {
	border-bottom-color: #8d8d8d;
	background: linear-gradient(90deg, #fff 50%, #202228 50%);
}
.theme-preview.system i:nth-child(2) {
	--p-line: #e3e6eb;
}
.theme-preview.system i:nth-child(3) {
	box-shadow:
		0 13px 0 #8d8d8d,
		0 26px 0 #8d8d8d;
}
.settings-modes input:checked + .theme-preview {
	border-color: var(--blue);
	box-shadow: 0 0 0 1px var(--blue);
}
.settings-accents {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 2px;
}
.settings-accents label {
	width: 60px;
	font-size: 11px;
}
.settings-swatch {
	display: block;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--swatch);
}
:root[data-theme='dark'] .settings-swatch {
	background: var(--swatch-dark);
}
.settings-accents input:checked + .settings-swatch {
	box-shadow:
		0 0 0 2px var(--surface),
		0 0 0 4px var(--text);
}

/* Fonts: one card per choice. */
.settings-choices {
	display: grid;
	gap: 8px;
}
.settings-choice {
	padding: 10px 12px;
	border: 1px solid var(--line);
	border-radius: var(--radius-panel);
	background: var(--surface);
}
.settings-choice:has(input[type='radio']:checked) {
	border-color: var(--blue);
	background: color-mix(in srgb, var(--blue) 7%, var(--surface));
}
.settings-choice label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	font-weight: 400;
	cursor: pointer;
}
.settings-choice input[type='radio'] {
	flex: none;
	width: 16px;
	height: 16px;
	margin: 2px 0 0;
	accent-color: var(--blue);
}
.settings-choice strong {
	display: block;
	font-size: 13px;
	font-weight: 600;
}
.settings-choice small {
	display: block;
	color: var(--muted);
	font-size: 12px;
}
.settings-hosts,
.settings-field {
	margin: 8px 0 0 26px;
}
.settings-hosts {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.settings-hosts code {
	padding: 1px 8px;
	border-radius: 999px;
	background: var(--sunken);
	color: var(--muted);
	font: 11px/1.6 var(--font-mono);
}
.settings-choice:not(:has(input[value='custom']:checked)) .settings-field {
	display: none;
}
.settings-field input {
	width: 100%;
	min-height: 30px;
	padding: 4px 8px;
	border: 1px solid var(--line-strong);
	border-radius: var(--radius);
	background: var(--surface);
	color: inherit;
	font: 12px var(--font-mono);
}
.settings-field input:focus-visible {
	border-color: var(--blue);
	outline: 1px solid var(--blue);
}
.settings-error {
	margin: 4px 0 0;
	color: var(--danger);
}
.settings-error:empty {
	display: none;
}
.settings-apps {
	display: grid;
	gap: 6px;
	margin: 0;
}
.settings-apps div {
	display: grid;
	grid-template-columns: 150px minmax(0, 1fr);
	gap: 12px;
}
.settings-apps dt {
	font-weight: 600;
}
.settings-apps dd {
	margin: 0;
	color: var(--muted);
}

/* Privacy: what the app connects to. */
.settings-connections {
	margin: 0;
	padding: 0;
	list-style: none;
}
.settings-connections li {
	display: grid;
	grid-template-columns: 10px minmax(0, 1fr) auto;
	align-items: center;
	gap: 10px;
	padding: 7px 0;
	border-bottom: 1px solid var(--line);
}
.settings-connections strong {
	display: block;
	font-weight: 600;
}
.settings-connections small {
	display: block;
	color: var(--muted);
	font-size: 12px;
}
.settings-dot {
	width: 8px;
	height: 8px;
	border: 1px solid var(--faint);
	border-radius: 50%;
}
.settings-connections [data-state='on'] .settings-dot {
	border-color: var(--blue);
	background: var(--blue);
}
.settings-storage {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
}
.settings-links {
	margin: 0;
}

@media (max-width: 600px) {
	.settings-apps div {
		grid-template-columns: minmax(0, 1fr);
		gap: 0;
	}
	.settings-modes {
		gap: 8px;
	}
}

/* Settings > General > Reduce motion: the workspace's own transitions stop. */
html.reduce-motion *,
html.reduce-motion *::before,
html.reduce-motion *::after {
	animation-duration: 0.01ms !important;
	animation-iteration-count: 1 !important;
	transition-duration: 0.01ms !important;
	scroll-behavior: auto !important;
}

/* Forced colours: selected, current and pressed states keep a system highlight. */
@media (forced-colors: active) {
	.settings-modes input:checked + .theme-preview,
	.settings-accents input:checked + .settings-swatch,
	.settings-choice:has(input[type='radio']:checked) {
		forced-color-adjust: none;
		border-color: Highlight;
		background: Highlight;
		color: HighlightText;
	}
}

/* Simple view (Settings > View > Layout, or the button on the document bar): the document under
   one short command bar, with each app's ribbon held back. apps/office-suite/src/document-bar.js
   sets body[data-layout] and fills the title and the view controls. */
.doc-title,
.doc-view,
#focus-toggle {
	display: none;
}
#layout-toggle .ui-icon,
#focus-toggle .ui-icon,
.doc-view .ui-icon {
	width: 15px;
	height: 15px;
	flex: none;
}

/* Its own line under the tabs: the tab row's bottom border closes the bar, and the bar's top
   border separates it from the tabs. */
body[data-layout='simple'] .document-commandbar {
	flex: 1 0 100%;
	height: 44px;
	gap: 6px;
	padding: 0 10px 0 14px;
	border-top: 1px solid var(--line);
	border-bottom: 0;
}
body[data-layout='simple'] .doc-title {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	max-width: 38ch;
	padding-right: 12px;
	margin-right: 4px;
	border-right: 1px solid var(--line);
	font-size: 13px;
	line-height: 28px;
}
.doc-title .app-badge {
	width: 18px;
	height: 18px;
	font-size: 10px;
	flex: none;
}
.doc-name {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 600;
	color: var(--ink-strong);
}
.doc-extension {
	font-weight: 400;
	color: var(--muted);
}

/* Word and Excel draw a title bar of their own (file name, save, undo); the bar above replaces
   it here. The ribbon brings it back with everything else. */
body[data-layout='simple'] :is(docx-editor, xlsx-editor)::part(title-bar) {
	display: none;
}

/* The file commands move into the More menu; Save stays on the bar. */
body[data-layout='simple'] .document-commandbar [data-menu]:not(#save) {
	display: none;
}
body[data-layout='simple'] #actions-more {
	display: inline-flex;
	margin-left: 0;
}
body[data-layout='simple'] #focus-toggle {
	display: inline-flex;
}
body[data-layout='simple'] .document-commandbar button {
	font-size: 12px;
}
body[data-layout='simple'] #actions-more,
body[data-layout='simple'] #focus-toggle,
.doc-view button {
	width: 30px;
	height: 30px;
	min-width: 0;
	padding: 0;
	color: var(--muted);
}
body[data-layout='simple'] #actions-more:hover,
body[data-layout='simple'] #focus-toggle:hover,
.doc-view button:hover:not(:disabled) {
	color: var(--text);
}
#focus-toggle[aria-pressed='true'] {
	background: var(--selected);
	color: var(--accent-ink);
}

/* Undo, redo and the slide or page in view. */
body[data-layout='simple'] .doc-view:not([hidden]) {
	display: flex;
	align-items: center;
	gap: 2px;
	padding-left: 6px;
	margin-left: 2px;
	border-left: 1px solid var(--line);
}
.doc-nav:not([hidden]) {
	display: flex;
	align-items: center;
	margin-left: 8px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
}
.doc-nav button {
	width: 26px;
	height: 26px;
	border-radius: 0;
}
.doc-nav output {
	min-width: 84px;
	padding: 0 4px;
	text-align: center;
	font-size: 12px;
	font-variant-numeric: tabular-nums;
	color: var(--text);
	white-space: nowrap;
}

/* Bold, italic and underline for the selection (Word, Excel), drawn as the letters themselves. */
.doc-format:not([hidden]) {
	display: flex;
	align-items: center;
	gap: 2px;
	margin-left: 6px;
	padding-left: 8px;
	border-left: 1px solid var(--line);
}
body[data-layout='simple'] .doc-format button {
	font-size: 13.5px;
	font-weight: 500;
	line-height: 1;
	color: var(--text);
}
body[data-layout='simple'] .doc-format [data-format='bold'] {
	font-weight: 700;
}
body[data-layout='simple'] .doc-format [data-format='italic'] {
	font-style: italic;
	font-family: Georgia, 'Times New Roman', serif;
}
body[data-layout='simple'] .doc-format [data-format='underline'] {
	text-decoration: underline;
	text-underline-offset: 2px;
}
body[data-layout='simple'] .doc-format [aria-pressed='true'] {
	background: var(--selected);
	color: var(--accent-ink);
}
body[data-layout='simple'] .doc-format [aria-pressed='mixed'] {
	background: var(--hover);
}

/* The way back to the ribbon (and, with the ribbon on, the way here). */
.document-commandbar button#layout-toggle {
	gap: 6px;
	font-weight: 500;
	color: var(--muted);
}
.document-commandbar button#layout-toggle:hover {
	color: var(--text);
}
body[data-layout='simple'] .document-commandbar button#layout-toggle {
	border-color: var(--line-strong);
	color: var(--text);
}

/* Focus: only the bar and the document, until the same button is pressed again. */
body[data-layout='simple'][data-view='editor'][data-focus='true']
	:is(.suite-header, .tabs, .workspace-sidebar, .statusbar) {
	display: none;
}
body[data-layout='simple'][data-view='editor'][data-focus='true'] .suite-layout {
	height: var(--app-h, 100dvh);
}

@media (max-width: 900px) {
	#layout-toggle span {
		display: none;
	}
	.document-commandbar button#layout-toggle {
		width: 30px;
		height: 30px;
		padding: 0;
	}
	body[data-layout='simple'] .doc-title {
		max-width: 22ch;
	}
}
@media (max-width: 640px) {
	/* The status text is hidden here, so the right-hand cluster needs its own push. */
	#layout-toggle {
		margin-left: auto;
	}
	/* One push for the whole cluster: More follows the toggle instead of splitting the room. */
	#layout-toggle ~ #actions-more {
		margin-left: 0;
	}
	body[data-layout='simple'] .document-commandbar {
		padding-left: 10px;
	}
	body[data-layout='simple'] .doc-title {
		max-width: 14ch;
		border-right: 0;
		padding-right: 0;
	}
	body[data-layout='simple'] :is(#doc-undo, #doc-redo, #doc-format) {
		display: none;
	}
	body[data-layout='simple'] .doc-view:not([hidden]) {
		border-left: 0;
		padding-left: 0;
	}
	.doc-nav output {
		min-width: 0;
	}
}
@media (pointer: coarse) {
	body[data-layout='simple'] .document-commandbar {
		height: 52px;
	}
	body[data-layout='simple'] #actions-more,
	body[data-layout='simple'] #focus-toggle,
	.doc-view button,
	.document-commandbar button#layout-toggle {
		width: 44px;
		height: 44px;
	}
}

/* Forced colours: selected, current and pressed states keep a system highlight. */
@media (forced-colors: active) {
	#focus-toggle[aria-pressed='true'],
	body[data-layout='simple'] .doc-format [aria-pressed='true'] {
		forced-color-adjust: none;
		border-color: Highlight;
		background: Highlight;
		color: HighlightText;
	}
}

