.tg-app {
	--tg-ink: #26383d;
	--tg-muted: #60747a;
	--tg-teal: #167377;
	--tg-teal-dark: #0d5558;
	--tg-teal-soft: #e5f6f3;
	--tg-coral: #ed765f;
	--tg-coral-soft: #fff0eb;
	--tg-yellow: #f6c84f;
	--tg-line: #d8e5e4;
	--tg-paper: #ffffff;
	box-sizing: border-box;
	padding: clamp(20px, 4vw, 38px);
	margin: 2.5rem 0;
	color: var(--tg-ink);
	border: 1px solid rgba(22, 115, 119, 0.16);
	border-radius: 26px;
	background:
		radial-gradient(circle at 100% 0, rgba(246, 200, 79, 0.17), transparent 20rem),
		#f7fbfa;
	box-shadow: 0 16px 40px rgba(28, 82, 83, 0.1);
	font-family: "BIZ UDPGothic", "Yu Gothic", Meiryo, system-ui, sans-serif;
	line-height: 1.7;
}

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

.tg-app [hidden] {
	display: none !important;
}

.tg-app button,
.tg-app input,
.tg-app select {
	font: inherit;
}

.tg-app button,
.tg-app a {
	-webkit-tap-highlight-color: transparent;
}

.tg-app button:focus-visible,
.tg-app a:focus-visible,
.tg-app input:focus-visible,
.tg-app select:focus-visible,
.tg-app [tabindex="-1"]:focus {
	outline: 4px solid rgba(246, 200, 79, 0.82);
	outline-offset: 3px;
}

.tg-app__heading {
	max-width: 46rem;
	margin: 0 auto 28px;
	text-align: center;
}

.tg-app__heading h2,
.tg-app__heading p,
.tg-app h3,
.tg-app h4 {
	margin-top: 0;
}

.tg-app__heading h2 {
	margin-bottom: 8px;
	font-size: clamp(1.65rem, 5vw, 2.35rem);
	line-height: 1.3;
}

.tg-app__heading p:last-child {
	margin-bottom: 0;
	color: var(--tg-muted);
}

