/**
 * Drywall Calculator Wizard
 * Inherits tokens from calculator-base / estimate-calculator-ui.
 * Brand: Silva navy + gold.
 * Layout / skip-logic only. Choice chrome is shared (.calc-choice-card).
 */

.drywall-root {
	--dw-navy: #014385;
	--dw-navy-deep: #001540;
	--dw-gold: #ffc107;
	--dw-gold-deep: #d4a017;
}

.drywall-root .calculator-step {
	display: none;
}

.drywall-root .calculator-step.active {
	display: block;
}

.drywall-root .dw-section {
	margin: 0 0 1.5rem;
}

.drywall-root .dw-section h3 {
	margin: 0 0 0.75rem;
	font-size: 1.1rem;
}

.drywall-root .dw-help,
.drywall-root .dw-assumptions {
	color: #4b5563;
	font-size: 0.9rem;
	margin: 0.5rem 0 1rem;
}

.drywall-root .dw-paint-options {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 0.75rem;
	margin-bottom: 0.75rem;
}

.drywall-root .dw-paint-card {
	display: flex;
	gap: 0.65rem;
	align-items: flex-start;
	font-size: 0.9rem;
	line-height: 1.35;
}

.drywall-root .dw-paint-card strong {
	display: inline-block;
	margin-bottom: 0.15rem;
}

.drywall-root .dw-preset-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 0.75rem;
}

.silva-calculator-container.drywall-root button.dw-preset-card,
.silva-calculator-container.drywall-root .dw-preset-card {
	align-items: center;
	justify-content: center;
	text-align: center;
	min-height: 3.5rem;
	font-weight: 600;
}

.drywall-root .dw-surface-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 0.75rem;
}

.drywall-root .dw-surface-header h3 {
	margin: 0;
}

.drywall-root .dw-room-count {
	font-size: 0.85rem;
	color: #6b7280;
	font-weight: 600;
}

.drywall-root .dw-section-label {
	margin: 0.85rem 0 0.4rem;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #64748b;
}

.drywall-root .dw-identity-row {
	margin: 0 0 0.35rem;
}

.drywall-root .dw-identity-row label {
	max-width: 16rem;
}

.drywall-root .dw-section-label:first-of-type {
	margin-top: 0;
}

.drywall-root .dw-sqft-hint {
	margin: -0.25rem 0 0.75rem;
	font-size: 0.85rem;
	color: #64748b;
}

.drywall-root .dw-help-tight {
	margin: 0.15rem 0 0.5rem;
	font-size: 0.82rem;
}

.drywall-root .dw-exterior-block {
	margin-bottom: 0.75rem;
}

.drywall-root .dw-exterior-label {
	display: block;
	font-size: 0.85rem;
	font-weight: 600;
	color: #374151;
	margin-bottom: 0.15rem;
}

.drywall-root .dw-exterior-stepper {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	flex-wrap: wrap;
}

.drywall-root .dw-ext-btn {
	appearance: none;
	width: 2.5rem;
	height: 2.5rem;
	border: 1.5px solid #cbd5e1;
	border-radius: 10px;
	background: #fff;
	font-size: 1.2rem;
	font-weight: 700;
	color: #1e3a5f;
	cursor: pointer;
	line-height: 1;
	transition: background 0.12s ease, border-color 0.12s ease, transform 0.1s ease;
}

.drywall-root .dw-ext-btn:hover {
	border-color: #1e3a5f;
	background: #eef3f8;
}

.drywall-root .dw-ext-btn:active {
	transform: scale(0.96);
}

.drywall-root .dw-r-exterior {
	width: 3.25rem;
	text-align: center;
	padding: 0.45rem 0.35rem;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 1rem;
	font-weight: 600;
}

.drywall-root .dw-exterior-suffix {
	font-size: 0.85rem;
	color: #6b7280;
	font-weight: 600;
}

.drywall-root .dw-board-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0 0 0.85rem;
}

