.card {
	position: relative;
	z-index: 2;
	background: var(--card);
	border-radius: 28px;
	overflow: hidden;
	box-shadow: 0 -6px 30px rgba(40, 50, 90, .12);
}

/* The card has three bands: the header says what the wheel is filled with, the main part is the pick, the dock holds the preferences. */
.card-header,
.card-dock {
	padding: 12px 18px;
	background: var(--dock);
}

.card-header {
	border-bottom: 1px solid var(--line);
}

.card-dock {
	display: flex;
	gap: 8px;
	border-top: 1px solid var(--line);
}

.card-main {
	padding: 18px;
}

.card-header-row {
	display: flex;
	align-items: center;
	gap: 8px;
}

.source-picker {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	margin: 12px 0;
}

/* The wheel settings sit above the GitHub account in groups (tilt, source, order), each set apart by a line. */
.settings-group {
	padding-bottom: 2px;
	border-bottom: 1px solid var(--line);
	margin-bottom: 14px;
}

.settings-group:first-child > .source-picker:first-child {
	margin-top: 0;
}

.source-picker[hidden] {
	display: none;
}

.source-label {
	min-width: 6.5rem;
	color: var(--mut);
	font-size: .8rem;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.source-picker select {
	flex: 1;
	min-width: 0;
	padding: 8px 10px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--card);
	color: var(--fg);
	font: inherit;
	font-size: .95rem;
	font-weight: 600;
	cursor: pointer;
}

.source-picker input[type="range"] {
	flex: 1;
	min-width: 0;
	margin: 0;
	accent-color: var(--accent);
	cursor: pointer;
}

.source-picker select:disabled {
	opacity: .5;
	cursor: default;
}

/* A settings button spans the row like the lists, its icon drawn in the same strokes as the dock's. */
.source-picker .secondary-button {
	display: inline-flex;
	flex: 1;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 0;
	margin-top: 0;
	padding: 8px 10px;
	border-radius: 12px;
	background: var(--card);
	font-size: .95rem;
}

.source-picker .secondary-button svg {
	flex: none;
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.meta {
	display: flex;
	justify-content: space-between;
	color: var(--mut);
	font-size: .95rem;
	font-weight: 600;
}

#result {
	flex: 1;
	min-width: 0;
	color: var(--mut);
	font-weight: 600;
}

.caption {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 10px;
	min-height: 5.6em;
}

.caption-swatch {
	flex: none;
	width: 14px;
	height: 14px;
	margin-top: calc((.95rem * 1.4 - 15px) / 2);
	border-radius: 50%;
}

.caption-swatch[hidden] {
	display: none;
}

.caption-text {
	min-width: 0;
}

.caption-repository {
	color: var(--mut);
	font-size: .95rem;
	font-weight: 600;
	line-height: 1.4;
}

.caption-title {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	overflow-wrap: anywhere;
	font-size: 1.2rem;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: -.01em;
}

/* Before the first spin, the block only holds a hint, in a quieter voice than an issue title. */
.caption.is-prompt .caption-title {
	color: var(--mut);
	font-size: 1rem;
	font-weight: 600;
}

.caption.is-winner .caption-title {
	display: block;
	overflow: visible;
}

.spin-button {
	display: block;
	width: 100%;
	padding: 16px;
	border: 0;
	border-radius: 18px;
	background: var(--btn);
	color: var(--btnfg);
	font: inherit;
	font-weight: 600;
	font-size: 1.05rem;
	cursor: pointer;
}

.spin-button:disabled {
	opacity: .5;
	cursor: default;
}

/* The first-visit guide: replaces the pick block while there is no valid token. */
.onboarding h2,
.account h2 {
	margin: 0 0 2px;
	font-size: 1.25rem;
	line-height: 1.25;
	letter-spacing: -.01em;
	text-wrap: balance;
}

.onboarding-lead {
	margin: 10px 0 16px;
	color: var(--mut);
	font-size: .95rem;
}

.steps {
	margin: 0;
	padding: 0;
	list-style: none;
}

.step {
	position: relative;
	display: grid;
	grid-template-columns: 28px minmax(0, 1fr);
	gap: 0 12px;
	padding-bottom: 16px;
}

.step:last-child {
	padding-bottom: 0;
}

/* The line joining the dots; the last step has nothing to join. */
.step::before {
	content: "";
	position: absolute;
	left: 13px;
	top: 30px;
	bottom: 2px;
	width: 2px;
	background: var(--line);
}

.step:last-child::before {
	display: none;
}

