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

.toolhub-tool {
	--thub-accent: #1769e0;
	--thub-accent-dark: #0d4fad;
	--thub-accent-soft: #eaf2ff;
	--thub-text: #172033;
	--thub-muted: #5b6474;
	--thub-border: #d9e0ea;
	--thub-surface: #ffffff;
	--thub-surface-alt: #f6f8fb;
	--thub-error: #b42318;
	--thub-error-soft: #fff1f0;
	width: 100%;
	max-width: 1180px;
	margin: 1.5rem auto;
	color: var(--thub-text);
	font-family: inherit;
	font-size: 16px;
	line-height: 1.55;
}

.toolhub-tool [hidden] {
	display: none !important;
}

.toolhub-tool .toolhub-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	border: 0;
	white-space: nowrap;
}

.toolhub-tool__header {
	margin: 0 0 1.25rem;
}

.toolhub-tool__title {
	margin: 0 0 0.35rem;
	color: var(--thub-text);
	font: inherit;
	font-size: clamp(1.55rem, 3vw, 2rem);
	font-weight: 750;
	line-height: 1.2;
}

.toolhub-tool__intro,
.toolhub-privacy,
.toolhub-help {
	color: var(--thub-muted);
}

.toolhub-tool__intro {
	max-width: 72ch;
	margin: 0;
}

.toolhub-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(300px, 0.9fr);
	gap: 1.25rem;
	align-items: start;
}

.toolhub-card {
	min-width: 0;
	padding: clamp(1rem, 2.5vw, 1.75rem);
	border: 1px solid var(--thub-border);
	border-radius: 16px;
	background: var(--thub-surface);
	box-shadow: 0 10px 28px rgba(23, 32, 51, 0.07);
}

.toolhub-card__title {
	margin: 0 0 1rem;
	color: var(--thub-text);
	font: inherit;
	font-size: 1.2rem;
	font-weight: 700;
	line-height: 1.3;
}

.toolhub-form-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
}

.toolhub-field {
	min-width: 0;
}

.toolhub-field--full {
	grid-column: 1 / -1;
}

.toolhub-label,
.toolhub-legend {
	display: block;
	margin: 0 0 0.4rem;
	color: var(--thub-text);
	font-weight: 650;
}

.toolhub-required {
	color: var(--thub-error);
}

.toolhub-input,
.toolhub-select {
	display: block;
	width: 100%;
	min-height: 46px;
	margin: 0;
	padding: 0.68rem 0.78rem;
	border: 1px solid #b8c2d1;
	border-radius: 9px;
	background: #fff;
	color: var(--thub-text);
	font: inherit;
	line-height: 1.25;
	box-shadow: none;
	transition: border-color 120ms ease, box-shadow 120ms ease;
}

.toolhub-input:hover,
.toolhub-select:hover {
	border-color: #8996a9;
}

.toolhub-input:focus,
.toolhub-select:focus,
.toolhub-button:focus-visible,
.toolhub-segmented input:focus-visible + label,
.toolhub-details > summary:focus-visible,
.toolhub-table-wrap:focus-visible {
	outline: 3px solid rgba(23, 105, 224, 0.28);
	outline-offset: 2px;
}

.toolhub-input[aria-invalid="true"],
.toolhub-select[aria-invalid="true"] {
	border-color: var(--thub-error);
	box-shadow: 0 0 0 2px rgba(180, 35, 24, 0.12);
}

.toolhub-input-wrap {
	position: relative;
}

.toolhub-input-wrap .toolhub-input {
	padding-left: 2rem;
}

.toolhub-input-wrap--suffix .toolhub-input {
	padding-right: 2.3rem;
	padding-left: 0.78rem;
}

.toolhub-input-affix {
	position: absolute;
	top: 50%;
	left: 0.75rem;
	transform: translateY(-50%);
	color: var(--thub-muted);
	pointer-events: none;
}

.toolhub-input-wrap--suffix .toolhub-input-affix {
	right: 0.75rem;
	left: auto;
}

.toolhub-help {
	display: block;
	margin-top: 0.32rem;
	font-size: 0.84rem;
}

.toolhub-segmented {
	display: inline-flex;
	max-width: 100%;
	margin-bottom: 0.75rem;
	padding: 3px;
	border-radius: 9px;
	background: #e9edf3;
}

.toolhub-segmented input {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

.toolhub-segmented label {
	margin: 0;
	padding: 0.42rem 0.72rem;
	border-radius: 7px;
	color: #3d4656;
	cursor: pointer;
	font-size: 0.9rem;
	font-weight: 650;
}

.toolhub-segmented input:checked + label {
	background: #fff;
	color: var(--thub-accent-dark);
	box-shadow: 0 1px 4px rgba(23, 32, 51, 0.16);
}

.toolhub-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.7rem;
	margin-top: 1.25rem;
}

