/* Skill dots (public/shared/skill-dots.js): one dot per quiz skill of a mini-unit.
   Hollow grey is not met yet, green is practiced, amber is shaky. The dots are always one row:
   each sits in a 44px-tall target up to 44px wide, and a crowded row shrinks them to fit. The title,
   row and legend are centred wherever the dots appear. */

.skd {
	--skd-good: #4ade80;
	--skd-warn: #fbbf24;
	--skd-none: #8b95b8;
	--skd-ink: #e8ecf8;
	--skd-ground: #141a2e;
	--skd-line: #3a4670;
	margin: 12px 0 16px;
	font-family: 'DM Sans', system-ui, sans-serif;
	color: var(--skd-ink);
	text-align: center;
}

.skd__title {
	margin: 0 0 4px;
	font-size: 12px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--skd-none);
}

/* Always one row, centred on the page: the buttons share the row's width and the dots shrink
   with them. */
.skd__dots {
	display: flex;
	flex-wrap: nowrap;
	justify-content: center;
	gap: 0;
}

.skd__btn {
	display: inline-flex;
	flex: 1 1 0;
	min-width: 0;
	max-width: 44px;
	align-items: center;
	justify-content: center;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	cursor: pointer;
}

.skd__btn:hover,
.skd__btn:focus-visible,
.skd__btn[aria-expanded='true'] {
	background: rgba(255, 255, 255, 0.08);
	outline: none;
}

.skd-dot {
	display: inline-block;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	box-sizing: border-box;
	flex: 0 0 auto;
}

