/* Shared styles for Poppy Room static contractor and architect tools. */

.tool-page {
	padding-bottom: clamp(48px, 6vw, 88px);
}

.tool-page .hero {
	padding-bottom: clamp(24px, 3vw, 40px);
	border-bottom: 1px solid var(--rule);
}

.tool-grid {
	display: grid;
	grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
	gap: clamp(28px, 4vw, 56px);
	padding-top: clamp(24px, 3vw, 40px);
	align-items: start;
}

.tool-controls {
	display: flex;
	flex-direction: column;
	gap: 18px;
	padding: 20px;
	border: 1px solid var(--rule);
	background: var(--paper);
}

.tool-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.tool-field-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.tool-label {
	font-size: 12px;
	line-height: 16px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ink-dim);
}

.tool-input,
.tool-select {
	width: 100%;
	height: 40px;
	padding: 0 10px;
	border: 1px solid var(--rule);
	background: var(--paper);
	color: var(--ink);
	font-family: inherit;
	font-size: 15px;
	border-radius: 0;
}

.tool-input:focus,
.tool-select:focus {
	outline: 2px solid var(--poppy);
	outline-offset: -1px;
}

.tool-summary-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px 24px;
	padding-bottom: 16px;
	margin-bottom: 20px;
	border-bottom: 1px solid var(--rule);
}

.tool-metric {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.tool-metric-val {
	font-size: 24px;
	line-height: 28px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.tool-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-left: auto;
}

.tool-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 36px;
	padding: 0 14px;
	border: 1px solid var(--ink);
	background: var(--paper);
	color: var(--ink);
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	font-stretch: 62%;
	font-variation-settings:
		"wdth" 62,
		"wght" 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
}

.tool-btn:hover {
	background: var(--ink);
	color: var(--paper);
}

.tool-alerts {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 20px;
}

.tool-alert {
	padding: 12px 14px;
	border-left: 3px solid var(--ink);
	background: rgb(10 10 10 / 4%);
	font-size: 14px;
	line-height: 21px;
}

.tool-alert.warn {
	border-left-color: var(--poppy);
	background: rgb(255 122 26 / 8%);
}

.tool-cards {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.tool-card {
	padding: 18px 20px;
	border: 1px solid var(--rule);
	background: var(--paper);
}

.tool-card-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
	margin-bottom: 8px;
}

.tool-sku {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 15px;
	font-weight: 600;
	color: var(--ink);
}

.tool-badge {
	display: inline-block;
	padding: 2px 8px;
	font-size: 11px;
	line-height: 18px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	border: 1px solid var(--ink);
}

.tool-badge.ok {
	background: var(--ink);
	color: var(--paper);
}

.tool-badge.warn {
	border-color: var(--poppy);
	color: var(--ink);
	background: rgb(255 122 26 / 14%);
}

.tool-badge.muted {
	border-color: var(--rule);
	color: var(--ink-dim);
}

.tool-card-sub {
	font-size: 14px;
	line-height: 20px;
	color: var(--ink-dim);
	margin-bottom: 12px;
}

.tool-meter {
	height: 6px;
	background: rgb(10 10 10 / 10%);
	margin: 8px 0 6px;
	overflow: hidden;
}

.tool-meter-fill {
	height: 100%;
	background: var(--ink);
}

.tool-meter-fill.over {
	background: var(--poppy);
}

.tool-meta {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
	gap: 8px 16px;
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid var(--rule);
	font-size: 13px;
	line-height: 19px;
}

.tool-meta dt {
	color: var(--ink-dim);
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.tool-meta dd {
	font-weight: 500;
}

.tool-note {
	margin-top: 10px;
	font-size: 13px;
	line-height: 20px;
	color: var(--ink-dim);
}

.tool-diagram {
	padding: 20px;
	border: 1px solid var(--rule);
	background: var(--paper);
	margin-bottom: 20px;
}

.tool-diagram svg {
	display: block;
	width: 100%;
	height: auto;
	max-height: 360px;
}

.tool-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
	line-height: 21px;
}

.tool-table th,
.tool-table td {
	text-align: left;
	padding: 10px 12px;
	border-bottom: 1px solid var(--rule);
	vertical-align: top;
}

.tool-table th {
	width: 38%;
	color: var(--ink-dim);
	font-weight: 500;
}

.tool-table td {
	font-variant-numeric: tabular-nums;
}

.tool-footnote {
	margin-top: 28px;
	padding-top: 16px;
	border-top: 1px solid var(--rule);
	font-size: 13px;
	line-height: 20px;
	color: var(--ink-dim);
}

@media (max-width: 860px) {
	.tool-grid {
		grid-template-columns: 1fr;
	}
}

@page {
	size: auto;
	margin: 12mm;
}

@media print {
	body {
		font-size: 10pt;
		line-height: 1.35;
	}
	main {
		padding: 0;
	}
	.masthead,
	.band,
	.foot,
	.tool-controls,
	.tool-actions,
	.faq-section {
		display: none;
	}
	.tool-page {
		padding-bottom: 0;
	}
	.tool-page .hero {
		padding: 0 0 10px;
		margin-bottom: 12px;
	}
	.tool-page .hero h1 {
		font-size: 22pt;
		line-height: 1.1;
	}
	.tool-page .hero .sub {
		font-size: 10pt;
		line-height: 1.35;
		margin-top: 4px;
	}
	.tool-grid {
		display: block;
		padding-top: 0;
	}
	.tool-summary-bar {
		padding-bottom: 8px;
		margin-bottom: 10px;
	}
	.tool-metric-val {
		font-size: 16pt;
		line-height: 1.15;
	}
	.tool-alerts {
		gap: 6px;
		margin-bottom: 10px;
	}
	.tool-alert {
		padding: 6px 10px;
		font-size: 9pt;
		line-height: 1.35;
		break-inside: avoid;
	}
	.tool-diagram {
		padding: 10px;
		margin-bottom: 12px;
		break-inside: avoid;
		page-break-inside: avoid;
	}
	.tool-diagram svg {
		max-height: 220px;
		width: auto;
		max-width: 100%;
		margin: 0 auto;
	}
	.tool-table {
		font-size: 9.5pt;
		line-height: 1.3;
		break-inside: avoid;
	}
	.tool-table th,
	.tool-table td {
		padding: 5px 8px;
	}
	.tool-card {
		padding: 10px 12px;
		break-inside: avoid;
		page-break-inside: avoid;
	}
	.tool-cards {
		gap: 10px;
	}
	.tool-note,
	.tool-footnote {
		margin-top: 8px;
		padding-top: 8px;
		font-size: 8.5pt;
		line-height: 1.35;
	}
}
