/*
 * WebToolsHub Rent Receipt Generator
 * All selectors are prefixed with .wth-rrg- so the tool cannot leak into the theme.
 */

.wth-rrg-app,
.wth-rrg-app *,
.wth-rrg-app *::before,
.wth-rrg-app *::after {
	box-sizing: border-box;
}

.wth-rrg-app {
	/* Classic (default) theme tokens. */
	--wth-rrg-bg: #f4f6fb;
	--wth-rrg-surface: #ffffff;
	--wth-rrg-surface-2: #eef2fa;
	--wth-rrg-ink: #131a2a;
	--wth-rrg-ink-soft: #4d5871;
	--wth-rrg-line: #d5dced;
	--wth-rrg-accent: #14477d;
	--wth-rrg-accent-ink: #ffffff;
	--wth-rrg-accent-soft: #e3ecf9;
	--wth-rrg-ring: #2f7dd1;
	--wth-rrg-danger: #a3121f;
	--wth-rrg-danger-soft: #fdeceb;
	--wth-rrg-ok: #10603f;
	--wth-rrg-ok-soft: #e6f4ec;
	--wth-rrg-radius: 14px;
	--wth-rrg-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 12px 32px -18px rgba(16, 24, 40, .35);
	--wth-rrg-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
	--wth-rrg-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;

	font-family: var(--wth-rrg-sans);
	color: var(--wth-rrg-ink);
	line-height: 1.55;
	max-width: 980px;
	margin: 0 auto 2rem;
	container-type: inline-size;
}

/* ---------- Themes ---------- */
.wth-rrg-app[data-wth-rrg-theme="emerald"] {
	--wth-rrg-bg: #f2f8f4;
	--wth-rrg-surface: #ffffff;
	--wth-rrg-surface-2: #e9f4ed;
	--wth-rrg-ink: #10241a;
	--wth-rrg-ink-soft: #47614f;
	--wth-rrg-line: #cbe2d4;
	--wth-rrg-accent: #10603f;
	--wth-rrg-accent-soft: #dcefe4;
	--wth-rrg-ring: #1c8f5f;
}

.wth-rrg-app[data-wth-rrg-theme="midnight"] {
	--wth-rrg-bg: #0e1320;
	--wth-rrg-surface: #161d2e;
	--wth-rrg-surface-2: #1e2739;
	--wth-rrg-ink: #f2f5fb;
	--wth-rrg-ink-soft: #a9b4cb;
	--wth-rrg-line: #2d3852;
	--wth-rrg-accent: #6ea8ff;
	--wth-rrg-accent-ink: #0e1320;
	--wth-rrg-accent-soft: #22304a;
	--wth-rrg-ring: #8dbcff;
	--wth-rrg-danger: #ff9b95;
	--wth-rrg-danger-soft: #3a2124;
	--wth-rrg-ok: #7fe0b0;
	--wth-rrg-ok-soft: #16301f;
	--wth-rrg-shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 18px 40px -22px rgba(0, 0, 0, .9);
}

.wth-rrg-app[data-wth-rrg-theme="sunset"] {
	--wth-rrg-bg: #fdf5ee;
	--wth-rrg-surface: #fffdfb;
	--wth-rrg-surface-2: #f8ece1;
	--wth-rrg-ink: #2a1a10;
	--wth-rrg-ink-soft: #6a5344;
	--wth-rrg-line: #e7d3c1;
	--wth-rrg-accent: #a63f16;
	--wth-rrg-accent-soft: #fae6d9;
	--wth-rrg-ring: #d4713c;
}

/* ---------- Shell ---------- */
.wth-rrg-shell {
	background: var(--wth-rrg-bg);
	border: 1px solid var(--wth-rrg-line);
	border-radius: calc(var(--wth-rrg-radius) + 6px);
	padding: 1.25rem;
	box-shadow: var(--wth-rrg-shadow);
}

.wth-rrg-header {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	align-items: flex-start;
	justify-content: space-between;
}

.wth-rrg-header-text {
	flex: 1 1 260px;
	min-width: 0;
}

.wth-rrg-eyebrow {
	margin: 0 0 .25rem;
	font-size: .72rem;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--wth-rrg-ink-soft);
	font-weight: 700;
}

.wth-rrg-title {
	font-family: var(--wth-rrg-display);
	font-size: clamp(1.35rem, 4.5vw, 2rem);
	line-height: 1.15;
	margin: 0 0 .4rem;
	color: var(--wth-rrg-ink);
}

.wth-rrg-subtitle {
	margin: 0;
	color: var(--wth-rrg-ink-soft);
	font-size: .95rem;
}

/* ---------- Theme switcher ---------- */
.wth-rrg-themes {
	flex: 0 1 auto;
}

