/* ==========================================================================
   Bandwidth Calculator — page-specific bits only. The note/error text and
   .pv-list/.pv-table components come from tool-shared.css (loaded alongside
   this file); form fields, the mode switcher and the result readout are new
   here, built from the same tokens (colors, radii, shadows, type) as the
   rest of the site — no new palette.
   ========================================================================== */

#pv-bwcalc [hidden] { display: none !important; }

.pv-bwcalc {
	max-width: 980px;
	margin: 0 auto;
	padding: clamp(20px, 4vw, 32px);
	border: 1px solid var(--pv-line);
	border-radius: var(--pv-r-lg);
	background: linear-gradient(180deg, #fff 0%, var(--pv-soft-2) 100%);
	box-shadow: var(--pv-shadow-lg);
	text-align: left;
}

/* ---------- Mode switcher ---------- */

.pv-bwmodes {
	display: flex;
	gap: 4px;
	margin: 0 0 26px;
	padding: 5px;
	border: 1px solid var(--pv-line);
	border-radius: 999px;
	background: var(--pv-soft-2);
}
.pv-bwmode {
	flex: 1;
	padding: 11px 10px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--pv-ink-2);
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 700;
	letter-spacing: -.005em;
	text-align: center;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.pv-bwmode:hover { color: var(--pv-ink); }
.pv-bwmode.is-active {
	background: var(--pv-ink);
	color: #fff;
	box-shadow: 0 1px 0 rgba(255, 255, 255, .16) inset, 0 10px 20px -12px rgba(13, 16, 21, .5);
}

@media (max-width: 560px) {
	.pv-bwmodes { flex-direction: column; border-radius: 18px; }
	.pv-bwmode { border-radius: 12px; padding: 12px 10px; }
}

/* ---------- Panel layout: fields | result ---------- */

.pv-bwpanel {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, .82fr);
	gap: clamp(20px, 3vw, 30px);
	align-items: start;
}
.pv-bwpanel > * { min-width: 0; }

@media (max-width: 760px) {
	.pv-bwpanel { grid-template-columns: 1fr; }
}

/* ---------- Fields ---------- */

.pv-bw-field { margin-bottom: 18px; }
.pv-bw-field:last-child { margin-bottom: 0; }

.pv-bw-field label {
	display: block;
	margin: 0 0 8px;
	color: var(--pv-ink);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: -.005em;
}

.pv-bw-field__row {
	display: flex;
	gap: 8px;
}
.pv-bw-field__row.pv-bw-field__row--swap { align-items: center; }

.pv-bw-input,
.pv-bw-select {
	height: 48px;
	padding: 0 14px;
	border: 1px solid var(--pv-line);
	border-radius: var(--pv-r-sm);
	background: #fff;
	color: var(--pv-ink);
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	transition: border-color .18s ease, box-shadow .18s ease;
}
.pv-bw-input {
	flex: 1 1 auto;
	min-width: 0;
}
.pv-bw-select {
	flex: 0 0 auto;
	width: 112px;
	padding-right: 34px;
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23767c89' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	background-size: 16px;
	cursor: pointer;
}
.pv-bw-select#conv-from,
.pv-bw-select#conv-to { width: 100px; }

.pv-bw-input:hover,
.pv-bw-select:hover { border-color: #d7dae1; }

.pv-bw-input:focus,
.pv-bw-select:focus {
	outline: none;
	border-color: var(--pv-cyan);
	box-shadow: 0 0 0 3px rgba(14, 165, 196, .14);
}

.pv-bw-input.is-invalid {
	border-color: rgba(214, 60, 60, .5);
	box-shadow: 0 0 0 3px rgba(214, 60, 60, .1);
}

.pv-bw-input::-webkit-outer-spin-button,
.pv-bw-input::-webkit-inner-spin-button { margin-left: 6px; }

/* ---------- Swap button (converter) ---------- */

.pv-swap {
	display: grid;
	place-items: center;
	flex: none;
	width: 48px;
	height: 48px;
	border: 1px solid var(--pv-line);
	border-radius: 50%;
	background: #fff;
	color: var(--pv-ink);
	cursor: pointer;
	box-shadow: var(--pv-shadow-pill);
	transition: transform .2s ease, border-color .2s ease;
}
.pv-swap:hover { border-color: #d7dae1; transform: rotate(180deg); }
.pv-swap .pv-ico { width: 18px; height: 18px; }

@media (max-width: 420px) {
	.pv-field__row--swap { flex-wrap: wrap; }
	.pv-swap { margin: 2px auto; }
}

/* ---------- Result (dark screen, same component as the homepage calculator preview) ---------- */

.pv-bwresult { height: 100%; display: flex; flex-direction: column; }
.pv-bwresult__value {
	margin: 0 0 4px !important;
	color: #fff !important;
	font-size: clamp(30px, 5vw, 38px) !important;
	font-weight: 700;
	letter-spacing: -.02em;
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
	border-bottom: 0 !important;
	padding-bottom: 0 !important;
}
.pv-bwresult__value small {
	margin-left: 6px;
	color: #8a93a3;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0;
}
.pv-bwresult__secondary {
	margin: 0 0 14px;
	padding-bottom: 12px;
	border-bottom: 1px solid rgba(255, 255, 255, .08);
	color: #7ff0dd;
	font-family: var(--pv-mono);
	font-size: 14px;
	font-weight: 600;
}
.pv-bwresult dl { margin-top: auto; }

/* ---------- Reset action + fine print ---------- */

.pv-bwpanel__foot {
	grid-column: 1 / -1;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 22px;
	padding-top: 18px;
	border-top: 1px solid var(--pv-line-2);
}
.pv-bwpanel__hint {
	margin: 0;
	color: var(--pv-muted);
	font-size: 12.5px;
	line-height: 1.6;
	max-width: 480px;
}

.pv-bwnote {
	margin: 16px 0 0 !important;
	padding: 12px 14px;
	border: 1px solid var(--pv-line-2);
	border-radius: 14px;
	background: var(--pv-soft-2);
	color: var(--pv-ink-2) !important;
	font-size: 13px !important;
	line-height: 1.6;
}

/* ---------- Formula callout ---------- */

/* ---------- Hint paragraphs inside centered sections ---------- */

.pv-bwhint {
	max-width: 640px;
	margin-inline: auto;
	text-align: left;
}
.pv-bwhint--wide { max-width: 760px; }

.pv-formula {
	max-width: 560px;
	margin: 24px auto;
	padding: 18px 24px;
	border: 1px solid var(--pv-line);
	border-radius: var(--pv-r);
	background: var(--pv-soft);
	color: var(--pv-ink);
	font-family: var(--pv-mono);
	font-size: clamp(16px, 3vw, 19px);
	font-weight: 700;
	letter-spacing: -.01em;
	text-align: center;
}
