.ttg {
	--ttg-ink: #1d1b2b;
	--ttg-muted: #5b5870;
	--ttg-surface: #ffffff;
	--ttg-soft: #f4f2f8;
	--ttg-line: #dcd8e6;
	--ttg-accent: #57508a;
	--ttg-accent-soft: #ece9f6;
	--ttg-warm: #c46a1b;
	--ttg-good: #1f7a55;
	--ttg-bad: #b4342c;
	--ttg-radius: 12px;
	box-sizing: border-box;
	width: 100%;
	max-width: 860px;
	margin: 0 auto;
	padding: 8px 0 48px;
	color: var(--ttg-ink);
	font-size: 17px;
	line-height: 1.6;
	text-align: left;
}

.ttg *,
.ttg *::before,
.ttg *::after {
	box-sizing: border-box;
}

.ttg [hidden] {
	display: none !important;
}

.ttg h1,
.ttg h2 {
	margin: 0 0 12px;
	color: var(--ttg-ink);
	line-height: 1.25;
}

.ttg h1 {
	font-size: clamp(28px, 6vw, 40px);
}

.ttg h2 {
	font-size: clamp(21px, 4vw, 26px);
}

.ttg p {
	margin: 0 0 14px;
}

.ttg a {
	color: var(--ttg-accent);
}

.ttg-head {
	margin-bottom: 20px;
}

.ttg-kicker {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	color: var(--ttg-muted);
	font-size: 14px;
}

.ttg-count {
	margin-left: auto;
}

.ttg-lead {
	color: var(--ttg-muted);
	font-size: 19px;
}

.ttg-definition {
	font-size: clamp(18px, 2.6vw, 21px);
	line-height: 1.55;
}

.ttg-aside {
	color: var(--ttg-muted);
	font-size: 15px;
}

.ttg-text,
.ttg-map,
.ttg-shop,
.ttg-next {
	margin-top: 40px;
}

/* Lessons: one step at a time once the script runs */

.ttg-ready .ttg-step {
	display: none;
}

.ttg-ready .ttg-step.is-active {
	display: block;
}

.ttg-step + .ttg-step {
	margin-top: 28px;
}

.ttg-ready .ttg-step + .ttg-step {
	margin-top: 0;
}

.ttg .ttg-task {
	padding: 10px 14px;
	border-left: 4px solid var(--ttg-warm);
	background: var(--ttg-soft);
	font-weight: 600;
}

.ttg-player {
	margin-top: 20px;
}

.ttg:not(.ttg-ready) .ttg-controls {
	display: none;
}