.wth-rrg-themes-label {
	display: block;
	font-size: .72rem;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--wth-rrg-ink-soft);
	font-weight: 700;
	margin-bottom: .35rem;
}

.wth-rrg-theme-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: .35rem;
}

.wth-rrg-theme-dot {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	background: var(--wth-rrg-surface);
	border: 1px solid var(--wth-rrg-line);
	color: var(--wth-rrg-ink);
	border-radius: 999px;
	padding: .35rem .6rem;
	font: inherit;
	font-size: .8rem;
	min-height: 38px;
	cursor: pointer;
}

.wth-rrg-theme-dot.is-active {
	border-color: var(--wth-rrg-accent);
	box-shadow: inset 0 0 0 1px var(--wth-rrg-accent);
	font-weight: 700;
}

.wth-rrg-theme-swatch {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	border: 1px solid rgba(0, 0, 0, .18);
	flex: 0 0 auto;
}

.wth-rrg-theme-dot--classic .wth-rrg-theme-swatch { background: linear-gradient(135deg, #14477d, #2f7dd1); }
.wth-rrg-theme-dot--emerald .wth-rrg-theme-swatch { background: linear-gradient(135deg, #10603f, #3cbf85); }
.wth-rrg-theme-dot--midnight .wth-rrg-theme-swatch { background: linear-gradient(135deg, #0e1320, #6ea8ff); }
.wth-rrg-theme-dot--sunset .wth-rrg-theme-swatch { background: linear-gradient(135deg, #a63f16, #f0a35e); }

/* ---------- Notices ---------- */
.wth-rrg-privacy {
	margin: 1rem 0 0;
	padding: .7rem .85rem;
	background: var(--wth-rrg-ok-soft);
	border: 1px solid var(--wth-rrg-line);
	border-left: 4px solid var(--wth-rrg-ok);
	border-radius: 10px;
	font-size: .9rem;
	color: var(--wth-rrg-ink);
}

.wth-rrg-disclaimer {
	margin: 1rem 0 0;
	font-size: .82rem;
	color: var(--wth-rrg-ink-soft);
	border-top: 1px dashed var(--wth-rrg-line);
	padding-top: .8rem;
}

/* ---------- Stepper ---------- */
.wth-rrg-stepper {
	margin-top: 1rem;
}

.wth-rrg-stepper-list {
	display: flex;
	gap: .4rem;
	list-style: none;
	margin: 0 0 .6rem;
	padding: 0 0 .25rem;
	overflow-x: auto;
	scrollbar-width: thin;
	-webkit-overflow-scrolling: touch;
}

.wth-rrg-stepper-item {
	flex: 0 0 auto;
	margin: 0;
}

.wth-rrg-stepper-btn {
	display: inline-flex;
	align-items: center;
	gap: .45rem;
	background: var(--wth-rrg-surface);
	border: 1px solid var(--wth-rrg-line);
	border-radius: 999px;
	padding: .3rem .7rem .3rem .3rem;
	font: inherit;
	font-size: .82rem;
	color: var(--wth-rrg-ink-soft);
	cursor: pointer;
	min-height: 40px;
	white-space: nowrap;
}

.wth-rrg-stepper-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--wth-rrg-surface-2);
	color: var(--wth-rrg-ink-soft);
	font-weight: 700;
	font-size: .8rem;
	flex: 0 0 auto;
}

.wth-rrg-stepper-item.is-active .wth-rrg-stepper-btn {
	border-color: var(--wth-rrg-accent);
	color: var(--wth-rrg-ink);
	font-weight: 700;
}

.wth-rrg-stepper-item.is-active .wth-rrg-stepper-num,
.wth-rrg-stepper-item.is-done .wth-rrg-stepper-num {
	background: var(--wth-rrg-accent);
	color: var(--wth-rrg-accent-ink);
}

.wth-rrg-stepper-item.is-done .wth-rrg-stepper-btn {
	color: var(--wth-rrg-ink);
}

.wth-rrg-progress {
	height: 6px;
	background: var(--wth-rrg-surface-2);
	border-radius: 999px;
	overflow: hidden;
	border: 1px solid var(--wth-rrg-line);
}

.wth-rrg-progress-bar {
	display: block;
	height: 100%;
	width: 16.6%;
	background: var(--wth-rrg-accent);
	transition: width .25s ease;
}

/* ---------- Panels and fields ---------- */
.wth-rrg-panel {
	background: var(--wth-rrg-surface);
	border: 1px solid var(--wth-rrg-line);
	border-radius: var(--wth-rrg-radius);
	padding: 1rem;
	margin-top: 1rem;
}

.wth-rrg-panel[hidden] {
	display: none;
}

.wth-rrg-panel-title {
	font-family: var(--wth-rrg-display);
	font-size: 1.15rem;
	margin: 0 0 .2rem;
	color: var(--wth-rrg-ink);
}

.wth-rrg-panel-hint {
	margin: 0 0 1rem;
	font-size: .87rem;
	color: var(--wth-rrg-ink-soft);
}

.wth-rrg-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: .9rem;
}

.wth-rrg-field {
	margin-bottom: .9rem;
	min-width: 0;
}

.wth-rrg-grid .wth-rrg-field {
	margin-bottom: 0;
}

.wth-rrg-field label,
.wth-rrg-fieldset legend {
	display: block;
	font-weight: 700;
	font-size: .87rem;
	margin-bottom: .3rem;
	color: var(--wth-rrg-ink);
}

.wth-rrg-req {
	color: var(--wth-rrg-danger);
	font-weight: 700;
}

.wth-rrg-opt {
	font-weight: 400;
	font-size: .78rem;
	color: var(--wth-rrg-ink-soft);
	background: var(--wth-rrg-surface-2);
	border-radius: 999px;
	padding: .05rem .45rem;
	margin-left: .2rem;
}

.wth-rrg-app input[type="text"],
.wth-rrg-app input[type="number"],
.wth-rrg-app input[type="date"],
.wth-rrg-app select,
.wth-rrg-app textarea {
	width: 100%;
	max-width: 100%;
	font: inherit;
	font-size: 16px; /* Stops iOS zoom on focus. */
	color: var(--wth-rrg-ink);
	background: var(--wth-rrg-surface);
	border: 1px solid var(--wth-rrg-line);
	border-radius: 10px;
	padding: .6rem .7rem;
	min-height: 46px;
	appearance: none;
	-webkit-appearance: none;
}

.wth-rrg-app textarea {
	resize: vertical;
	min-height: 84px;
	line-height: 1.5;
}

.wth-rrg-app select {
	background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
	background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
	background-size: 6px 6px, 6px 6px;
	background-repeat: no-repeat;
	padding-right: 2.2rem;
}

.wth-rrg-app input:focus-visible,
.wth-rrg-app select:focus-visible,
.wth-rrg-app textarea:focus-visible,
.wth-rrg-app button:focus-visible {
	outline: 3px solid var(--wth-rrg-ring);
	outline-offset: 2px;
	border-color: var(--wth-rrg-ring);
}

.wth-rrg-app input.wth-rrg-invalid,
.wth-rrg-app select.wth-rrg-invalid,
.wth-rrg-app textarea.wth-rrg-invalid {
	border-color: var(--wth-rrg-danger);
	border-width: 2px;
	background: var(--wth-rrg-danger-soft);
}

.wth-rrg-hint {
	margin: .3rem 0 0;
	font-size: .78rem;
	color: var(--wth-rrg-ink-soft);
}

.wth-rrg-error {
	margin: .3rem 0 0;
	font-size: .82rem;
	font-weight: 600;
	color: var(--wth-rrg-danger);
	display: none;
}

.wth-rrg-error.is-visible {
	display: block;
}

.wth-rrg-error.is-visible::before {
	content: "\26A0";
	margin-right: .3rem;
}

.wth-rrg-check {
	display: flex;
	align-items: flex-start;
	gap: .55rem;
	margin-top: .6rem;
}

.wth-rrg-check input[type="checkbox"] {
	width: 22px;
	height: 22px;
	margin: 2px 0 0;
	flex: 0 0 auto;
	accent-color: var(--wth-rrg-accent);
}

.wth-rrg-check label {
	font-weight: 400;
	font-size: .87rem;
	margin: 0;
}

.wth-rrg-fieldset {
	border: 1px solid var(--wth-rrg-line);
	border-radius: var(--wth-rrg-radius);
	padding: .85rem;
	margin: 1rem 0 0;
	background: var(--wth-rrg-surface-2);
}

.wth-rrg-fieldset legend {
	padding: 0 .35rem;
	margin: 0;
}

.wth-rrg-radio-row {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	margin-bottom: .8rem;
}

.wth-rrg-radio {
	display: flex;
	align-items: center;
	gap: .45rem;
	background: var(--wth-rrg-surface);
	border: 1px solid var(--wth-rrg-line);
	border-radius: 10px;
	padding: .5rem .65rem;
	font-size: .85rem;
	cursor: pointer;
	flex: 1 1 220px;
	min-height: 46px;
}

.wth-rrg-radio input {
	width: 20px;
	height: 20px;
	accent-color: var(--wth-rrg-accent);
	flex: 0 0 auto;
}

.wth-rrg-radio:focus-within {
	border-color: var(--wth-rrg-ring);
	box-shadow: 0 0 0 3px var(--wth-rrg-accent-soft);
}

/* ---------- Month rows ---------- */
.wth-rrg-months-block {
	margin-top: 1.1rem;
}

.wth-rrg-months-head h4 {
	font-family: var(--wth-rrg-display);
	font-size: 1rem;
	margin: 0 0 .15rem;
}

.wth-rrg-months {
	display: grid;
	gap: .55rem;
	margin-top: .6rem;
}

.wth-rrg-month-row {
	display: grid;
	grid-template-columns: 1fr;
	gap: .5rem;
	background: var(--wth-rrg-surface-2);
	border: 1px solid var(--wth-rrg-line);
	border-radius: 12px;
	padding: .65rem;
}

.wth-rrg-month-label {
	font-weight: 700;
	font-size: .88rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .5rem;
}

.wth-rrg-month-tag {
	font-weight: 400;
	font-size: .72rem;
	color: var(--wth-rrg-ink-soft);
	background: var(--wth-rrg-surface);
	border: 1px solid var(--wth-rrg-line);
	border-radius: 999px;
	padding: .05rem .45rem;
}

.wth-rrg-month-inputs {
	display: grid;
	grid-template-columns: 1fr;
	gap: .5rem;
}

.wth-rrg-month-inputs label {
	font-size: .76rem;
	font-weight: 600;
	color: var(--wth-rrg-ink-soft);
	display: block;
	margin-bottom: .2rem;
}

/* ---------- Summary ---------- */
.wth-rrg-summary {
	display: grid;
	gap: .4rem;
}

.wth-rrg-sum-row {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: .5rem;
	padding: .55rem .7rem;
	background: var(--wth-rrg-surface-2);
	border: 1px solid var(--wth-rrg-line);
	border-radius: 10px;
	font-size: .9rem;
}

.wth-rrg-sum-row dt,
.wth-rrg-sum-key {
	color: var(--wth-rrg-ink-soft);
	font-weight: 600;
}

.wth-rrg-sum-val {
	font-weight: 700;
	text-align: right;
	word-break: break-word;
}

.wth-rrg-sum-row--total {
	background: var(--wth-rrg-accent-soft);
	border-color: var(--wth-rrg-accent);
	font-size: 1rem;
}

.wth-rrg-done {
	margin-top: 1rem;
	padding: .85rem;
	border-radius: 12px;
	background: var(--wth-rrg-ok-soft);
	border: 1px solid var(--wth-rrg-ok);
	font-size: .9rem;
}

.wth-rrg-done p {
	margin: 0 0 .6rem;
}

/* ---------- Buttons ---------- */
.wth-rrg-actions {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	margin-top: 1rem;
}

.wth-rrg-btn {
	font: inherit;
	font-weight: 700;
	font-size: .95rem;
	border-radius: 999px;
	padding: .75rem 1.3rem;
	min-height: 48px;
	cursor: pointer;
	border: 1px solid transparent;
	flex: 1 1 auto;
	transition: transform .12s ease, filter .12s ease;
}

.wth-rrg-btn:active {
	transform: translateY(1px);
}

.wth-rrg-btn-primary {
	background: var(--wth-rrg-accent);
	color: var(--wth-rrg-accent-ink);
	border-color: var(--wth-rrg-accent);
}

.wth-rrg-btn-primary:hover {
	filter: brightness(1.08);
}

.wth-rrg-btn-ghost {
	background: var(--wth-rrg-surface);
	color: var(--wth-rrg-ink);
	border-color: var(--wth-rrg-line);
}

.wth-rrg-btn-quiet {
	background: transparent;
	color: var(--wth-rrg-ink-soft);
	border-color: var(--wth-rrg-line);
	flex: 0 1 auto;
}

.wth-rrg-btn[disabled] {
	opacity: .6;
	cursor: not-allowed;
}

/* ---------- Utilities ---------- */
.wth-rrg-hidden {
	display: none !important;
}

.wth-rrg-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- SEO block ---------- */
.wth-rrg-seo {
	max-width: 980px;
	margin: 0 auto 2rem;
}

.wth-rrg-seo h2 {
	margin-top: 1.8rem;
}

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
	.wth-rrg-shell {
		padding: 1.75rem;
	}

	.wth-rrg-panel {
		padding: 1.4rem;
	}

	.wth-rrg-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.wth-rrg-month-row {
		grid-template-columns: 170px 1fr;
		align-items: center;
	}

	.wth-rrg-month-inputs {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.wth-rrg-btn {
		flex: 0 1 auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wth-rrg-app * {
		transition: none !important;
		animation: none !important;
	}
}

@media print {
	.wth-rrg-app {
		display: none;
	}
}
