.wds-widget {
	background: var(--wds-bg, #ffffff);
	color: var(--wds-text, #1f2937);
	border: 1px solid var(--wds-border, #e5e7eb);
	border-radius: 10px;
	padding: 24px;
	max-width: 100%;
	box-sizing: border-box;
	font-family: inherit;
	margin: 20px 0;
}
.wds-widget * { box-sizing: border-box; }

.wds-title {
	margin: 0 0 6px;
	color: var(--wds-primary, #2563eb);
	font-size: 1.4em;
}
.wds-subtitle {
	margin: 0 0 18px;
	opacity: 0.85;
	font-size: 0.95em;
}

.wds-rows { display: flex; flex-direction: column; gap: 14px; margin-bottom: 12px; }

.wds-row {
	border: 1px solid var(--wds-border, #e5e7eb);
	border-radius: 8px;
	padding: 14px;
	background: rgba(0,0,0,0.015);
}

.wds-row-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 12px;
	align-items: end;
}

.wds-row-grid label {
	display: flex;
	flex-direction: column;
	font-size: 0.85em;
	font-weight: 600;
	gap: 4px;
}

.wds-checkbox-label {
	flex-direction: row !important;
	align-items: center;
	gap: 8px !important;
	font-weight: 500 !important;
}

.wds-row-grid input[type="text"],
.wds-row-grid input[type="number"],
.wds-row-grid input[type="url"],
.wds-row-grid select {
	padding: 8px 10px;
	border: 1px solid var(--wds-border, #e5e7eb);
	border-radius: 6px;
	font-size: 0.95em;
	width: 100%;
	background: #fff;
	color: #1f2937;
}

.wds-hint { font-weight: 400; opacity: 0.65; font-size: 0.85em; }

.wds-remove-row-btn {
	background: transparent;
	border: 1px solid #dc2626;
	color: #dc2626;
	border-radius: 6px;
	padding: 8px 10px;
	cursor: pointer;
	font-size: 0.85em;
	height: fit-content;
}
.wds-remove-row-btn:hover { background: #dc2626; color: #fff; }

.wds-add-row-btn {
	background: transparent;
	border: 1.5px dashed var(--wds-primary, #2563eb);
	color: var(--wds-primary, #2563eb);
	padding: 10px 16px;
	border-radius: 6px;
	cursor: pointer;
	font-weight: 600;
	margin-bottom: 18px;
}
.wds-add-row-btn:hover { background: var(--wds-primary, #2563eb); color: #fff; }

.wds-form-inline {
	display: flex;
	flex-wrap: wrap;
	align-items: end;
	gap: 16px;
	margin: 10px 0 20px;
	padding-top: 14px;
	border-top: 1px solid var(--wds-border, #e5e7eb);
}
.wds-form-inline label {
	display: flex;
	flex-direction: column;
	font-size: 0.85em;
	font-weight: 600;
	gap: 4px;
}
.wds-form-inline select,
.wds-form-inline input {
	padding: 8px 10px;
	border: 1px solid var(--wds-border, #e5e7eb);
	border-radius: 6px;
}

.wds-calc-btn {
	background: var(--wds-btn-bg, #2563eb);
	color: var(--wds-btn-text, #ffffff);
	border: none;
	padding: 12px 22px;
	border-radius: 6px;
	cursor: pointer;
	font-weight: 700;
	font-size: 1em;
	margin-left: auto;
}
.wds-calc-btn:hover { opacity: 0.9; }
.wds-calc-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.wds-result { margin-top: 18px; overflow-x: auto; -webkit-overflow-scrolling: touch; }

.wds-scroll-hint {
	display: none;
	font-size: 0.8em;
	opacity: 0.7;
	margin: 0 0 8px;
}
@media (max-width: 768px) {
	.wds-scroll-hint { display: block; }
}

.wds-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 18px;
	font-size: 0.9em;
	min-width: 600px;
}
.wds-table th, .wds-table td {
	border: 1px solid var(--wds-border, #e5e7eb);
	padding: 8px 10px;
	text-align: left;
	white-space: nowrap;
}
.wds-table thead th {
	background: var(--wds-secondary, #1e40af);
	color: #fff;
}
.wds-table tbody tr:nth-child(even) { background: rgba(0,0,0,0.02); }
.wds-total-table thead th { background: var(--wds-primary, #2563eb); }

.wds-note {
	font-size: 0.85em;
	opacity: 0.8;
	font-style: italic;
	margin: 10px 0;
}

.wds-disclaimer {
	font-size: 0.78em;
	opacity: 0.7;
	border-top: 1px dashed var(--wds-border, #e5e7eb);
	padding-top: 10px;
	margin-top: 14px;
	line-height: 1.5;
}

.wds-error {
	color: #dc2626;
	font-weight: 600;
	padding: 10px;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 6px;
}

.wds-cta {
	margin-top: 22px;
	padding: 20px;
	border-radius: 8px;
	background: linear-gradient(135deg, var(--wds-primary, #2563eb), var(--wds-secondary, #1e40af));
	text-align: center;
}
.wds-cta-heading {
	color: #fff;
	font-weight: 600;
	margin: 0 0 12px;
	font-size: 1.05em;
}
.wds-cta-btn {
	display: inline-block;
	background: var(--wds-btn-bg, #ffffff);
	color: var(--wds-btn-text, #2563eb);
	padding: 12px 28px;
	border-radius: 6px;
	font-weight: 700;
	text-decoration: none;
}
.wds-cta-btn:hover { opacity: 0.9; }

.wds-loading { opacity: 0.7; font-style: italic; padding: 10px 0; }

@media (max-width: 600px) {
	.wds-calc-btn { margin-left: 0; width: 100%; }
	.wds-form-inline { flex-direction: column; align-items: stretch; }
}

@media (max-width: 768px) {
	.wds-table th, .wds-table td { font-size: 0.82em; padding: 6px 8px; }
}

/* Printing / "Save as PDF" can't scroll horizontally, so a wide table would
   otherwise get silently clipped at the page edge. Force it to shrink and
   wrap instead, so every column stays visible on the printed page. */
@media print {
	.wds-result { overflow: visible !important; }
	.wds-table { min-width: 0 !important; width: 100% !important; table-layout: fixed; font-size: 7px !important; }
	.wds-table th, .wds-table td {
		white-space: normal !important;
		word-break: break-word;
		padding: 3px 4px !important;
	}
	.wds-scroll-hint { display: none !important; }
}
