.tam-app {
	--tam-primary: #d85b93;
	--tam-primary-dark: #bd3f79;
	--tam-border: #ead8e1;
	--tam-surface: #fffafd;
	--tam-text: #3e3037;
	--tam-muted: #76666e;
	box-sizing: border-box;
	width: 100%;
	max-width: 900px;
	margin: 2rem auto;
	padding: clamp(1rem, 3vw, 2rem);
	color: var(--tam-text);
	border: 1px solid var(--tam-border);
	border-radius: 20px;
	background:
		radial-gradient(circle at top right, rgb(255 220 238 / 55%), transparent 32%),
		var(--tam-surface);
	box-shadow: 0 10px 30px rgb(93 48 69 / 8%);
}

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

.tam-panel {
	width: 100%;
}

.tam-label {
	display: inline-block;
	margin: 0 0 0.55rem;
	font-weight: 700;
	font-size: 1rem;
}

.tam-textarea {
	display: block;
	width: 100%;
	min-height: 220px;
	margin: 0;
	padding: 1rem;
	resize: vertical;
	overflow: auto;
	color: #272027;
	border: 2px solid var(--tam-border);
	border-radius: 12px;
	outline: none;
	background: #fff;
	font-family:
		"MS Gothic",
		"Yu Gothic UI",
		"Noto Sans Mono CJK JP",
		monospace;
	font-size: 16px;
	line-height: 1.7;
	white-space: pre;
	tab-size: 4;
	transition:
		border-color 0.2s ease,
		box-shadow 0.2s ease;
}

.tam-textarea:focus {
	border-color: var(--tam-primary);
	box-shadow: 0 0 0 4px rgb(216 91 147 / 12%);
}

.tam-output {
	background: #fff;
}

.tam-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.75rem;
	margin: 1.25rem 0;
}

.tam-button,
.tam-copy-button {
	appearance: none;
	min-height: 44px;
	padding: 0.7rem 1.25rem;
	cursor: pointer;
	border: 0;
	border-radius: 999px;
	font: inherit;
	font-weight: 700;
	line-height: 1.2;
	transition:
		transform 0.15s ease,
		box-shadow 0.15s ease,
		background-color 0.15s ease;
}

.tam-button:hover,
.tam-copy-button:hover:not(:disabled) {
	transform: translateY(-1px);
}

.tam-button:focus-visible,
.tam-copy-button:focus-visible {
	outline: 3px solid rgb(216 91 147 / 30%);
	outline-offset: 3px;
}

.tam-mirror-button {
	color: #fff;
	background: linear-gradient(135deg, var(--tam-primary), var(--tam-primary-dark));
	box-shadow: 0 6px 16px rgb(189 63 121 / 22%);
}

.tam-clear-button {
	color: #65525c;
	border: 1px solid var(--tam-border);
	background: #fff;
}

.tam-result-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.55rem;
}

.tam-result-heading .tam-label {
	margin: 0;
}

.tam-copy-button {
	min-height: 38px;
	padding: 0.5rem 1rem;
	color: var(--tam-primary-dark);
	border: 1px solid #e6a9c5;
	background: #fff;
}

.tam-copy-button:disabled {
	cursor: not-allowed;
	opacity: 0.45;
}

.tam-status {
	min-height: 1.5em;
	margin: 0.5rem 0 0;
	color: var(--tam-muted);
	font-size: 0.9rem;
	text-align: right;
}

.tam-status[data-type="success"] {
	color: #26734d;
}

.tam-status[data-type="error"] {
	color: #b22f3f;
}

.tam-note {
	margin: 1rem 0 0;
	color: var(--tam-muted);
	font-size: 0.9rem;
	text-align: center;
}

@media (max-width: 600px) {
	.tam-app {
		margin: 1rem auto;
		padding: 1rem;
		border-radius: 14px;
	}

	.tam-textarea {
		min-height: 180px;
		padding: 0.8rem;
		font-size: 15px;
	}

	.tam-actions {
		align-items: stretch;
		flex-direction: column;
	}

	.tam-button {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tam-button,
	.tam-copy-button,
	.tam-textarea {
		transition: none;
	}
}