.tg-app__eyebrow {
	margin: 0 0 4px;
	color: var(--tg-teal-dark);
	font-size: 0.82rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.tg-app__button {
	display: inline-flex;
	min-height: 48px;
	align-items: center;
	justify-content: center;
	padding: 10px 20px;
	color: var(--tg-teal-dark);
	border: 2px solid var(--tg-teal);
	border-radius: 13px;
	background: var(--tg-paper);
	font-weight: 800;
	cursor: pointer;
}

.tg-app__button:hover {
	background: var(--tg-teal-soft);
}

.tg-app__button--primary {
	color: #fff;
	background: var(--tg-teal);
}

.tg-app__button--primary:hover {
	border-color: var(--tg-teal-dark);
	background: var(--tg-teal-dark);
}

.tg-app__notice,
.tg-app__details,
.tg-label__privacy {
	padding: 15px 18px;
	border-radius: 14px;
	background: var(--tg-teal-soft);
}

.tg-app__details {
	margin-top: 26px;
}

.tg-app__details summary {
	cursor: pointer;
	font-weight: 800;
}

.tg-app__details p {
	margin-bottom: 0;
}

.tg-app__privacy {
	margin: 18px 0 0;
	color: var(--tg-muted);
	font-size: 0.86rem;
	text-align: center;
}

.tg-quiz__screen {
	min-height: 420px;
	padding: clamp(20px, 5vw, 44px);
	border: 1px solid var(--tg-line);
	border-radius: 22px;
	background: rgba(255, 255, 255, 0.95);
	text-align: center;
}

.tg-quiz__mark {
	display: grid;
	width: 132px;
	height: 132px;
	place-items: center;
	margin: 0 auto 22px;
	color: var(--tg-coral);
	border: 9px solid var(--tg-teal-soft);
	border-radius: 50%;
	background: #fff;
	box-shadow: inset 0 0 0 3px var(--tg-teal);
	font-size: 2.55rem;
	font-weight: 900;
}

.tg-quiz__screen > p {
	max-width: 38rem;
	margin-right: auto;
	margin-left: auto;
}

.tg-quiz__progress {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 12px;
	align-items: center;
	margin-bottom: 28px;
}

.tg-quiz__track {
	height: 12px;
	overflow: hidden;
	border-radius: 999px;
	background: #e8eeee;
}

.tg-quiz__track span {
	display: block;
	width: 0;
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, var(--tg-teal), #49aaa2);
	transition: width 180ms ease;
}

.tg-quiz__progress b {
	min-width: 4.6rem;
	color: var(--tg-muted);
	text-align: right;
}

.tg-quiz__question {
	display: grid;
	min-height: 6.2em;
	place-items: center;
	margin-bottom: 24px;
	font-size: clamp(1.25rem, 4.5vw, 1.85rem);
	line-height: 1.6;
}

.tg-quiz__answers {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	max-width: 580px;
	margin: 0 auto;
}

.tg-quiz__answers button {
	min-height: 116px;
	padding: 12px;
	color: var(--tg-ink);
	border: 3px solid var(--tg-line);
	border-radius: 20px;
	background: #fff;
	font-weight: 900;
	cursor: pointer;
}

.tg-quiz__answers button:hover:not(:disabled),
.tg-quiz__answers button.is-selected {
	border-color: var(--tg-teal);
	background: var(--tg-teal-soft);
}

.tg-quiz__answers button:disabled {
	cursor: default;
	opacity: 0.68;
}

.tg-quiz__answers button.is-selected {
	opacity: 1;
}

.tg-quiz__answers span {
	display: block;
	color: var(--tg-coral);
	font-size: 2.8rem;
	line-height: 1;
}

.tg-quiz__answers button:last-child span {
	color: var(--tg-teal);
}

.tg-quiz__feedback {
	max-width: 650px;
	padding: 17px 19px;
	margin: 24px auto 20px;
	border-radius: 15px;
	background: var(--tg-teal-soft);
	text-align: left;
}

.tg-quiz__feedback[data-result="incorrect"] {
	background: var(--tg-coral-soft);
}

.tg-quiz__feedback h4 {
	margin-bottom: 4px;
	color: #14755b;
	font-size: 1.12rem;
}

.tg-quiz__feedback[data-result="incorrect"] h4 {
	color: #a53b37;
}

.tg-quiz__feedback p {
	margin-bottom: 7px;
}

.tg-quiz__score {
	display: grid;
	width: 170px;
	height: 170px;
	place-items: center;
	margin: 0 auto 22px;
	color: var(--tg-teal-dark);
	border-radius: 50%;
	background: linear-gradient(145deg, var(--tg-teal-soft), var(--tg-coral-soft));
	font-size: 2.35rem;
	font-weight: 900;
}

.tg-label__workspace {
	display: grid;
	grid-template-columns: minmax(250px, 0.8fr) minmax(340px, 1.2fr);
	gap: 22px;
	align-items: start;
}

.tg-label__controls,
.tg-label__preview {
	padding: clamp(18px, 3vw, 26px);
	border: 1px solid var(--tg-line);
	border-radius: 20px;
	background: rgba(255, 255, 255, 0.95);
}

.tg-label__controls > label {
	display: block;
	margin: 0 0 7px;
	font-weight: 800;
}

.tg-label__controls > input,
.tg-label__controls > select {
	width: 100%;
	min-height: 46px;
	padding: 9px 12px;
	margin-bottom: 5px;
	color: var(--tg-ink);
	border: 2px solid var(--tg-line);
	border-radius: 11px;
	background: #fff;
}

.tg-label__controls > select {
	margin-bottom: 18px;
}

.tg-label__help,
.tg-label__status {
	margin: 0 0 18px;
	color: var(--tg-muted);
	font-size: 0.84rem;
}

.tg-label__controls fieldset {
	padding: 0;
	margin: 0 0 18px;
	border: 0;
}

.tg-label__controls legend {
	margin-bottom: 7px;
	font-weight: 800;
}

.tg-label__choices {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.tg-label__choices label {
	display: inline-flex;
	min-height: 40px;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	border: 1px solid var(--tg-line);
	border-radius: 999px;
	background: #fff;
	cursor: pointer;
}

.tg-label__choices label:has(input:checked) {
	border-color: var(--tg-teal);
	background: var(--tg-teal-soft);
}

.tg-label__swatch {
	width: 17px;
	height: 17px;
	border-radius: 50%;
}

.tg-label__swatch--teal {
	background: #167377;
}

.tg-label__swatch--coral {
	background: #ed765f;
}

.tg-label__swatch--navy {
	background: #386a9a;
}

.tg-label__privacy {
	margin: 4px 0 18px;
}

.tg-label__privacy p {
	margin: 3px 0 0;
	font-size: 0.86rem;
}

.tg-label__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 10px;
}

.tg-label__actions .tg-app__button {
	min-height: 44px;
	padding: 8px 13px;
	font-size: 0.88rem;
}

.tg-label__preview-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
}

