/* The page around each demo; the demos style themselves with margaui classes. */
body {
	min-height: 100vh;
	margin: 0;
	font-family: system-ui, sans-serif;
	background: var(--color-base-200, #f4f4f5);
	color: var(--color-base-content, #18181b);
}
.demo-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.25rem 1rem;
	padding: 0.75rem 1.5rem;
	background: var(--color-base-100, #fff);
	border-bottom: 1px solid var(--color-base-300, #e4e4e7);
}
.demo-bar h1 {
	margin: 0;
	white-space: nowrap;
	font-size: 1.1rem;
}
/* The description gets a row of its own, under the links, title and sync modes. */
.demo-bar p {
	order: 1;
	flex-basis: 100%;
	margin: 0;
	opacity: 0.7;
	font-size: 0.9rem;
}
.demo-bar a {
	white-space: nowrap;
	color: inherit;
	opacity: 0.7;
	text-decoration: none;
}
/* The time travel bar, under the demo bar; empty, and so hidden, until there are two states. */
.time-travel {
	padding: 0.25rem 1.5rem;
	background: var(--color-base-100, #fff);
	border-bottom: 1px solid var(--color-base-300, #e4e4e7);
}
.time-travel:not(:has([role="group"])) {
	display: none;
}
.demo-bar .demo-error {
	color: var(--color-error, #dc2626);
	opacity: 1;
}
#app {
	padding: 1.5rem;
}
.demo-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
	gap: 1rem;
	max-width: 64rem;
	margin: 0 auto;
	padding: 1.5rem;
}
.demo-card {
	border: 1px solid var(--color-base-300, #e4e4e7);
	border-radius: 0.75rem;
	background: var(--color-base-100, #fff);
}
.demo-card:hover {
	border-color: currentColor;
}
.demo-card > a {
	display: block;
	padding: 1rem 1.25rem 0.5rem;
	color: inherit;
	text-decoration: none;
}
.demo-card .demo-sync {
	padding: 0 1.25rem 1rem;
}
.demo-card .demo-sync a {
	color: inherit;
}
.demo-list h2 {
	margin: 0 0 0.25rem;
	font-size: 1.05rem;
}
.demo-list p {
	margin: 0;
	opacity: 0.75;
	font-size: 0.9rem;
}

/* An app screen, like the tracker: it fills the window below the bar, scrolls inside and keeps
   its own bars in place. */
body.demo-fullscreen {
	display: flex;
	flex-direction: column;
	height: 100vh;
	min-height: 0;
}
.demo-fullscreen #app {
	flex: 1;
	min-height: 0;
	padding: 0;
}
.demo-fullscreen #app > div {
	height: 100%;
	min-height: 0;
}
/* The sync demos' log of the ops each change sent or received: it scrolls in its own strip. */
.sync-log {
	max-width: 36rem;
	max-height: 25vh;
	overflow-y: auto;
	margin: 0 auto 2rem;
	padding: 0 1.5rem;
	font-size: 0.8rem;
}
/* Under a fullscreen app it keeps its height, or the app would shrink instead. */
.demo-fullscreen .sync-log {
	flex: none;
	margin-bottom: 0;
}
.sync-log h2 {
	font-size: 0.9rem;
	opacity: 0.7;
}
.sync-log ol {
	margin: 0;
	padding: 0;
	list-style: none;
	font-family: ui-monospace, monospace;
	word-break: break-all;
}
.sync-log li {
	padding: 0.15rem 0;
}
.sync-log li.received {
	color: var(--color-info, #0369a1);
}
.sync-modes {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	align-self: center;
	margin-left: auto;
	white-space: nowrap;
	font-size: 0.85rem;
}
.sync-options {
	display: inline-flex;
	padding: 2px;
	border: 1px solid var(--color-base-300, #e4e4e7);
	border-radius: 0.5rem;
	background: var(--color-base-200, #f4f4f5);
}
.demo-bar .sync-options a {
	padding: 0.2rem 0.6rem;
	border-radius: 0.375rem;
	opacity: 0.65;
}
.demo-bar .sync-options a:hover {
	opacity: 1;
}
.demo-bar .sync-options a[aria-current] {
	opacity: 1;
	font-weight: 600;
	background: var(--color-base-100, #fff);
	box-shadow: 0 1px 2px rgb(0 0 0 / 0.12);
}
/* The tree spec explorer's scenario links. */
.tree-spec-scenarios {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1rem;
	padding: 0.5rem 1.5rem;
	font-size: 0.85rem;
}
.tree-spec-link {
	color: inherit;
	opacity: 0.7;
	text-decoration: none;
}
.tree-spec-link[aria-current="page"] {
	opacity: 1;
	font-weight: bold;
}