.toolhub-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	margin: 0;
	padding: 0.7rem 1.15rem;
	border: 1px solid transparent;
	border-radius: 9px;
	background: var(--thub-accent);
	color: #fff;
	cursor: pointer;
	font: inherit;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color 120ms ease, transform 120ms ease;
}

.toolhub-button:hover {
	background: var(--thub-accent-dark);
	color: #fff;
}

.toolhub-button:active {
	transform: translateY(1px);
}

.toolhub-button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
}

.toolhub-button--secondary {
	border-color: #abb6c6;
	background: #fff;
	color: #2b3546;
}

.toolhub-button--secondary:hover {
	background: #f1f4f8;
	color: #172033;
}

.toolhub-error-summary {
	margin: 0 0 1rem;
	padding: 0.75rem 0.9rem;
	border: 1px solid #f2b8b5;
	border-left: 4px solid var(--thub-error);
	border-radius: 8px;
	background: var(--thub-error-soft);
	color: #7a271a;
}

.toolhub-result-hero {
	margin: 0 0 1.2rem;
	padding: 1.15rem;
	border-radius: 12px;
	background: linear-gradient(145deg, #0d4fad, #1769e0);
	color: #fff;
}

.toolhub-result-hero__label {
	display: block;
	margin-bottom: 0.2rem;
	font-size: 0.9rem;
	font-weight: 650;
	opacity: 0.9;
}

.toolhub-result-hero__value {
	display: block;
	font-size: clamp(1.8rem, 5vw, 2.65rem);
	font-weight: 800;
	letter-spacing: -0.035em;
	line-height: 1.1;
}

.toolhub-metrics {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0;
	margin: 0;
}

.toolhub-metric {
	min-width: 0;
	padding: 0.72rem 0;
	border-bottom: 1px solid #e7ebf1;
}

.toolhub-metric:nth-child(odd) {
	padding-right: 0.8rem;
}

.toolhub-metric:nth-child(even) {
	padding-left: 0.8rem;
}

.toolhub-metric dt {
	margin: 0 0 0.18rem;
	color: var(--thub-muted);
	font-size: 0.82rem;
	line-height: 1.35;
}

.toolhub-metric dd {
	margin: 0;
	color: var(--thub-text);
	font-weight: 720;
	overflow-wrap: anywhere;
}

.toolhub-privacy {
	margin: 1rem 0 0;
	font-size: 0.84rem;
}

.toolhub-details {
	margin-top: 1rem;
	border: 1px solid var(--thub-border);
	border-radius: 12px;
	background: var(--thub-surface);
}

.toolhub-details > summary {
	padding: 0.9rem 1rem;
	cursor: pointer;
	font-weight: 700;
}

.toolhub-details__content {
	padding: 0 1rem 1rem;
}

.toolhub-table-wrap {
	max-width: 100%;
	overflow-x: auto;
	border: 1px solid var(--thub-border);
	border-radius: 9px;
	-webkit-overflow-scrolling: touch;
}

.toolhub-table {
	width: 100%;
	min-width: 700px;
	border: 0;
	border-collapse: collapse;
	background: #fff;
	font-size: 0.86rem;
}

.toolhub-table th,
.toolhub-table td {
	padding: 0.64rem 0.7rem;
	border: 0;
	border-bottom: 1px solid #e5e9ef;
	text-align: right;
	white-space: nowrap;
}

.toolhub-table th:first-child,
.toolhub-table td:first-child,
.toolhub-table th:nth-child(2),
.toolhub-table td:nth-child(2) {
	text-align: left;
}

.toolhub-table thead th {
	background: #eef2f7;
	color: #303a4b;
	font-weight: 700;
}

.toolhub-table tbody tr:last-child td {
	border-bottom: 0;
}

.toolhub-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	margin-top: 0.85rem;
}

.toolhub-pagination .toolhub-button {
	min-height: 38px;
	padding: 0.5rem 0.8rem;
	font-size: 0.88rem;
}

.toolhub-pagination__status {
	min-width: 8rem;
	text-align: center;
	font-size: 0.88rem;
}

.toolhub-notice {
	padding: 0.75rem 1rem;
	border-left: 4px solid #dba617;
	background: #fff8dd;
}

@media (max-width: 800px) {
	.toolhub-layout {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 520px) {
	.toolhub-tool {
		font-size: 15px;
	}

	.toolhub-card {
		padding: 1rem;
		border-radius: 12px;
	}

	.toolhub-form-grid,
	.toolhub-metrics {
		grid-template-columns: minmax(0, 1fr);
	}

	.toolhub-field--full {
		grid-column: auto;
	}

	.toolhub-metric:nth-child(n) {
		padding-right: 0;
		padding-left: 0;
	}

	.toolhub-actions .toolhub-button {
		flex: 1 1 8rem;
	}
}

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