/* Calculator engine styles. Colours come from the theme's custom properties when present. */
.ptw-calc, .ptw-bank {
	--calc-ink: var(--ptw-ink, #000000);
	--calc-muted: var(--ptw-muted, #5b5b5b);
	--calc-line: var(--ptw-line, #e3e3e0);
	--calc-bg: var(--ptw-surface, #ffffff);
	--calc-soft: var(--ptw-soft, #f6f6f3);
	--calc-mark: var(--ptw-yellow, #ffd200);
	display: grid;
	gap: 24px;
	container-type: inline-size;
	margin: 0 0 40px;
	padding: 32px;
	border: 1px solid var(--calc-line);
	border-radius: 16px;
	background: var(--calc-bg);
	color: var(--calc-ink);
	font-variant-numeric: tabular-nums;
}
.ptw-calc__top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); gap: 32px; align-items: start; }
.ptw-calc__form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; align-content: start; }
.ptw-calc__field label { display: block; margin-bottom: 6px; font-size: 0.875rem; font-weight: 600; color: #000; }
.ptw-calc__input {
	display: flex; align-items: center; gap: 8px;
	padding: 0 14px; border: 1px solid var(--calc-line); border-radius: 12px; background: #fff;
	transition: border-color .15s, box-shadow .15s;
}
.ptw-calc__input:focus-within { border-color: var(--calc-ink); box-shadow: 0 0 0 3px rgba(17, 17, 17, .08); }
.ptw-calc__input input {
	flex: 1; min-width: 0; height: 48px; border: 0; outline: 0; background: transparent;
	font: inherit; font-size: 1.0625rem; font-weight: 600; color: var(--calc-ink);
}
.ptw-calc__affix { color: var(--calc-muted); font-size: 0.875rem; font-weight: 600; }
.ptw-calc__field select {
	width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--calc-line); border-radius: 12px;
	background: #fff; font: inherit; font-weight: 600; color: var(--calc-ink);
}
.ptw-calc__help { margin: 6px 0 0; font-size: 0.8125rem; color: var(--calc-muted); }

.ptw-calc__results {
	position: sticky; top: 96px; display: grid; gap: 4px;
	padding: 26px; border-radius: 16px; background: #000; color: #fff;
}
.ptw-calc__result { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid #2c2c2c; }
.ptw-calc__result:last-child { border-bottom: 0; }
.ptw-calc__result-label { font-size: 0.9375rem; color: #b9bec4; }
.ptw-calc__value { font-family: var(--ptw-head, inherit); font-weight: 750; font-size: 1.0625rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ptw-calc__result.is-primary { order: -1; display: grid; justify-content: start; gap: 6px; padding: 4px 0 18px; }
.ptw-calc__result.is-primary .ptw-calc__value {
	font-family: var(--ptw-head, Arial, sans-serif); font-weight: 850; font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1.1;
	background: var(--calc-mark); color: #000; padding: 0.04em 0.28em; letter-spacing: -0.015em;
	justify-self: start;
}
.ptw-calc__words { font-size: 0.9375rem; color: #b9bec4; }
.ptw-calc__summary { margin: 0; font-size: 1rem; line-height: 1.55; color: #fff; }
.ptw-calc__summary:empty, .ptw-calc__split:empty { display: none; }
.ptw-calc__split { padding: 14px 0 6px; }
.ptw-calc__bar { display: flex; height: 12px; border-radius: 12px; overflow: hidden; background: #2c2c2c; }
.ptw-calc__bar-part { display: block; height: 100%; transition: width .25s ease; }
.ptw-calc__bar-part.is-0, .ptw-calc__legend i.is-0 { background: #fff; }
.ptw-calc__bar-part.is-1, .ptw-calc__legend i.is-1 { background: var(--calc-mark); }
.ptw-calc__legend { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 0.875rem; color: #b9bec4; }
.ptw-calc__legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; }
.ptw-calc__legend b { color: #fff; font-weight: 600; }

.ptw-calc__tables { display: grid; gap: 20px; }
.ptw-calc__tables:empty { display: none; }
.ptw-calc__table { max-height: 520px; overflow: auto; border: 1px solid var(--calc-line); border-radius: 12px; }
.ptw-calc__table h3 { margin: 0; padding: 14px 16px; font-family: var(--ptw-head, inherit); font-weight: 800; font-size: 1rem; border-bottom: 1px solid var(--calc-line); }
.ptw-calc__table tr.is-here td { background: var(--calc-mark); color: #000; font-weight: 700; }
.ptw-calc__here { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 12px; background: #000; color: #fff; font-size: 0.75rem; font-weight: 600; }
.ptw-calc__table table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.ptw-calc__table th { position: sticky; top: 0; background: var(--calc-soft); text-align: right; font-weight: 600; }
.ptw-calc__table th, .ptw-calc__table td { padding: 10px 16px; border-bottom: 1px solid var(--calc-line); text-align: right; white-space: nowrap; }
.ptw-calc__table th:first-child, .ptw-calc__table td:first-child { text-align: left; }
.ptw-calc__source { margin: 0; font-size: 0.8125rem; color: var(--calc-muted); }
.ptw-calc__source a { color: inherit; }

.ptw-alert { margin-top: 14px; padding-top: 16px; border-top: 1px solid #2c2c2c; }
.ptw-alert label { display: block; margin-bottom: 8px; font-size: 0.875rem; font-weight: 600; color: #fff; }
.ptw-alert__row { display: flex; gap: 8px; }
.ptw-alert input[type="email"] { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border: 1px solid var(--calc-line); border-radius: 12px; font: inherit; background: #fff; }
.ptw-alert button { height: 44px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--calc-mark); color: #000; font: inherit; font-weight: 600; cursor: pointer; }
.ptw-alert button:disabled { opacity: .6; }
.ptw-alert__hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.ptw-alert__msg { margin: 8px 0 0; font-size: 0.875rem; color: #fff; }
.ptw-alert__msg:empty { display: none; }
.ptw-alert.is-done .ptw-alert__row { display: none; }

/* Bank charges tables */
.ptw-bank { margin: 24px 0 32px; font-size: 0.9375rem; line-height: 1.5; }
.ptw-bank__period { margin: 0 0 10px; color: var(--ptw-muted, #555b57); font-size: 0.875rem; }
.ptw-bank .ptw-calc__table { max-height: none; }
.ptw-bank td { white-space: normal; text-align: left; vertical-align: top; min-width: 140px; }
.ptw-bank th { text-align: left; }
.ptw-bank td:first-child { font-weight: 600; min-width: 160px; }
.ptw-bank__tag { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 12px; background: var(--ptw-soft, #f3f4f1); font-size: 0.75rem; font-weight: 600; }
.ptw-bank__na { color: var(--ptw-muted, #555b57); }

/* Narrow places (inside an article column, tablets): stack the form above the results. */
@container (max-width: 880px) {
	.ptw-calc__top { grid-template-columns: minmax(0, 1fr); gap: 20px; }
	.ptw-calc__results { position: static; }
}

@media (max-width: 760px) {
	.ptw-calc { padding: 20px; gap: 20px; }
	.ptw-calc__top { grid-template-columns: minmax(0, 1fr); gap: 20px; }
	.ptw-calc__form { grid-template-columns: minmax(0, 1fr); }
	.ptw-calc__results { padding: 18px; position: static; grid-template-columns: minmax(0, 1fr); }
	.ptw-calc__result.is-primary .ptw-calc__value { font-size: clamp(1.6rem, 8vw, 2rem); }
}