.skd-dot--unmet {
	background: transparent;
	border: 2px solid var(--skd-none, #8b95b8);
}

.skd-dot--practiced {
	background: var(--skd-good, #4ade80);
}

.skd-dot--shaky {
	background: var(--skd-warn, #fbbf24);
}

/* In the row a dot is 18px, or most of its button's width when the row is crowded. */
.skd__btn .skd-dot {
	width: min(18px, 70%);
	height: auto;
	aspect-ratio: 1;
}

/* A skill the open card cites: a sky ring around the dot, whatever its status. */
.skd-dot--ring {
	box-shadow:
		0 0 0 2px #0b0f1c,
		0 0 0 4px #7dd3fc;
}

/* Compact, for the IDE's card panel: every dot on one row, always. The buttons share the row's
   width (up to 28px each) and never wrap; each dot is 10px or, when the row is crowded, most of
   its button's width, so a long quiz or a narrow drawer shrinks the dots instead of adding a row. */
.skd--compact {
	margin: 4px 0 8px;
}

.skd--compact .skd__title {
	font-size: 11px;
	margin-bottom: 0;
}

.skd--compact .skd__dots {
	flex-wrap: nowrap;
	gap: 0;
}

.skd--compact .skd__btn {
	flex: 1 1 0;
	min-width: 0;
	max-width: 28px;
	width: auto;
	height: 28px;
	border-radius: 6px;
}

.skd--compact .skd__btn .skd-dot {
	width: min(10px, 70%);
	height: auto;
	aspect-ratio: 1;
}

.skd--compact .skd-dot--unmet {
	border-width: 1.5px;
}

.skd--compact .skd-dot--ring {
	box-shadow:
		0 0 0 1.5px #0b0f1c,
		0 0 0 3px #7dd3fc;
}

.skd--compact .skd__legend {
	font-size: 12px;
	gap: 2px 12px;
	margin-top: 2px;
}

.skd--compact .skd__legend .skd-dot {
	width: 9px;
	height: 9px;
}

@media (pointer: coarse) {
	.skd--compact .skd__btn {
		height: 36px;
	}
}

.skd__legend {
	font-size: 12px;
	gap: 4px 12px;
}

@media (pointer: coarse) {
	.skd--compact .skd__btn {
		width: 44px;
		height: 44px;
	}
}

.skd__legend {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px 16px;
	margin: 4px 0 0;
	font-size: 13px;
	color: var(--skd-none);
}

.skd__legend span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.skd__legend .skd-dot {
	width: 12px;
	height: 12px;
}

.skd-tip {
	position: fixed;
	z-index: 100002;
	display: none;
	max-width: 260px;
	padding: 8px 10px;
	border-radius: 8px;
	border: 1px solid #3a4670;
	background: #0b0f1c;
	color: #e8ecf8;
	font: 13px/1.4 'DM Sans', system-ui, sans-serif;
	pointer-events: none;
}

.skd-tip strong,
.skd-tip span {
	display: block;
}

.skd-tip__meta {
	color: #8b95b8;
	font-size: 12px;
}

.skd-panel {
	position: absolute;
	z-index: 100003;
	width: min(340px, calc(100vw - 16px));
	padding: 12px 14px;
	border-radius: 12px;
	border: 1px solid #3a4670;
	background: #141a2e;
	color: #e8ecf8;
	font: 14px/1.45 'DM Sans', system-ui, sans-serif;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
	box-sizing: border-box;
}

.skd-panel__head {
	display: flex;
	align-items: center;
	gap: 8px;
}

.skd-panel__head strong {
	flex: 1;
	overflow-wrap: anywhere;
}

.skd-panel__close {
	width: 44px;
	height: 44px;
	margin: -10px -10px -10px 0;
	border: 0;
	background: transparent;
	color: #8b95b8;
	cursor: pointer;
}

.skd-panel__meta,
.skd-panel__label {
	margin: 6px 0 0;
	font-size: 12px;
	color: #8b95b8;
}

.skd-panel__label {
	text-transform: uppercase;
	letter-spacing: 0.06em;
	margin-top: 10px;
}

.skd-panel__why {
	margin: 4px 0 0;
}

.skd-panel__list {
	list-style: none;
	margin: 6px 0 0;
	padding: 0;
}

.skd-res {
	display: flex;
	flex-direction: column;
	justify-content: center;
	width: 100%;
	min-height: 44px;
	padding: 6px 10px;
	margin: 0 0 4px;
	border: 1px solid #3a4670;
	border-radius: 8px;
	background: transparent;
	color: #e8ecf8;
	font: inherit;
	text-align: left;
	text-decoration: none;
	box-sizing: border-box;
	cursor: pointer;
}

.skd-res:hover,
.skd-res:focus-visible {
	border-color: #7dd3fc;
	outline: none;
}

.skd-res[disabled] {
	cursor: default;
	opacity: 0.75;
}

/* An in-class card cannot be worked at home, so it reads a step behind an at-home card. */
.skd-res__label--in-class {
	color: var(--skd-none);
}
.skd-res__kind .where-icon {
	vertical-align: -2px;
	margin-right: 5px;
}
.skd-res__kind {
	font-size: 11px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #8b95b8;
}

.skd-res__act {
	font-size: 12px;
	color: #7dd3fc;
}

.skd-nudge {
	position: fixed;
	inset: 0;
	z-index: 100001;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(5, 8, 18, 0.7);
}

.skd-nudge__card {
	width: min(480px, 100%);
	padding: 20px;
	border-radius: 14px;
	border: 1px solid #3a4670;
	background: #141a2e;
	color: #e8ecf8;
	font: 15px/1.5 'DM Sans', system-ui, sans-serif;
	box-sizing: border-box;
}

.skd-nudge__card h2 {
	margin: 0 0 6px;
	font-size: 20px;
}

.skd-nudge__card p {
	margin: 0;
}

.skd-nudge__go {
	min-height: 44px;
	padding: 0 20px;
	margin-top: 8px;
	border: 0;
	border-radius: 10px;
	background: #7c5cff;
	color: #ffffff;
	font: 600 15px 'DM Sans', system-ui, sans-serif;
	cursor: pointer;
}

@media print {
	.skd,
	.skd-tip,
	.skd-panel,
	.skd-nudge {
		display: none !important;
	}
}
