/* ===== ADDED: colour theme picker ===== */
.topbar-actions {
	gap: 16px;
}

.palette-picker {
	display: flex;
	gap: 8px;
	align-items: center;
}

.swatch {
	width: 24px;
	height: 24px;
	padding: 0;
	border: 2px solid var(--ink);
	border-radius: 0;
	cursor: pointer;
	box-shadow: 2px 2px 0 var(--ink);
}

.swatch:hover {
	transform: translate(-1px, -1px);
}

@media (max-width: 680px) {
	.topbar,
	.topbar-actions {
		flex-wrap: wrap;
	}

	.palette-picker {
		gap: 6px;
	}
}

/* ===== RESTYLE v3: dark app look, rounded, pill buttons ===== */
body {
	background-image: none;
	font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
	font-size: 14px;
}
h1,
h2,
h3,
.name,
.rank,
.hm-year,
.bigstat .num,
.dropzone strong,
.pattern-card .pattern-value,
.explanation-card h2 {
	font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
	font-weight: 800;
	letter-spacing: -0.02em;
}
h1 {
	font-size: clamp(32px, 5.5vw, 56px);
	line-height: 1.05;
	margin: 6px 0;
}
h2 {
	font-size: 16px;
	font-weight: 500;
	margin: 4px 0;
	color: var(--ink-soft);
	letter-spacing: 0;
}

.brand .eyebrow,
.reyebrow,
label,
.section-title,
.pattern-section h3,
.stamp,
.mode-btn,
.results-tab,
.topn-btn,
.tab,
button.primary,
button.apply-btn,
.theme-toggle,
.pattern-card .pattern-label,
.cmp-row.head,
.explanation-card h3,
.disconnect,
.privacy-note,
.note,
.progress,
.search-result,
.bigstat .lbl,
.bigstat .sub,
.year-label,
.year-val,
.pattern-time,
.date-sep,
.affinity-num,
.placeholder,
.hm-months,
.hm-legend,
.pattern-card .pattern-detail,
input,
select {
	font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
	text-transform: none;
	letter-spacing: 0;
}
.error {
	position: fixed;
	z-index: 100000000;
	right: 15px;
	min-width: 200;
	min-height: 50;
	padding: 10px;
	background-color: #f83849;
	border: solid 1.5px #ff727e;
	bottom: 15px;
	display: none; /* Hidden by default */
	will-change: opacity, transform;
	transition: all 1.5s;
}
.brand .eyebrow,
.reyebrow {
	font-size: 12px;
	font-weight: 700;
}

label {
	font-size: 12px;
	font-weight: 700;
}
.privacy-note,
.note,
.progress,
.error,
.search-result,
.bigstat .lbl,
.bigstat .sub,
.year-label,
.year-val,
.pattern-time,
.date-sep,
.affinity-num {
	font-size: 12px;
	font-weight: 400;
}
.subhead {
	font-size: 14px;
	font-weight: 400;
}

.topbar {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 28px;
	padding: 28px 28px 24px;
	margin-bottom: 18px;
	position: relative;
	border: 0;
	border-radius: 12px;
	background: linear-gradient(to top right, var(--accent-3) 0%, var(--accent-4) 100%);
}
/* .topbar::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 7px;
	height: 100%;
	border-radius: 12px 0 0 12px;
	background: linear-gradient(to top, #0d3b19 0%, #168a40 100%);
} */

.card,
.pattern-card,
.explanation-card,
.cmp-table {
	border: 0;
	border-radius: 10px;
	box-shadow: none !important;
}
.card,
.pattern-card,
.explanation-card {
	background: var(--surface);
}
.dom-bar {
	border: 0;
	border-radius: 999px;
	overflow: hidden;
}

.modes,
.results-tabs {
	border: 0;
	background: transparent;
	gap: 8px;
	flex-wrap: wrap;
}
.mode-btn,
.results-tab,
.topn-btn {
	min-width: 0;
	padding: 8px 16px;
	font-size: 13px;
	font-weight: 700;
	border: 0;
	border-radius: 999px;
	background: var(--surface-2);
	color: var(--ink);
}
.mode-btn + .mode-btn,
.results-tab + .results-tab,
.topn-btn + .topn-btn {
	border-left: 0;
}
.mode-btn:hover,
.results-tab:hover,
.topn-btn:hover {
	background: var(--border);
}
.mode-btn.active,
.results-tab.active,
.topn-btn.active {
	background: var(--ink);
	color: var(--bg);
}

.theme-toggle {
	border: 0;
	border-radius: 999px;
	background: var(--surface-2);
	box-shadow: none;
	font-size: 12px;
	font-weight: 700;
	height: 36px;
}
.theme-toggle:active {
	transform: scale(0.97);
	box-shadow: none;
}
.swatch {
	border: 0;
	border-radius: 50%;
	box-shadow: none;
}
.swatch.active {
	outline: 2px solid var(--ink);
	outline-offset: 2px;
}
.swatch:hover {
	transform: scale(1.1);
}

.tab {
	border: 0;
	border-radius: 999px;
	background: var(--surface-2);
	font-size: 12px;
	font-weight: 700;
	padding: 9px 8px;
}
.tab:hover {
	background: var(--border);
}
.tab.active {
	background: var(--ink);
	color: var(--bg);
}
.tab.type-tab.active,
.tab.preset-tab.active {
	background: var(--accent);
	color: #000;
}

