/*
 * The context bar.
 *
 * One line, at the foot of the viewport, quiet enough to ignore. It is not a
 * card and not a toolbar — the brief this answers is explicit that the interface
 * should stay calm even when it is doing something, and a bar that competes
 * with the page it is describing has misunderstood its job.
 *
 * It sits above the dock and below everything else, and it is absent entirely
 * on pages with no subject, which is most of them.
 */

.an-th {
	position: sticky;
	bottom: 0;
	z-index: 40;
	background: color-mix(in srgb, var(--an-surface) 92%, transparent);
	border-top: 1px solid var(--an-line);
	backdrop-filter: saturate(1.4) blur(8px);
}

/* color-mix is recent; older engines get the flat surface, which is correct
   rather than merely acceptable. */
@supports not (background: color-mix(in srgb, red 50%, transparent)) {
	.an-th { background: var(--an-surface); }
}

.an-th-in {
	display: flex;
	align-items: center;
	gap: var(--an-space-4);
	max-width: var(--an-max);
	margin: 0 auto;
	padding: var(--an-space-3) var(--an-gutter);
	overflow-x: auto;
	scrollbar-width: none;
}

.an-th-in::-webkit-scrollbar { display: none; }

.an-th-subject {
	display: inline-flex;
	align-items: baseline;
	gap: var(--an-space-2);
	flex: 0 0 auto;
	font: 500 var(--an-t-small) / 1.2 var(--an-font-ui);
	color: var(--an-text);
	white-space: nowrap;
}

.an-th-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--an-primary);
	align-self: center;
}

.an-th-group {
	font-weight: 400;
	font-size: var(--an-t-micro);
	color: var(--an-text-3);
}

.an-th-acts {
	display: flex;
	align-items: center;
	gap: var(--an-space-2);
	flex: 1 1 auto;
}

.an-th-acts a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border: 1px solid var(--an-line);
	border-radius: 999px;
	background: var(--an-surface);
	font: var(--an-t-micro) / 1.2 var(--an-font-ui);
	color: var(--an-text-2);
	text-decoration: none;
	white-space: nowrap;
}

.an-th-acts a:hover {
	border-color: var(--an-text-3);
	color: var(--an-text);
}

.an-th-acts a:focus-visible {
	outline: 2px solid var(--an-accent);
	outline-offset: 2px;
}

/* The dock owns the corner. The bar stops short of it rather than running
   underneath, which on a phone is the difference between a reachable row of
   actions and one with a microphone sitting on top of the last item. */
@media (max-width: 860px) {
	.an-th-in { padding-right: calc(var(--an-gutter) + 64px); }
	.an-th { bottom: 0; }
}

@media (min-width: 861px) {
	.an-th-in { padding-right: calc(var(--an-gutter) + 180px); }
}

/* Said once, where a field filled itself in. */
.an-th-note {
	margin: 0 0 var(--an-space-3);
	font: var(--an-t-micro) / 1.5 var(--an-font-ui);
	color: var(--an-text-3);
}

.an-th-note strong { color: var(--an-text); font-weight: 500; }

.an-th-note button {
	margin-left: 6px;
	border: 0;
	background: none;
	padding: 0;
	font: inherit;
	color: var(--an-accent);
	text-decoration: underline;
	cursor: pointer;
}

@media print { .an-th { display: none; } }
