/**
 * LancerBill Tools - shared styles (mobile-first).
 * Namespaced under .lb-tool to avoid theme conflicts.
 */
.lb-tool,
.lb-tool *,
.lb-tool *::before,
.lb-tool *::after {
	box-sizing: border-box;
}

.lb-tool {
	max-width: 780px;
	margin: 0 auto;
	font-size: 1rem;
	line-height: 1.5;
	color: inherit;
}

.lb-tool fieldset {
	border: 1px solid #dbe3ec;
	border-radius: 0.75rem;
	padding: 1rem 1.1rem 1.1rem;
	margin: 0 0 1.25rem;
	min-width: 0;
}

.lb-tool legend {
	font-weight: 700;
	padding: 0 0.5rem;
}

.lb-field {
	margin-bottom: 1rem;
	min-width: 0;
}

.lb-field > label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.35rem;
}

.lb-input {
	width: 100%;
	max-width: 100%;
	padding: 0.6rem 0.7rem;
	font-size: 1rem;
	line-height: 1.4;
	border: 1px solid #b9c6d6;
	border-radius: 0.5rem;
	background: #fff;
	color: #111;
}

.lb-input:focus {
	outline: 2px solid #2563eb;
	outline-offset: 1px;
	border-color: #2563eb;
}

.lb-input[aria-invalid="true"] {
	border-color: #dc2626;
}

textarea.lb-input {
	min-height: 5.5rem;
	resize: vertical;
}

.lb-hint {
	font-size: 0.85rem;
	color: #5b6b7f;
	margin: 0.3rem 0 0;
}

.lb-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 1rem;
}

.lb-grid-3 {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 0 1rem;
}

@media (max-width: 600px) {
	.lb-grid,
	.lb-grid-3 {
		grid-template-columns: 1fr;
	}
}

.lb-radio-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.25rem;
	margin-bottom: 1rem;
}

.lb-radio-label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.35rem;
}

.lb-radio-row label {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	font-weight: 600;
	cursor: pointer;
}

.lb-radio-row input[type="radio"] {
	width: 1.1rem;
	height: 1.1rem;
	accent-color: #16a34a;
}

.lb-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 1.25rem;
}

.lb-btn {
	display: inline-block;
	padding: 0.7rem 1.4rem;
	font-size: 1rem;
	font-weight: 700;
	border-radius: 0.6rem;
	border: 1px solid transparent;
	cursor: pointer;
	text-decoration: none;
	line-height: 1.3;
}

.lb-btn:focus-visible {
	outline: 2px solid #2563eb;
	outline-offset: 2px;
}

.lb-btn-primary {
	background: #16a34a;
	border-color: #16a34a;
	color: #fff;
}

.lb-btn-primary:hover {
	background: #15803d;
	border-color: #15803d;
}

.lb-btn-secondary {
	background: #fff;
	border-color: #b9c6d6;
	color: #1f2937;
}

.lb-btn-secondary:hover {
	background: #f1f5f9;
}

.lb-btn-ghost {
	background: transparent;
	border-color: #b9c6d6;
	color: #1f2937;
	padding: 0.5rem 1rem;
	font-size: 0.9rem;
}

.lb-btn-ghost:hover {
	background: #f1f5f9;
}

.lb-errors {
	margin-top: 1rem;
	padding: 0.9rem 1.1rem;
	border: 1px solid #f3b4b4;
	background: #fef2f2;
	color: #991b1b;
	border-radius: 0.6rem;
}

.lb-errors ul {
	margin: 0;
	padding-left: 1.2rem;
}

.lb-result {
	margin-top: 1.5rem;
	padding: 1.25rem 1.35rem;
	border: 1px solid #bbf7d0;
	background: #f0fdf4;
	border-radius: 0.75rem;
}

.lb-result h3 {
	margin: 0 0 0.75rem;
	font-size: 1.15rem;
}

.lb-result-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
	padding: 0.45rem 0;
	border-bottom: 1px dashed #d1e7d9;
}

.lb-result-row:last-child {
	border-bottom: 0;
}

.lb-result-row .lb-k {
	color: #334155;
	min-width: 0; /* let long labels shrink instead of pushing the row wide */
}

.lb-result-row .lb-v {
	font-weight: 700;
	text-align: right;
	white-space: nowrap;
}

.lb-result-row.lb-total .lb-v {
	font-size: 1.25rem;
	color: #15803d;
}

.lb-result .lb-btn-ghost {
	margin-top: 0.9rem;
}

.lb-explainer {
	margin-top: 0.9rem;
	padding: 0.8rem 1rem;
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	border-radius: 0.6rem;
	font-size: 0.92rem;
	color: #1e3a8a;
}

.lb-disclaimer {
	margin-top: 1.25rem;
	font-size: 0.85rem;
	color: #64748b;
}

.lb-note-inline {
	font-size: 0.9rem;
	color: #475569;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 0.6rem;
	padding: 0.7rem 0.9rem;
	margin: 0 0 1rem;
}

/* Screen-reader only */
.lb-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