.ttg-stage {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.ttg-screen {
	position: relative;
}

.ttg .ttg-canvas {
	display: block;
	width: 100%;
	height: clamp(280px, 56vw, 470px);
	border: 1px solid var(--ttg-line);
	border-radius: var(--ttg-radius);
	background: #efe9e1;
	cursor: default;
}

.ttg .ttg-deck-canvas {
	background: radial-gradient(ellipse at 50% 35%, #f6f1ea 0%, #ddd3c6 100%);
	cursor: pointer;
}

.ttg .ttg-groove-canvas {
	background: #0d0d10;
}

.ttg .ttg-drive-canvas {
	background: radial-gradient(ellipse at 50% 40%, #f6f1ea 0%, #d9d0c3 100%);
}

.ttg .ttg-clean-canvas {
	height: clamp(300px, 70vw, 520px);
	background: radial-gradient(ellipse at 50% 40%, #f6f1ea 0%, #d9d0c3 100%);
}

.ttg .ttg-grab {
	cursor: grab;
	touch-action: none;
}

.ttg .ttg-cart-canvas,
.ttg .ttg-speaker-canvas {
	height: clamp(260px, 46vw, 380px);
	background: #f4f6f9;
}

.ttg-controls {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 16px;
}

.ttg-dots {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}

.ttg .ttg-dots button {
	width: 12px;
	height: 12px;
	min-height: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background-color: var(--ttg-line);
	cursor: pointer;
}

.ttg .ttg-dots button.is-done {
	background-color: #a9a3c9;
}

.ttg .ttg-dots button.is-active {
	background-color: var(--ttg-accent);
}

.ttg-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 16px;
}

.ttg-hint {
	color: var(--ttg-muted);
	font-size: 14px;
}

/* Buttons and inputs */

.ttg .ttg-btn {
	min-height: 44px;
	padding: 8px 18px;
	border: 1px solid var(--ttg-line);
	border-radius: 999px;
	background: var(--ttg-surface);
	color: var(--ttg-ink);
	font: inherit;
	font-size: 16px;
	line-height: 1.2;
	cursor: pointer;
}

.ttg .ttg-btn:hover:not(:disabled) {
	border-color: var(--ttg-accent);
}

.ttg .ttg-btn:focus-visible {
	outline: 3px solid var(--ttg-accent);
	outline-offset: 2px;
}

.ttg .ttg-btn:disabled {
	opacity: 0.45;
	cursor: default;
}

.ttg .ttg-btn-primary,
.ttg .ttg-play {
	border-color: var(--ttg-accent);
	background: var(--ttg-accent);
	color: #ffffff;
	font-weight: 600;
}

.ttg .ttg-play {
	min-width: 110px;
}

.ttg .ttg-play::before {
	content: "\25B6";
	margin-right: 8px;
	font-size: 12px;
}

.ttg .ttg-play.is-playing {
	background: var(--ttg-ink);
	border-color: var(--ttg-ink);
}

.ttg .ttg-play.is-playing::before {
	content: "\25A0";
}

.ttg .ttg-btn-sm {
	min-height: 36px;
	padding: 5px 13px;
	font-size: 14px;
}

.ttg .ttg-btn.is-on {
	border-color: var(--ttg-accent);
	background: var(--ttg-accent-soft);
	color: var(--ttg-accent);
	font-weight: 600;
}

.ttg-choice {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.ttg .ttg-choice .ttg-btn {
	text-align: left;
}

.ttg-choice-name,
.ttg-range-name {
	min-width: 130px;
	color: var(--ttg-muted);
	font-size: 14px;
	font-weight: 600;
}

.ttg-range {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 12px;
}

.ttg-bar .ttg-range {
	flex: 1 1 280px;
}

.ttg .ttg-range input {
	flex: 1 1 160px;
	accent-color: var(--ttg-accent);
}

.ttg-range-value {
	min-width: 70px;
	font-variant-numeric: tabular-nums;
	font-weight: 600;
}

.ttg-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 8px;
}

.ttg-stat {
	display: flex;
	flex-direction: column;
	padding: 10px 14px;
	border-radius: var(--ttg-radius);
	background: var(--ttg-soft);
	line-height: 1.3;
}

.ttg-stat b {
	font-size: 20px;
	font-variant-numeric: tabular-nums;
}

.ttg-stat span {
	color: var(--ttg-muted);
	font-size: 14px;
}

.ttg .ttg-banner {
	margin: 0;
	padding: 12px 16px;
	border: 2px solid var(--ttg-line);
	border-radius: var(--ttg-radius);
	font-weight: 600;
}

.ttg .ttg-banner.is-good {
	border-color: var(--ttg-good);
	background: #e8f5ee;
}

.ttg .ttg-banner.is-bad {
	border-color: var(--ttg-bad);
	background: #fbecea;
}

/* Parts diagram */

.ttg-part-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.ttg-info {
	display: flex;
	flex-direction: column;
	min-height: 5.2em;
	padding: 12px 16px;
	border-radius: var(--ttg-radius);
	background: var(--ttg-soft);
	line-height: 1.45;
}

.ttg-info span {
	color: var(--ttg-muted);
}

.ttg .ttg-chain {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: chain;
}

.ttg .ttg-chain li {
	margin: 0;
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--ttg-accent-soft);
	color: var(--ttg-accent);
	font-size: 14px;
	font-weight: 600;
}

.ttg .ttg-chain li + li::before {
	content: "\2192";
	margin-right: 8px;
	color: var(--ttg-muted);
}

.ttg-chart {
	padding: 8px;
	border: 1px solid var(--ttg-line);
	border-radius: var(--ttg-radius);
	background: #ffffff;
}

.ttg-chart svg {
	display: block;
	width: 100%;
	height: auto;
}

/* Questions and results */

.ttg-question {
	padding-bottom: 12px;
	border-bottom: 1px solid var(--ttg-line);
}

.ttg-question .ttg-choice-name {
	min-width: 100%;
	color: var(--ttg-ink);
	font-size: 16px;
}

.ttg-result {
	padding: 18px 20px;
	border: 2px solid var(--ttg-line);
	border-radius: var(--ttg-radius);
}

.ttg-result.is-yes {
	border-color: var(--ttg-warm);
	background: #fdf3ea;
}

.ttg-result.is-no {
	border-color: var(--ttg-good);
	background: #e8f5ee;
}

.ttg-result.is-check {
	border-color: var(--ttg-accent);
	background: var(--ttg-accent-soft);
}

.ttg .ttg-result h3 {
	margin: 0 0 8px;
	font-size: 20px;
}

.ttg .ttg-verdict {
	margin: 0 0 4px;
	color: var(--ttg-muted);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.ttg .ttg-chain-big li {
	padding: 10px 14px;
	background: #ffffff;
	color: var(--ttg-ink);
	font-size: 15px;
	box-shadow: 0 1px 3px rgba(29, 27, 43, 0.12);
}

.ttg .ttg-chain-big li.is-preamp {
	background: var(--ttg-accent);
	color: #ffffff;
}

.ttg-hear {
	padding: 16px 20px;
	border-radius: var(--ttg-radius);
	background: var(--ttg-soft);
}

.ttg .ttg-hear h3 {
	margin: 0 0 10px;
	font-size: 18px;
}

.ttg .ttg-hear .ttg-aside {
	margin: 10px 0 0;
}

.ttg-meter-box {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 14px;
	min-height: 220px;
	padding: 20px;
	border: 1px solid var(--ttg-line);
	border-radius: var(--ttg-radius);
	background: #ffffff;
}

.ttg-meter-row {
	display: grid;
	grid-template-columns: 140px minmax(0, 1fr) 80px;
	align-items: center;
	gap: 12px;
	font-size: 15px;
}

.ttg-meter {
	display: block;
	height: 14px;
	overflow: hidden;
	border-radius: 7px;
	background: var(--ttg-soft);
}

.ttg-meter i {
	display: block;
	height: 100%;
	background: var(--ttg-accent);
	transition: width 0.3s ease;
}

.ttg-noise-pic {
	display: flex;
	align-items: center;
	min-height: 160px;
	padding: 20px;
	border: 1px solid var(--ttg-line);
	border-radius: var(--ttg-radius);
	background: #ffffff;
}

@media (max-width: 600px) {
	.ttg-meter-row {
		grid-template-columns: minmax(0, 1fr) 70px;
	}

	.ttg-meter-row .ttg-meter {
		grid-column: 1 / -1;
		grid-row: 2;
	}
}

/* Text */

.ttg-text h2 {
	margin-top: 32px;
}

.ttg-text h2:first-child {
	margin-top: 0;
}

.ttg .ttg-text h3 {
	margin: 22px 0 6px;
	font-size: 18px;
}

.ttg .ttg-text ul,
.ttg .ttg-text ol {
	margin: 0 0 14px;
	padding-left: 22px;
}

.ttg-text li {
	margin-bottom: 6px;
}

.ttg .ttg-table {
	width: 100%;
	margin: 0 0 18px;
	border-collapse: collapse;
	font-size: 15px;
}

.ttg .ttg-table th,
.ttg .ttg-table td {
	padding: 8px 10px;
	border: 1px solid var(--ttg-line);
	text-align: left;
	vertical-align: top;
}

.ttg .ttg-table th {
	background: var(--ttg-soft);
}

.ttg-sources {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
	margin: 0 0 14px;
	color: var(--ttg-muted);
	font-size: 14px;
}

.ttg-sources span {
	font-weight: 600;
}

.ttg-longread {
	margin-top: 48px;
}

/* Shop, next, map */

.ttg-shop {
	padding: 20px;
	border-radius: var(--ttg-radius);
	background: var(--ttg-soft);
}

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

.ttg .ttg-chip {
	padding: 8px 14px;
	border: 1px solid var(--ttg-line);
	border-radius: 999px;
	background: var(--ttg-surface);
	font-size: 15px;
	text-decoration: none;
}

.ttg .ttg-next a {
	display: flex;
	flex-direction: column;
	padding: 14px 18px;
	border: 1px solid var(--ttg-accent);
	border-radius: var(--ttg-radius);
	text-align: right;
	text-decoration: none;
}

.ttg-next span {
	color: var(--ttg-muted);
	font-size: 14px;
}

.ttg-map {
	display: grid;
	gap: 28px;
}

.ttg .ttg-map ul,
.ttg .ttg-showcase ul {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ttg-map li,
.ttg-showcase li {
	display: flex;
	margin: 0;
}

.ttg .ttg-card {
	display: flex;
	width: 100%;
	min-height: 6.2em;
	flex-direction: column;
	padding: 12px 14px;
	border: 1px solid var(--ttg-line);
	border-radius: var(--ttg-radius);
	background: var(--ttg-soft);
	color: var(--ttg-ink);
	line-height: 1.35;
	text-decoration: none;
}

.ttg-card span {
	color: var(--ttg-muted);
	font-size: 14px;
}

.ttg a.ttg-card:hover,
.ttg a.ttg-card:focus-visible {
	border-color: var(--ttg-accent);
	box-shadow: 0 0 0 1px var(--ttg-accent);
}

.ttg .ttg-card.is-current {
	border-color: var(--ttg-accent);
	background: var(--ttg-accent-soft);
}

.ttg .ttg-card.is-soon {
	border-style: dashed;
	background: var(--ttg-surface);
}

.ttg-card em,
.ttg-tile-text em {
	margin-top: 4px;
	color: var(--ttg-warm);
	font-size: 13px;
}

.ttg-showcase {
	margin-top: 24px;
}

.ttg .ttg-showcase ul {
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 14px;
}

.ttg .ttg-tile {
	display: flex;
	width: 100%;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--ttg-line);
	border-radius: 14px;
	background: #ffffff;
	box-shadow: 0 2px 10px rgba(29, 27, 43, 0.08);
	color: var(--ttg-ink);
	line-height: 1.4;
	text-decoration: none;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ttg .ttg-tile:hover,
.ttg .ttg-tile:focus-visible {
	box-shadow: 0 10px 24px rgba(29, 27, 43, 0.18);
	transform: translateY(-3px);
}

.ttg .ttg-tile img {
	display: block;
	width: 100%;
	height: auto;
	margin: 0;
	aspect-ratio: 16 / 10;
	object-fit: cover;
}

.ttg .ttg-tile-text {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 12px 14px 14px;
}

.ttg .ttg-tile-text strong {
	font-size: 17px;
}

.ttg .ttg-tile-text span {
	margin-top: 4px;
	color: var(--ttg-muted);
	font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {
	.ttg .ttg-tile {
		transition: none;
	}
}

@media (max-width: 600px) {
	.ttg-choice-name,
	.ttg-range-name {
		min-width: 100%;
	}
}