/* Texture removal: board/exterior hang controls are not the focus */
.drywall-root .dw-mode-texture-removal .dw-exterior-block,
.drywall-root .dw-mode-texture-removal .dw-board-chips {
	display: none;
}

.drywall-root .dw-mode-texture-removal .dw-section-walls {
	display: none;
}

.drywall-root .dw-mode-texture-removal .dw-room-advanced label:has(.dw-r-board),
.drywall-root .dw-mode-texture-removal .dw-room-advanced label:has(.dw-r-ext-board) {
	display: none;
}

.drywall-root .dw-mode-texture-removal .dw-bead-prompt,
.drywall-root .dw-mode-skim .dw-bead-prompt {
	display: none;
}

.drywall-root #dw-panel-surface:not(.dw-mode-texture-removal):not(.dw-mode-skim) .dw-room-advanced label:has(.dw-r-bead) {
	display: none;
}

.drywall-root .dw-chip {
	display: inline-flex;
	align-items: center;
	padding: 0.35rem 0.65rem;
	border-radius: 999px;
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	color: #1e3a5f;
	font-size: 0.78rem;
	font-weight: 600;
}

.drywall-root .dw-chip-ext {
	background: #fef3c7;
	border-color: #fcd34d;
	color: #92400e;
}

.drywall-root .dw-chip-muted {
	background: #f3f4f6;
	border-color: #e5e7eb;
	color: #6b7280;
}

.drywall-root .dw-auto-badge {
	display: inline-block;
	margin-left: 0.35rem;
	padding: 0.1rem 0.35rem;
	border-radius: 4px;
	background: #dbeafe;
	color: #1e40af;
	font-size: 0.65rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	vertical-align: middle;
}

.drywall-root .dw-auto-badge.is-hidden {
	display: none;
}

.drywall-root .dw-rooms-empty {
	margin: 0 0 1rem;
	padding: 1.35rem 1.25rem;
	border: 2px dashed #cbd5e1;
	border-radius: 14px;
	background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
	color: #475569;
	font-size: 0.95rem;
	text-align: center;
	line-height: 1.45;
}

.drywall-root .dw-rooms-empty[hidden] {
	display: none !important;
}

/* Beat theme-global `button { … }` (Silva SEO theme) — same pattern as carpentry. */
.silva-calculator-container.drywall-root .dw-measure-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.55rem 0.75rem;
	margin: 0 0 0.35rem;
}

.silva-calculator-container.drywall-root .dw-measure-prompt {
	margin: 0;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #64748b;
}

.silva-calculator-container.drywall-root .dw-measure-hint {
	margin: 0 0 0.75rem;
	font-size: 0.82rem;
	color: #64748b;
	line-height: 1.35;
}

.silva-calculator-container.drywall-root .dw-measure-toggle {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	padding: 3px;
	margin: 0;
	background: #e8eef5;
	border: 1px solid #b8c9db;
	border-radius: 999px;
	box-shadow: inset 0 1px 2px rgba(0, 21, 64, 0.06);
	max-width: 100%;
	box-sizing: border-box;
}

