/*
 * Two small settings widgets: the advanced-settings fold (adv-) and the
 * memory-full corner dot (mfd-).
 */

/* ---------- advanced fold ---------- */

.adv {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.adv-toggle {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	align-self: flex-start;
	padding: 0;
	border: none;
	background: none;
	color: var(--muted);
	font-size: 13px;
	cursor: pointer;
}

.adv-toggle:hover {
	color: var(--text-strong);
}

.adv-chevron {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 14px;
	height: 14px;
	transition: transform 0.2s var(--ease);
}

/* drawn, not the "›" letter: a letter sits on the text's baseline, off the middle */
.adv-chevron::after {
	content: "";
	width: 5px;
	height: 5px;
	margin-left: -2px;
	border-top: 1.5px solid currentColor;
	border-right: 1.5px solid currentColor;
	transform: rotate(45deg);
}

.adv.is-open .adv-chevron {
	transform: rotate(90deg);
}

.adv-body {
	overflow: hidden;
	max-height: 0;
	opacity: 0;
	transition:
		max-height 0.22s var(--ease),
		opacity 0.22s var(--ease);
}

.adv.is-open .adv-body {
	max-height: 2000px;
	opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
	.adv-chevron {
		transition: none;
	}
	.adv-body {
		transition: none;
	}
}

/* ---------- memory-full dot ---------- */

.mfd {
	position: relative;
	display: inline-block;
}

.mfd-dot {
	position: absolute;
	top: -2px;
	right: -2px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	border: 1.5px solid var(--surface);
	box-shadow: 0 0 0 1px var(--border);
	z-index: 1;
}

.mfd-dot.mfd-full {
	background: var(--danger);
	box-shadow: 0 0 0 1px var(--danger);
}

.mfd-dot.mfd-near {
	background: #f59e0b;
	box-shadow: 0 0 0 1px #f59e0b;
}

/* Amber dot in dark mode: brighter so it is still readable. */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .mfd-dot.mfd-near {
		background: #fbbf24;
		box-shadow: 0 0 0 1px #fbbf24;
	}
}
:root[data-theme="dark"] .mfd-dot.mfd-near {
	background: #fbbf24;
	box-shadow: 0 0 0 1px #fbbf24;
}