.tg-label__preview-heading h3,
.tg-label__preview-heading p {
	margin: 0;
}

.tg-label__preview-heading b {
	padding: 4px 10px;
	color: var(--tg-teal-dark);
	border-radius: 999px;
	background: var(--tg-teal-soft);
}

.tg-label__sheet {
	--tg-label-columns: 2;
	--tg-label-rows: 4;
	display: grid;
	grid-template-columns: repeat(var(--tg-label-columns), minmax(0, 1fr));
	grid-template-rows: repeat(var(--tg-label-rows), minmax(0, 1fr));
	gap: 1.8%;
	width: 100%;
	aspect-ratio: 210 / 297;
	padding: 3.8%;
	border: 1px solid #cfd7d6;
	background: #fff;
	box-shadow: 0 9px 28px rgba(38, 56, 61, 0.11);
}

.tg-label__item {
	display: flex;
	min-width: 0;
	align-items: center;
	justify-content: center;
	gap: 7%;
	padding: 5%;
	color: var(--tg-ink);
	border: 1.5px solid var(--tg-teal);
	border-radius: 11px;
	background: var(--tg-teal-soft);
	overflow: hidden;
}

.tg-label__sheet[data-theme="coral"] .tg-label__item {
	border-color: var(--tg-coral);
	background: var(--tg-coral-soft);
}

.tg-label__sheet[data-theme="navy"] .tg-label__item {
	border-color: #386a9a;
	background: #e9f2fb;
}

.tg-label__item > span:last-child {
	min-width: 0;
	overflow: hidden;
	font-size: calc(1rem * var(--tg-name-scale, 1));
	font-weight: 800;
	line-height: 1.25;
	text-align: center;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tg-label__sheet[data-layout="large"] .tg-label__item > span:last-child {
	font-size: calc(1.45rem * var(--tg-name-scale, 1));
}

.tg-label__sheet[data-layout="small"] .tg-label__item {
	gap: 4%;
	padding: 3%;
}

.tg-label__sheet[data-layout="small"] .tg-label__item > span:last-child {
	font-size: calc(0.72rem * var(--tg-name-scale, 1));
}

.tg-label__motif {
	display: grid;
	flex: 0 0 auto;
	width: 28px;
	height: 28px;
	place-items: center;
	color: var(--tg-teal);
	font-size: 1.25rem;
	font-weight: 900;
}

.tg-label__sheet[data-theme="coral"] .tg-label__motif {
	color: var(--tg-coral);
}

.tg-label__sheet[data-theme="navy"] .tg-label__motif {
	color: #386a9a;
}

.tg-label__motif--twins {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 3px;
	border: 2px solid currentColor;
	border-radius: 50%;
}

.tg-label__motif--twins i {
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: currentColor;
}

@media (max-width: 760px) {
	.tg-label__workspace {
		grid-template-columns: 1fr;
	}

	.tg-label__preview {
		padding: 14px;
	}
}

@media (max-width: 520px) {
	.tg-app {
		padding: 16px 12px;
		border-radius: 20px;
	}

	.tg-quiz__screen {
		min-height: 440px;
		padding: 20px 12px;
	}

	.tg-quiz__answers {
		gap: 9px;
	}

	.tg-quiz__answers button {
		min-height: 105px;
		padding: 8px;
		font-size: 0.88rem;
	}

	.tg-app__button {
		width: 100%;
	}

	.tg-label__controls {
		padding: 16px 13px;
	}

	.tg-label__item {
		gap: 3%;
		border-radius: 7px;
	}

	.tg-label__motif {
		width: 20px;
		height: 20px;
		font-size: 0.9rem;
	}

	.tg-label__motif--twins i {
		width: 3px;
		height: 3px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tg-app *,
	.tg-app *::before,
	.tg-app *::after {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}
}
