/* Ronak SIP Calculator — scoped to .rp-tool, uses the site's --rp-* variables (with fallbacks). */
.rp-tool {
	--sip-ink: var(--rp-ink, #14171C);
	--sip-muted: var(--rp-muted, #60646A);
	--sip-line: var(--rp-line, #D9D7D0);
	--sip-paper: var(--rp-paper, #FFFFFF);
	--sip-tint: var(--rp-paper-tint, #F4F3EF);
	--sip-teal: var(--rp-teal, #2F5D5A);
	--sip-teal-tint: var(--rp-teal-tint, #E5EEEC);
	--sip-ochre: var(--rp-ochre, #B8873A);
	--sip-ochre-tint: var(--rp-ochre-tint, #F4EBDD);
	color: var(--sip-ink);
	font-size: 16px;
	line-height: 1.6;
	margin: 0 0 16px;
}
.rp-tool *, .rp-tool *::before, .rp-tool *::after { box-sizing: border-box; }
.rp-tool .rp-sip-input, .rp-sip-big, .rp-sip-final-n, .rp-sip-row-v, .rp-sip-bar-v, .rp-sip-tip b, .rp-sip-table td, .rp-sip-axis { font-variant-numeric: tabular-nums; }
.rp-tool [hidden] { display: none !important; }

.rp-sip-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 24px; align-items: start; }
.rp-sip-card { background: var(--sip-paper); border: 1px solid var(--sip-line); border-top: 3px solid var(--sip-teal); padding: 24px; }
.rp-sip-res { border-top-color: var(--sip-ochre); transition: opacity .15s; position: sticky; top: 24px; }
.rp-sip-hero { padding-bottom: 16px; margin-bottom: 8px; border-bottom: 1px solid var(--sip-line); }

/* Result rows */
.rp-sip-rows { list-style: none; margin: 0; padding: 0; }
.rp-sip-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 0; font-size: 15px; }
.rp-sip-row-l { color: var(--sip-muted); }
.rp-sip-row-v { font-weight: 700; white-space: nowrap; }
.rp-sip-row.is-gain .rp-sip-row-v { color: var(--sip-teal); }
.rp-sip-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 10px; vertical-align: 1px; }
.rp-sip-dot-inv { background: var(--sip-ochre); }
.rp-sip-dot-val { background: var(--sip-teal); }
.rp-sip-final { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-top: 1px solid var(--sip-line); margin: 10px 0 18px; padding-top: 16px; }
.rp-sip-final-l { font-weight: 700; font-size: 16px; }
.rp-sip-final small { display: block; font-weight: 400; font-size: 13px; color: var(--sip-muted); }
.rp-sip-final-v { text-align: right; }
.rp-sip-final-n { font-family: "Fraunces", Georgia, serif; font-weight: 500; letter-spacing: -0.02em; font-size: 40px; line-height: 1.05; }
.rp-sip-help { font-size: 12px; color: var(--sip-muted); margin-top: 4px; }

/* Inflation on/off switch */
.rp-sip-switch { display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 600; border-top: 1px solid var(--sip-line); padding: 16px 0; cursor: pointer; }
.rp-tool .rp-sip-switch input { -webkit-appearance: none; appearance: none; width: 38px; height: 20px; margin: 0; background: var(--sip-line); position: relative; cursor: pointer; border-radius: 0; transition: background .15s; flex-shrink: 0; }
.rp-sip-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; background: #fff; transition: transform .15s; }
.rp-sip-switch input:checked { background: var(--sip-teal); }
.rp-sip-switch input:checked::after { transform: translateX(18px); }
.rp-sip-switch input:focus-visible { outline: 2px solid var(--sip-teal); outline-offset: 2px; }
.rp-sip-res.is-stale { opacity: .45; }
.rp-sip-res.is-fresh > * { animation: rp-sip-fade .22s ease-out; }
@keyframes rp-sip-fade { from { opacity: .35; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .rp-sip-res.is-fresh > * { animation: none; } .rp-sip-res { transition: none; } }

/* Mode switch */
.rp-sip-seg { display: flex; border: 1px solid var(--sip-ink); margin-bottom: 20px; }
.rp-sip-seg-b { flex: 1; background: var(--sip-paper); color: var(--sip-ink); border: 0; padding: 10px 12px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; border-radius: 0; }
.rp-sip-seg-b + .rp-sip-seg-b { border-left: 1px solid var(--sip-ink); }
.rp-sip-seg-b.is-on { background: var(--sip-ink); color: #fff; }
.rp-sip-seg-b:hover:not(.is-on) { background: var(--sip-teal-tint); }
.rp-sip-seg-b:focus-visible { outline: 2px solid var(--sip-teal); outline-offset: 2px; }

/* Fields */
.rp-sip-field { margin-bottom: 18px; }
.rp-sip-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rp-sip-label { font-size: 14px; font-weight: 600; }
.rp-sip-box { display: flex; align-items: center; border: 1px solid var(--sip-line); background: var(--sip-paper); width: 170px; flex-shrink: 0; }
.rp-sip-box:focus-within { border-color: var(--sip-teal); }
.rp-sip-affix { padding: 0 8px; font-size: 13px; color: var(--sip-muted); white-space: nowrap; }
.rp-tool .rp-sip-input { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; padding: 8px 10px; font: inherit; font-weight: 600; text-align: right; color: var(--sip-ink); border-radius: 0; box-shadow: none; -moz-appearance: textfield; }
.rp-sip-affix + .rp-sip-input { padding-left: 0; }
.rp-tool .rp-sip-input:focus { outline: none; }
.rp-sip-input::-webkit-outer-spin-button, .rp-sip-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.rp-sip-hint { font-size: 12px; color: var(--sip-muted); text-align: right; min-height: 18px; }

.rp-sip-range { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; margin: 12px 0 2px; border-radius: 0; cursor: pointer;
	background: linear-gradient(to right, var(--sip-teal) var(--rp-fill, 0%), var(--sip-line) var(--rp-fill, 0%)); }
.rp-sip-range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; background: var(--sip-ink); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--sip-ink); border-radius: 50%; cursor: grab; }
.rp-sip-range:active::-webkit-slider-thumb { cursor: grabbing; background: var(--sip-teal); box-shadow: 0 0 0 1px var(--sip-teal), 0 0 0 6px var(--sip-teal-tint); }
.rp-sip-range::-moz-range-thumb { width: 14px; height: 14px; background: var(--sip-ink); border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px var(--sip-ink); cursor: grab; }

.rp-sip-more { border-top: 1px solid var(--sip-line); padding-top: 14px; margin-top: 4px; }
.rp-sip-more > summary, .rp-sip-det > summary { cursor: pointer; padding: 10px 0; min-height: 44px; font-size: 14px; font-weight: 700; color: var(--sip-teal); margin-bottom: 14px; }
.rp-sip-check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.rp-sip-check input { margin-top: 5px; accent-color: var(--sip-teal); }
.rp-sip-error { color: #A23B2A; font-size: 14px; font-weight: 600; }
.rp-sip-error:empty { display: none; }
.rp-sip-big.is-text { font-size: 36px; }
.rp-sip-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Mobile result bar */
.rp-sip-bar { display: none; }
@media (max-width: 900px) {
	.rp-sip-bar:not([hidden]) { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; align-items: center; justify-content: space-between; gap: 12px;
		background: var(--sip-ink); color: #fff; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px rgba(0,0,0,.12); }
	.rp-sip-bar.is-stale { opacity: .6; }
	.rp-sip-bar-t { display: flex; flex-direction: column; line-height: 1.25; }
	.rp-sip-bar-l { font-size: 12px; color: #c9ccd1; }
	.rp-sip-bar-v { font-family: "Fraunces", Georgia, serif; font-size: 22px; font-weight: 500; letter-spacing: -0.02em; }
	.rp-tool .rp-sip-bar-b { background: var(--sip-ochre); color: var(--sip-ink); border: 0; border-radius: 0; padding: 10px 14px; min-height: 44px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
}

/* Results */
.rp-sip-eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--sip-teal); }
.rp-sip-eyebrow::before { content: ""; display: inline-block; width: 6px; height: 6px; background: var(--sip-ochre); border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.rp-sip-big { font-family: "Fraunces", Georgia, serif; font-weight: 500; letter-spacing: -0.02em; font-size: 48px; line-height: 1.1; margin: 6px 0 2px; }
.rp-sip-words { color: var(--sip-muted); font-size: 14px; }
.rp-sip-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1px; background: var(--sip-line); border: 1px solid var(--sip-line); margin: 20px 0 16px; }
.rp-sip-stat { padding: 12px 14px; background: var(--sip-paper); }
.rp-sip-info { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; padding: 0; border: 1px solid var(--sip-muted); border-radius: 50%; background: transparent; color: var(--sip-muted); font: italic 700 10px/1 Georgia, serif; cursor: pointer; vertical-align: 1px; }
.rp-sip-info::before { content: ""; position: absolute; inset: -14px; }
.rp-sip-info:hover, .rp-sip-info[aria-expanded="true"] { border-color: var(--sip-teal); color: #fff; background: var(--sip-teal); }
.rp-sip-explain { margin: -8px 0 16px; padding: 10px 14px; background: var(--sip-teal-tint); font-size: 14px; }
.rp-sip-toggle { font-weight: 600; margin: 0 0 14px; }
.rp-sip-inflbox { padding: 14px 14px 2px; background: var(--sip-tint); margin: 0 0 16px; }
.rp-sip-inflbox .rp-sip-check { margin-bottom: 14px; }
.rp-sip-stat-l { font-size: 12px; color: var(--sip-muted); }
.rp-sip-stat-v { font-weight: 700; font-size: 17px; }
.rp-sip-stat.is-gain .rp-sip-stat-v { color: var(--sip-teal); }
.rp-sip-notes { list-style: none; margin: 0 0 16px; padding: 10px 14px; background: var(--sip-ochre-tint); border-left: 2px solid var(--sip-ochre); font-size: 14px; }
.rp-sip-notes li { margin: 2px 0; }

/* Chart */
.rp-sip-chart-host { position: relative; }
.rp-sip-chart { touch-action: pan-y; cursor: crosshair; }
.rp-sip-guide { stroke: var(--sip-muted); stroke-width: 1; stroke-dasharray: 3 3; }
.rp-sip-pt-val { fill: var(--sip-teal); stroke: #fff; stroke-width: 2; }
.rp-sip-pt-inv { fill: var(--sip-ochre); stroke: #fff; stroke-width: 2; }
.rp-sip-tip { position: absolute; z-index: 2; pointer-events: none; background: var(--sip-ink); color: #fff; padding: 8px 12px; font-size: 13px; line-height: 1.5; white-space: nowrap; }
.rp-sip-tip-h { font-weight: 700; margin-bottom: 2px; }
.rp-sip-tip-r b { margin-left: 6px; }
.rp-sip-tip .rp-sip-dot { width: 8px; height: 8px; margin-right: 6px; }
.rp-sip-chart { display: block; overflow: visible; }
.rp-sip-chart .rp-sip-gl { stroke: var(--sip-line); stroke-width: 1; }
.rp-sip-axis { fill: var(--sip-muted); font-size: 11px; }
.rp-sip-area { fill: var(--sip-teal-tint); opacity: .7; }
.rp-sip-l-val { stroke: var(--sip-teal); stroke-width: 2.5; }
.rp-sip-l-inv { stroke: var(--sip-ochre); stroke-width: 2; stroke-dasharray: 5 4; }
.rp-sip-legend { display: flex; gap: 18px; font-size: 13px; color: var(--sip-muted); margin: 6px 0 14px; }
.rp-sip-sw { display: inline-block; width: 16px; height: 0; border-top: 3px solid var(--sip-teal); vertical-align: middle; margin-right: 6px; }
.rp-sip-sw-inv { border-top: 2px dashed var(--sip-ochre); }

.rp-sip-det { border-top: 1px solid var(--sip-line); padding-top: 12px; margin-top: 12px; }
.rp-sip-method { font-size: 12px; color: var(--sip-muted); margin: 6px 0 0; }
.rp-sip-years { margin-top: 16px; padding: 0 24px; border-top-width: 1px; }
.rp-sip-years > summary { cursor: pointer; font-size: 15px; font-weight: 700; color: var(--sip-teal); padding: 16px 0; min-height: 44px; }
.rp-sip-years[open] > summary { border-bottom: 1px solid var(--sip-line); margin-bottom: 4px; }
.rp-sip-years .rp-sip-table-wrap { padding-bottom: 16px; }
.rp-sip-det > summary { margin-bottom: 8px; }
.rp-sip-det ul { margin: 0 0 0 1.2em; padding: 0; font-size: 14px; color: var(--sip-muted); }
.rp-sip-table-wrap { overflow-x: auto; }
.rp-tool .rp-sip-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 0; border: 0; }
.rp-tool .rp-sip-table th, .rp-tool .rp-sip-table td { padding: 7px 10px; border: 0; border-bottom: 1px solid var(--sip-line); text-align: right; white-space: nowrap; }
.rp-tool .rp-sip-table th { font-size: 12px; color: var(--sip-muted); font-weight: 600; background: var(--sip-tint); }
.rp-tool .rp-sip-table th:first-child, .rp-tool .rp-sip-table td:first-child { text-align: left; }

/* Footer */
.rp-sip-foot { margin-top: 20px; }
.rp-sip-cta-row { font-weight: 600; margin: 0 0 12px; }
.rp-tool .rp-sip-cta { display: inline-block; background: var(--sip-ink); color: #fff; padding: 12px 20px; font-size: 14px; font-weight: 700; text-decoration: none; margin-left: 6px; }
.rp-tool .rp-sip-cta:hover { background: var(--sip-teal); color: #fff; }
.rp-sip-disc { font-size: 13px; color: var(--sip-muted); border-left: 2px solid var(--sip-ochre); padding-left: 12px; margin: 0; }
.rp-sip-arn { display: block; margin-top: 2px; }

@media (max-width: 900px) {
	.rp-sip-grid { grid-template-columns: minmax(0, 1fr); }
	.rp-sip-res { position: static; }
}
@media (max-width: 600px) {
	.rp-sip-card { padding: 18px 16px; }
	.rp-sip-years { padding: 0 16px; }
	.rp-sip-label { font-size: 15px; }
	.rp-sip-range { height: 6px; margin: 16px 0 6px; }
	.rp-sip-range::-webkit-slider-thumb { width: 24px; height: 24px; }
	.rp-sip-range::-moz-range-thumb { width: 20px; height: 20px; }
	.rp-sip-axis { font-size: 12px; }
	.rp-sip-row { font-size: 14px; }
	.rp-sip-big { font-size: 38px; }
	.rp-sip-final-n { font-size: 32px; }
	.rp-sip-box { width: 150px; }
	.rp-sip-stats { grid-template-columns: 1fr 1fr; }
	.rp-tool .rp-sip-cta { margin: 8px 0 0; }
}