.step-dot {
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	border: 2px solid var(--line);
	border-radius: 50%;
	background: var(--card);
	color: var(--mut);
	font-size: .8rem;
	font-weight: 700;
}

.step.is-done .step-dot {
	border-color: var(--good);
	background: var(--good-soft);
	color: var(--good);
}

.step.is-active .step-dot {
	border-color: var(--accent);
	background: var(--accent);
	color: #fff;
}

.step-title {
	padding-top: 3px;
	font-weight: 700;
	line-height: 1.3;
}

.step-hint {
	margin: 2px 0 0;
	color: var(--mut);
	font-size: .9rem;
}

.chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 8px 0 10px;
}

.chip {
	padding: 2px 9px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--dock);
	color: var(--fg);
	font: 600 .78rem/1.6 ui-monospace, Menlo, Consolas, monospace;
}

.spin-button.is-link {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px;
	font-size: 1rem;
	text-decoration: none;
}

.is-link svg {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.token-field {
	position: relative;
	margin-top: 8px;
}

.token-field input {
	width: 100%;
	padding: 11px 74px 11px 12px;
	border: 1px solid var(--line);
	border-radius: 14px;
	background: var(--card);
	color: var(--fg);
	font: 14px/1.5 ui-monospace, Menlo, Consolas, monospace;
}

.token-field input::placeholder {
	color: var(--mut);
}

.token-field input[aria-invalid="true"] {
	border-color: var(--bad);
	background: var(--bad-soft);
}

.reveal-button {
	position: absolute;
	top: 50%;
	right: 6px;
	transform: translateY(-50%);
	padding: 5px 10px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: var(--accent-ink);
	font: inherit;
	font-size: .8rem;
	font-weight: 600;
	cursor: pointer;
}

.token-error {
	margin: 10px 0 0;
	padding: 9px 12px;
	border-radius: 12px;
	background: var(--bad-soft);
	color: var(--bad);
	font-size: .88rem;
	font-weight: 600;
	line-height: 1.4;
}

.token-error[hidden] {
	display: none;
}

.token-error-hint {
	display: block;
	margin-top: 2px;
	color: var(--fg);
	font-weight: 400;
	overflow-wrap: anywhere;
}

#connect-button {
	margin-top: 10px;
}

.trust {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 16px 0 0;
	color: var(--mut);
	font-size: .82rem;
	line-height: 1.45;
}

.trust svg {
	flex: none;
	width: 16px;
	height: 16px;
	margin-top: 2px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* The gear view: who is connected, and how to change it, with the account actions on the title's row. */
.account-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 2px;
}

.account-header h2 {
	margin: 0;
}

.account-actions {
	display: flex;
	gap: 6px;
}

.account-actions .secondary-button {
	margin-top: 0;
	padding: 6px 10px;
	border-radius: 10px;
	font-size: .85rem;
	text-decoration: none;
}

.account-actions .is-link svg {
	width: 14px;
	height: 14px;
}

/* A link styled as a button carries an outward arrow, so that it reads as leaving the page. */
.secondary-button.is-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.secondary-button.danger-button {
	border-color: var(--bad);
	color: var(--bad);
}

/* After a first click, the disconnect button fills up red and waits for a second one. */
.secondary-button.danger-button.is-armed {
	background: var(--bad);
	color: #fff;
}

.secondary-button {
	margin-top: 8px;
	padding: 10px 16px;
	border: 1px solid var(--line);
	border-radius: 14px;
	background: transparent;
	color: var(--fg);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.secondary-button:disabled {
	opacity: .5;
	cursor: default;
}

.card-header .secondary-button,
.card-dock .secondary-button {
	margin-top: 0;
}

.icon-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	font-size: 1.1rem;
	line-height: 1;
}

.icon-button svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/*
 * A toggle keeps the same look in both states and only gets a slash through its icon while off, so that the dim look stays
 * reserved for a disabled button; the zoom button looks the same way. The settings button looks lit while its panel is open.
 */
.icon-button[aria-pressed],
.icon-button[data-zoomed] {
	background: var(--card);
}

.icon-button[aria-expanded="true"] {
	background: #fff;
	color: #111218;
}

.icon-slash {
	display: none;
}

.icon-button[aria-pressed="false"] .icon-slash {
	display: inline;
}

/* The zoom button shows a plus while it would zoom in, and a minus while it would zoom out. */
.icon-button[data-zoomed="true"] .icon-zoom-in-bar {
	display: none;
}

.icon-button[hidden] {
	display: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
	outline: 3px solid #1a5adf;
	outline-offset: 2px;
}
