* {
	box-sizing: border-box;
}

html {
	overflow-x: hidden;
	overscroll-behavior-y: none;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	max-width: 700px;
	margin: 0 auto;
	padding: 1.5rem 1rem;
	background: #f5f7fa;
	color: #1a1a2e;
	-webkit-text-size-adjust: 100%;
	overflow-x: hidden;
}

h1 {
	text-align: center;
	margin-bottom: 2rem;
	color: #16213e;
	font-size: 1.5rem;
}

.input-section {
	background: white;
	padding: 1rem;
	border-radius: 12px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	margin-bottom: 1.5rem;
}

textarea {
	width: 100%;
	max-width: 100%;
	min-height: 150px;
	padding: 0.75rem;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	font-size: 0.9rem;
	font-family: inherit;
	resize: vertical;
	transition: border-color 0.2s;
}

textarea:focus {
	outline: none;
	border-color: #4a69bd;
}

textarea::placeholder {
	color: #aaa;
}

.textarea-wrapper {
	position: relative;
}

.btn-clean {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 28px;
	height: 28px;
	padding: 0;
	background: rgba(255, 255, 255, 0.9);
	border: 1px solid #ddd;
	border-radius: 6px;
	cursor: pointer;
	display: none;
	align-items: center;
	justify-content: center;
	transition: all 0.2s;
	z-index: 1;
}

.btn-clean:hover {
	background: #f0f4ff;
	border-color: #4a69bd;
}

.btn-clean.visible {
	display: flex;
}

.btn-clean svg {
	width: 16px;
	height: 16px;
	color: #666;
}

.btn-clean:hover svg {
	color: #4a69bd;
}

.ai-section {
	background: white;
	padding: 1rem;
	border-radius: 12px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	margin-bottom: 1rem;
}

.section-header {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
	color: #16213e;
	font-weight: 600;
	font-size: 0.9rem;
}

.section-header svg {
	width: 18px;
	height: 18px;
}

.ai-section .section-header svg {
	color: #667eea;
}

.input-section .section-header svg {
	color: #4a69bd;
}

.ai-section textarea {
	min-height: 80px;
}

.ai-section textarea:focus {
	border-color: #667eea;
}

.ai-buttons {
	display: flex;
	gap: 0.5rem;
	align-items: center;
	margin-top: 0.75rem;
}

.btn-generate {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
}

.btn-generate:hover:not(:disabled) {
	box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.btn-generate:disabled {
	opacity: 0.7;
}

.btn-generate .spinner {
	display: none;
	width: 14px;
	height: 14px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: white;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

.btn-generate.loading .spinner {
	display: inline-block;
}

.btn-generate.loading .btn-text {
	margin-left: 0.4rem;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.ai-error {
	color: #dc3545;
	font-size: 0.8rem;
	margin-left: auto;
}

.button-row {
	display: flex;
	gap: 0.75rem;
	margin-top: 0.75rem;
	align-items: center;
	flex-wrap: wrap;
}

button {
	padding: 0.5rem 1.25rem;
	font-size: 0.9rem;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.2s;
}

button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.btn-primary {
	background: #4a69bd;
	color: white;
}

.btn-primary:hover:not(:disabled) {
	background: #3c5aa6;
}

.btn-secondary {
	background: #e0e0e0;
	color: #333;
}

.btn-secondary:hover:not(:disabled) {
	background: #d0d0d0;
}

.btn-copy {
	background: #e0e0e0;
	color: #555;
	padding: 0.3rem 0.6rem;
	font-size: 0.7rem;
	margin-left: auto;
}

.btn-copy:hover:not(:disabled) {
	background: #d0d0d0;
}

.btn-copy.copied {
	background: #6c757d;
	color: white;
}

.status-text {
	margin-left: auto;
	color: #666;
	font-size: 0.85rem;
}

.results-section {
	background: white;
	padding: 1rem;
	border-radius: 12px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	display: none;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.results-section.visible {
	display: block;
}

.tabs {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	border-bottom: 2px solid #e0e0e0;
	margin-bottom: 0.75rem;
}

.tab {
	padding: 0.5rem 0.75rem;
	font-size: 0.8rem;
	background: transparent;
	border: none;
	border-bottom: 2px solid transparent;
	margin-bottom: -2px;
	cursor: pointer;
	color: #666;
	transition: all 0.2s;
	border-radius: 0;
}

.tab:hover {
	color: #4a69bd;
	background: #f0f4ff;
}

.tab.active {
	color: #4a69bd;
	border-bottom-color: #4a69bd;
	font-weight: 600;
}

.tab .count {
	background: #e0e0e0;
	color: #555;
	padding: 0.1rem 0.4rem;
	border-radius: 10px;
	font-size: 0.7rem;
	margin-left: 0.3rem;
	font-weight: 500;
}

.tab.active .count {
	background: #4a69bd;
	color: white;
}

table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.85rem;
	table-layout: fixed;
}

th,
td {
	padding: 0.4rem 0.6rem;
	text-align: left;
	border-bottom: 1px solid #eee;
}

tr:last-child td {
	border-bottom: none;
}

th {
	background: #f8f9fa;
	font-weight: 600;
	color: #555;
	position: sticky;
	top: 0;
}

tr:hover {
	background: #fafbfc;
}

.domain-cell {
	font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
	font-size: 0.8rem;
	max-width: 180px;
	word-break: break-all;
}

.domain-cell a {
	color: #4a69bd;
	text-decoration: none;
}

.domain-cell a:hover {
	text-decoration: underline;
}

.status-badge {
	display: inline-block;
	padding: 0.15rem 0.5rem;
	border-radius: 12px;
	font-size: 0.75rem;
	font-weight: 500;
}

.status-free {
	background: #d4edda;
	color: #155724;
}

.status-taken {
	background: #f8d7da;
	color: #721c24;
}

.status-for_sale {
	background: #fff3cd;
	color: #856404;
}

.status-error {
	background: #e2e3e5;
	color: #383d41;
}

.status-checking {
	background: #cce5ff;
	color: #004085;
}

.error-text {
	color: #721c24;
	font-size: 0.8rem;
}

tr.hidden {
	display: none;
}

@media (max-width: 600px) {
	body {
		padding: 0.75rem;
	}

	.status-text {
		width: 100%;
		margin-left: 0;
		text-align: center;
	}

	th,
	td {
		padding: 0.3rem 0.4rem;
	}

	.tabs {
		gap: 0.1rem;
	}

	.tab {
		padding: 0.4rem 0.5rem;
		font-size: 0.75rem;
	}
}
