/**
 * PSM Net-Metering — front-end styles.
 * Self-contained and scoped under .psm-tool / .psm-nm so it does not collide
 * with the theme, and works whether or not the PSM Tools plugin is active.
 */

.psm-tool {
	--psm-bg: #ffffff;
	--psm-surface: #f6f8fa;
	--psm-border: #e1e6eb;
	--psm-text: #1c2733;
	--psm-muted: #5c6b7a;
	--psm-accent: #ff6c30;        /* site brand colour */
	--psm-accent-dark: #d2521b;   /* hover / borders / accessible text */
	--psm-accent-soft: #ffe9e0;   /* light tint for backgrounds */
	--psm-radius: 12px;
	--psm-shadow: 0 1px 2px rgba(16, 32, 48, .06), 0 8px 24px rgba(16, 32, 48, .06);

	box-sizing: border-box;
	max-width: 1100px;
	margin: 0 auto;
	color: var(--psm-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.55;
}
.psm-tool *, .psm-tool *::before, .psm-tool *::after { box-sizing: border-box; }

/* Intro */
.psm-tool__intro { margin-bottom: 1.75rem; }
.psm-tool__title {
	margin: 0 0 .5rem; font-size: 1.85rem; font-weight: 700;
	letter-spacing: -.02em; color: var(--psm-text);
}
.psm-tool__lead { margin: 0 0 .5rem; max-width: 80ch; color: var(--psm-muted); }
.psm-tool__credit { margin: 0; font-size: .85rem; font-style: italic; color: var(--psm-muted); }

/* Grid of input cards */
.psm-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 1rem;
	margin-bottom: 1rem;
}
.psm-card {
	background: var(--psm-bg);
	border: 1px solid var(--psm-border);
	border-radius: var(--psm-radius);
	box-shadow: var(--psm-shadow);
	padding: 1.25rem;
}
.psm-card__title {
	margin: 0 0 1rem; font-size: 1.05rem; font-weight: 700; color: var(--psm-text);
	padding-bottom: .6rem; border-bottom: 2px solid var(--psm-accent-soft);
}

/* Fields */
.psm-field { margin-bottom: 1.1rem; }
.psm-field:last-child { margin-bottom: 0; }
.psm-field > label {
	display: block; margin-bottom: .35rem; font-size: .9rem; font-weight: 600; color: var(--psm-text);
}
.psm-field input[type="number"],
.psm-field input[type="text"],
.psm-field select {
	width: 100%; padding: .6rem .7rem; font: inherit; color: var(--psm-text);
	background: var(--psm-bg); border: 1px solid var(--psm-border); border-radius: 8px;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.psm-field input:focus, .psm-field select:focus {
	outline: none; border-color: var(--psm-accent);
	box-shadow: 0 0 0 3px var(--psm-accent-soft);
}

/* Range slider + linked number */
.psm-field--range input[type="range"] { width: 100%; accent-color: var(--psm-accent); margin: .2rem 0 .5rem; }
.psm-nm__num { max-width: 160px; }
.psm-range-out {
	float: right; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--psm-accent-dark);
}

/* Radio choices */
.psm-choice { display: flex; flex-direction: column; gap: .55rem; }
.psm-radio {
	display: flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .9rem;
	color: var(--psm-text); cursor: pointer;
}
.psm-radio input[type="radio"] { width: auto; accent-color: var(--psm-accent); }

/* Info marker */
.psm-info {
	display: inline-flex; align-items: center; justify-content: center;
	width: 16px; height: 16px; margin-left: .25rem; border-radius: 50%;
	background: var(--psm-accent-soft); color: var(--psm-accent-dark);
	font-size: .7rem; font-weight: 700; font-style: normal; cursor: help; vertical-align: middle;
}
.psm-info:focus-visible { outline: 2px solid var(--psm-accent); outline-offset: 1px; }

/* Block tariff editor */
.psm-nm__blocks { margin-top: .75rem; }
.psm-nm__blocks-head {
	margin: .9rem 0 .4rem; font-size: .8rem; font-weight: 700; text-transform: uppercase;
	letter-spacing: .03em; color: var(--psm-accent-dark);
}
.psm-nm__block { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.psm-nm__block label { flex: 1; font-size: .82rem; color: var(--psm-muted); margin: 0; }
.psm-nm__block input { max-width: 130px; }

/* Monthly consumption grid */
.psm-nm__months { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .6rem; }
.psm-nm__month label { display: block; font-size: .78rem; font-weight: 600; margin-bottom: .2rem; color: var(--psm-muted); }

/* Results */
.psm-results {
	margin-top: 1.5rem; background: var(--psm-bg); border: 1px solid var(--psm-border);
	border-radius: var(--psm-radius); box-shadow: var(--psm-shadow); padding: 1.5rem;
}
.psm-results__title { margin: 0 0 1.1rem; font-size: 1.25rem; font-weight: 700; }
.psm-results__rates {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: .75rem; margin-bottom: 1.25rem;
}
.psm-stat {
	display: flex; flex-direction: column; gap: .25rem;
	padding: .9rem 1rem; background: var(--psm-accent-soft); border-radius: 10px;
}
.psm-stat__label {
	font-size: .76rem; font-weight: 600; color: var(--psm-accent-dark);
	text-transform: uppercase; letter-spacing: .03em;
}
.psm-stat__value {
	font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--psm-text);
}
.psm-results__hint { margin: 0 0 1rem; font-size: .85rem; color: var(--psm-muted); }
.psm-chart-wrap { position: relative; width: 100%; min-height: 360px; }

@media (max-width: 600px) {
	.psm-tool { font-size: 15px; }
	.psm-tool__title { font-size: 1.5rem; }
}