.silva-calculator-container.drywall-root button.dw-measure-btn,
.silva-calculator-container.drywall-root .dw-measure-btn {
	-webkit-appearance: none !important;
	appearance: none !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	flex: 0 1 auto;
	gap: 0;
	width: auto !important;
	max-width: none !important;
	min-width: 5.75rem;
	min-height: 0 !important;
	height: auto;
	margin: 0 !important;
	padding: 0.38rem 0.9rem !important;
	border: none !important;
	border-radius: 999px !important;
	background: transparent !important;
	background-image: none !important;
	color: var(--dw-navy-deep, #001540) !important;
	box-shadow: none !important;
	font-family: inherit;
	font-size: 0.82rem !important;
	font-weight: 700 !important;
	line-height: 1.2;
	letter-spacing: 0;
	text-decoration: none;
	text-transform: none;
	white-space: nowrap;
	cursor: pointer;
	transform: none !important;
	transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.silva-calculator-container.drywall-root button.dw-measure-btn:hover,
.silva-calculator-container.drywall-root button.dw-measure-btn:focus,
.silva-calculator-container.drywall-root .dw-measure-btn:hover,
.silva-calculator-container.drywall-root .dw-measure-btn:focus {
	background: rgba(1, 67, 133, 0.08) !important;
	background-image: none !important;
	color: var(--dw-navy, #014385) !important;
	box-shadow: none !important;
	transform: none !important;
	outline: none;
}

.silva-calculator-container.drywall-root button.dw-measure-btn:focus-visible,
.silva-calculator-container.drywall-root .dw-measure-btn:focus-visible {
	outline: 2px solid var(--dw-navy, #014385);
	outline-offset: 2px;
}

.silva-calculator-container.drywall-root button.dw-measure-btn.is-active,
.silva-calculator-container.drywall-root .dw-measure-btn.is-active {
	background: linear-gradient(135deg, var(--dw-gold, #ffc107) 0%, #ffd54f 100%) !important;
	background-image: linear-gradient(135deg, #ffc107 0%, #ffd54f 100%) !important;
	color: var(--dw-navy-deep, #001540) !important;
	box-shadow: 0 1px 4px rgba(0, 21, 64, 0.2) !important;
}

.drywall-root .dw-measure-sqft,
.drywall-root .dw-measure-dims {
	padding: 0.75rem 0.85rem;
	margin: 0 0 0.85rem;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
}

.drywall-root .dw-measure-sqft[hidden],
.drywall-root .dw-measure-dims[hidden],
.drywall-root .dw-exterior-block[hidden] {
	display: none !important;
}

.drywall-root .dw-rooms-container {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin-bottom: 0.85rem;
}

.drywall-root .dw-room-card {
	background: #fff;
	border: 1.5px solid #e2e8f0;
	border-radius: 14px;
	padding: 1rem 1.1rem 1.1rem;
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.drywall-root .dw-room-card:focus-within {
	border-color: #94a3b8;
	box-shadow: 0 4px 16px rgba(15, 23, 42, 0.07);
}

.drywall-root .dw-room-card-header {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
}

.drywall-root .dw-room-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.5rem;
	height: 1.5rem;
	border-radius: 50%;
	background: #1e3a5f;
	color: #fff;
	font-size: 0.75rem;
	font-weight: 700;
}

.drywall-root .dw-room-title {
	flex: 1;
	font-size: 0.95rem;
}

.drywall-root .dw-room-remove {
	appearance: none;
	border: 1.5px solid transparent;
	background: #f8fafc;
	color: #94a3b8;
	font-size: 1.2rem;
	line-height: 1;
	cursor: pointer;
	padding: 0.35rem 0.5rem;
	border-radius: 8px;
	transition: color 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.drywall-root .dw-room-remove:hover {
	color: #b91c1c;
	background: #fef2f2;
	border-color: #fecaca;
}

.drywall-root .dw-room-manager {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 0.75rem;
	margin: 0.25rem 0 1rem;
	padding: 0.9rem 1rem;
	background: #f8fafc;
	border: 1.5px solid #e2e8f0;
	border-radius: 14px;
}

.drywall-root .dw-quick-add {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	font-size: 0.85rem;
	font-weight: 600;
	color: #374151;
}

.drywall-root .dw-quick-add select {
	font-weight: 400;
	padding: 0.55rem 0.65rem;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	min-width: 10rem;
}

.drywall-root .dw-field-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 0.75rem;
	margin-bottom: 0.75rem;
}

/* display:grid above would otherwise ignore the HTML hidden attribute. */
.drywall-root .dw-field-row[hidden],
.drywall-root .dw-help[hidden],
.drywall-root .dw-paint-options[hidden],
.drywall-root .dw-per-room-paint[hidden] {
	display: none !important;
}

.drywall-root .dw-paint-rooms-note {
	margin: 0 0 0.75rem;
	color: #334155;
	font-size: 0.9rem;
}

.drywall-root .dw-per-room-paint-toggle {
	margin: 0.5rem 0 1rem;
	background: none;
	border: none;
	color: #014385;
	font-weight: 600;
	cursor: pointer;
	padding: 0;
	font-size: 0.9rem;
}

.drywall-root .dw-per-room-paint-room {
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 0.75rem;
	margin-bottom: 0.75rem;
}

.drywall-root .dw-per-room-paint-room h4 {
	margin: 0 0 0.5rem;
	font-size: 0.95rem;
}

.drywall-root #dw-panel-surface:not(.dw-mode-replace) #dw-existing-assembly-row {
	display: none !important;
}

.drywall-root .dw-field-row label {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	font-size: 0.85rem;
	font-weight: 600;
	color: #374151;
}

.drywall-root .dw-field-row input,
.drywall-root .dw-field-row select,
.drywall-root .dw-advanced input,
.drywall-root .dw-advanced select {
	font-weight: 400;
	padding: 0.6rem 0.7rem;
	border: 1.5px solid #d1d5db;
	border-radius: 10px;
	font-size: 1rem;
	background: #fff;
	transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.drywall-root .dw-field-row input:hover,
.drywall-root .dw-field-row select:hover {
	border-color: #94a3b8;
}

.drywall-root .dw-field-row input:focus,
.drywall-root .dw-field-row select:focus,
.drywall-root .dw-advanced input:focus,
.drywall-root .dw-advanced select:focus {
	outline: none;
	border-color: #1e3a5f;
	box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.15);
}

.drywall-root .dw-patch-matrix {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 1rem;
}

.drywall-root .dw-patch-matrix th,
.drywall-root .dw-patch-matrix td {
	border: 1px solid #e5e7eb;
	padding: 0.5rem 0.65rem;
	text-align: left;
}

.drywall-root .dw-patch-matrix input {
	width: 4.5rem;
	padding: 0.4rem;
	border: 1px solid #d1d5db;
	border-radius: 6px;
}

.drywall-root .dw-check-row {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin: 0.75rem 0;
}

.drywall-root .dw-check-row label {
	font-weight: 500;
	font-size: 0.9rem;
}

.drywall-root .room-advanced-toggle {
	margin: 0.5rem 0 0;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 0.55rem 0.75rem;
	background: #f9fafb;
}

.drywall-root .room-advanced-toggle summary {
	cursor: pointer;
	font-weight: 600;
	color: #1e3a5f;
	font-size: 0.9rem;
}

.drywall-root .dw-advanced {
	margin-top: 0.75rem;
}

.drywall-root .dw-live-total {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	margin-bottom: 0.75rem;
}

.drywall-root .dw-live-label {
	font-size: 0.85rem;
	color: #6b7280;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.drywall-root #dw-live-total-text {
	font-size: 1.75rem;
	color: #111827;
}

.drywall-root .dw-confidence {
	background: #fff7ed;
	border: 1px solid #fed7aa;
	color: #9a3412;
	padding: 0.65rem 0.85rem;
	border-radius: 8px;
	font-size: 0.9rem;
}

.drywall-root .dw-sheet-mix {
	font-size: 0.9rem;
	color: #374151;
}

.drywall-root .dw-summary-list {
	margin: 0.75rem 0;
	padding-left: 1.1rem;
}

.drywall-root .dw-review {
	border: 2px solid #1e3a5f;
	border-radius: 12px;
	padding: 1rem 1.1rem;
	background: #f8fafc;
}

.drywall-root .dw-review-scope {
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	margin-bottom: 1rem;
}

.drywall-root .dw-review-room {
	padding: 0.65rem 0.75rem;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	font-size: 0.9rem;
	line-height: 1.4;
}

.drywall-root .dw-review-groups {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-bottom: 1rem;
}

.drywall-root .dw-review-group {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 0.5rem 0.75rem;
}

.drywall-root .dw-review-group summary {
	cursor: pointer;
	font-weight: 600;
	font-size: 0.95rem;
}

.drywall-root .dw-review-lines {
	margin: 0.5rem 0 0;
	padding-left: 1.1rem;
	font-size: 0.85rem;
	color: #374151;
}

.drywall-root .dw-line-preview {
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 0.5rem 0.75rem;
	background: #fff;
	margin-bottom: 1rem;
	font-size: 0.9rem;
}

.drywall-root .dw-line-row {
	padding: 0.25rem 0;
}

.drywall-root .dw-muted {
	color: #6b7280;
}

.drywall-root .dw-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.drywall-root .dw-actions .btn,
.drywall-root .dw-room-manager .btn,
.drywall-root .dw-apply-bar .btn {
	padding: 0.7rem 1.15rem;
	border-radius: 10px;
	border: none;
	font-weight: 600;
	cursor: pointer;
	font-size: 0.92rem;
	transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.drywall-root .dw-room-manager .btn-primary,
.drywall-root .dw-actions .btn-primary {
	background: var(--dw-navy, #014385);
	color: #fff;
	box-shadow: 0 2px 8px rgba(1, 67, 133, 0.25);
	border: 2px solid var(--dw-gold, #ffc107);
}

.drywall-root .dw-room-manager .btn-primary:hover,
.drywall-root .dw-actions .btn-primary:hover {
	background: var(--dw-navy-deep, #001540);
	transform: translateY(-1px);
}

.drywall-root .dw-actions .btn-primary:disabled {
	opacity: 0.6;
	cursor: wait;
	transform: none;
}

.drywall-root .dw-btn-secondary {
	background: #fff;
	color: #1e3a5f;
	border: 1.5px solid #cbd5e1 !important;
}

.drywall-root .dw-btn-secondary:hover {
	background: #eef3f8;
	border-color: #1e3a5f !important;
}

.drywall-root .dw-btn-danger {
	background: #fff;
	color: #b91c1c;
	border: 1px solid #fecaca !important;
}

.drywall-root .dw-btn-danger:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.drywall-root .dw-adv-check {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.85rem;
}

.drywall-root .dw-bath-mr-note {
	color: #334155;
	background: #f8fafc;
	border-left: 3px solid #014385;
	padding: 0.45rem 0.7rem;
}

.drywall-root .dw-paint-repair {
	margin-top: 0.5rem;
}

.drywall-root .dw-framing-gate {
	margin: 0;
}

.drywall-root .dw-gate-rooms {
	margin: 0 0 1rem;
	padding: 0 0 0 1.15rem;
	color: #1e293b;
}

.drywall-root .dw-intent-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem;
	margin: 0 0 0.5rem;
}

.drywall-root .dw-sheet-takeoff {
	margin: 0 0 1rem;
	padding: 0.85rem 1rem;
	border-radius: 10px;
	background: #fff8e1;
	border: 1.5px solid var(--dw-gold-deep, #d4a017);
	color: var(--dw-navy-deep, #001540);
}

.drywall-root .dw-sheet-takeoff strong {
	display: block;
	margin-bottom: 0.35rem;
	font-size: 0.95rem;
}

.drywall-root .dw-sheet-takeoff p {
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.45;
}

@media (max-width: 540px) {
	.drywall-root .dw-preset-grid {
		grid-template-columns: 1fr 1fr;
	}

	.drywall-root .dw-intent-grid {
		grid-template-columns: 1fr;
	}

	.drywall-root .dw-quick-add {
		margin-left: 0;
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.silva-calculator-container.drywall-root .dw-measure-btn,
	.silva-calculator-container.drywall-root .dw-preset-card,
	.drywall-root .dw-paint-card,
	.drywall-root .step-navigation .btn,
	.drywall-root .dw-room-manager .btn,
	.drywall-root .dw-ext-btn {
		transition: none;
	}

	.silva-calculator-container.drywall-root .dw-measure-btn:hover,
	.silva-calculator-container.drywall-root .dw-preset-card:hover,
	.drywall-root .dw-paint-card:hover,
	.drywall-root .step-navigation .btn-primary:hover,
	.drywall-root .dw-room-manager .btn-primary:hover {
		transform: none !important;
	}
}