input[type='text'],
input[type='date'],
.cmp-controls select {
	border: 1px solid transparent;
	border-radius: 8px;
	background: var(--surface-2);
	font-size: 13px;
	font-weight: 400;
}
input[type='text']:focus,
input[type='date']:focus {
	border-color: var(--ink);
	outline: none;
}
.dropzone {
	border: 2px dashed var(--border);
	border-radius: 10px;
	background: transparent;
}
.dropzone:hover {
	border-color: var(--accent);
}
.dropzone strong {
	font-size: 18px;
}
.dropzone p {
	font-size: 13px;
	font-weight: 400;
}

button.primary,
button.apply-btn {
	border: 0;
	border-radius: 999px;
	background: var(--accent);
	color: #000;
	font-size: 13px;
	font-weight: 700;
}
html[data-theme='dark'] button.primary,
html[data-theme='dark'] button.apply-btn {
	color: #000;
}
button.primary:hover,
button.apply-btn:hover {
	background: var(--accent);
	filter: brightness(1.1);
	transform: scale(1.02);
}

.stamp {
	border-radius: 999px;
	border: 0;
	background: var(--surface-2);
	color: var(--ink);
	font-size: 11px;
	padding: 4px 10px;
}
.error {
	border-radius: 8px;
}
.search-result {
	border-left: 0;
	border-radius: 8px;
}
.bigstat .num {
	font-size: clamp(36px, 6vw, 58px);
	line-height: 1;
}
.section-title,
.pattern-section h3 {
	font-size: 20px;
	font-weight: 800;
	color: var(--ink);
	border-bottom: 0;
}

.item:hover {
	transform: none;
	background: var(--surface-2);
}
.rank {
	font-size: 16px;
	font-weight: 400;
	color: var(--ink-soft);
}
.name {
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0;
}
.sub {
	font-size: 12px;
	font-weight: 400;
}
.art {
	border-radius: inherit;
}
.bar-track,
.pattern-track,
.year-bar-track {
	border-radius: 999px;
}
.bar-fill,
.pattern-fill,
.year-bar-fill {
	border-radius: 999px;
}
.year-bar-fill {
	background: var(--accent);
}

.pattern-row {
	font-size: 13px;
	font-weight: 400;
}
.pattern-card .pattern-detail {
	font-size: 13px;
	font-weight: 400;
}
.pattern-card .pattern-label {
	font-size: 12px;
	font-weight: 700;
}
.cmp-row {
	font-size: 13px;
	font-weight: 400;
	border-bottom-color: var(--surface-2);
}
.cmp-row.head {
	font-size: 11px;
}
.tl-item {
	border-left: 0;
	border-radius: 8px;
	background: var(--surface);
}
.hm-c {
	border-radius: 2px;
	border: 0;
}

.explanation-card h2 {
	font-size: clamp(26px, 4vw, 38px);
	line-height: 1.1;
}
.explanation-card h3 {
	font-size: 17px;
	font-weight: 800;
	color: var(--ink);
	border-bottom: 0;
}
.explanation-card p,
.explanation-card li {
	font-size: 14px;
	line-height: 1.7;
	font-weight: 400;
}
.explanation-card strong {
	font-weight: 700;
}
.explanation-callout {
	border-left: 0;
	border-radius: 8px;
}
.foot-row {
	border-top: 1px solid var(--surface-2);
}

@media (max-width: 680px) {
	.card {
		box-shadow: none !important;
	}
	.topbar {
		padding: 20px 16px;
		border-left-width: 0;
	}
}

/* ===== HOVER OUTLINE: 1px invisible by default, so nothing shifts on hover ===== */
.mode-btn,
.results-tab,
.topn-btn,
.tab,
.theme-toggle,
button.primary,
button.apply-btn,
.card,
.pattern-card,
.explanation-card,
.item,
.tl-item,
.dropzone,
.cmp-table,
.disconnect,
input[type='text'],
input[type='date'],
.cmp-controls select,
.hm-c {
	outline: 1px solid transparent;
	outline-offset: -1px;
	transition:
		outline-color 0.25s ease,
		background-color 0.25s ease,
		filter 0.25s ease,
		transform 0.25s ease;
}
.dropzone {
	transition:
		outline-color 0.25s ease,
		border-color 0.25s ease,
		background 0.25s ease;
}
.mode-btn:hover,
.results-tab:hover,
.topn-btn:hover,
.tab:hover,
.theme-toggle:hover,
button.primary:hover,
button.apply-btn:hover,
.card:hover,
.pattern-card:hover,
.explanation-card:hover,
.item:hover,
.tl-item:hover,
.dropzone:hover,
.cmp-table:hover,
.disconnect:hover,
input[type='text']:hover,
input[type='date']:hover,
.cmp-controls select:hover,
.hm-c:hover {
	outline-color: color-mix(in srgb, var(--ink) 22%, transparent);
}
.swatch {
	transition:
		outline-color 0.25s ease,
		transform 0.25s ease;
}
.swatch:not(.active):hover {
	outline: 1px solid color-mix(in srgb, var(--ink) 35%, transparent);
	outline-offset: 2px;
}