.compound-view{margin-top:0}.compound-card{border:1px solid var(--border-gold);border-radius:22px;background:linear-gradient(145deg,rgba(230,174,61,.035),transparent 38%),var(--surface-2);overflow:hidden}
.compound-title{padding:22px 24px 16px;color:var(--gold-light);font-size:24px;line-height:1.2;font-weight:800}html[data-theme="light"] .compound-title{color:#bd8115}
.compound-fields{position:relative;display:grid;grid-template-columns:1fr 1fr;border-top:1px solid var(--border-gold)}.compound-fields::after{content:"";position:absolute;top:0;bottom:-20px;left:50%;width:1px;background:var(--border-gold);pointer-events:none;z-index:0}.compound-field{min-width:0;padding:24px;border-right:0}
.compound-label-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:13px}.compound-label-row label{margin:0}.compound-label-row output{display:inline-flex;align-items:center;justify-content:center;min-width:64px;height:32px;padding:0 10px;border-radius:10px;background:linear-gradient(180deg,var(--gold-light),var(--gold));color:#17110a;font-size:13px;font-weight:850}.compound-years-field input[type=range]{width:100%;height:7px;margin:0;appearance:none;-webkit-appearance:none;background:var(--track);border-radius:999px;outline:none;accent-color:var(--gold)}.compound-years-field input[type=range]::-webkit-slider-thumb{width:22px;height:22px;appearance:none;-webkit-appearance:none;border:2px solid var(--gold-light);border-radius:50%;background:var(--gold);cursor:pointer}.compound-years-field input[type=range]::-moz-range-thumb{width:20px;height:20px;border:2px solid var(--gold-light);border-radius:50%;background:var(--gold);cursor:pointer}.compound-years-field .range-labels{display:flex;justify-content:space-between;margin-top:9px;color:var(--muted);font-size:13px}
.compound-field label{display:block;margin-bottom:10px;color:var(--text);font-size:14px;font-weight:750}.compound-optional{color:var(--muted);font-size:11px;font-weight:600}
.compound-input{display:flex;align-items:center;min-height:54px;border:1px solid var(--border-gold);border-radius:12px;background:var(--input-bg)}.compound-input:focus-within{border-color:var(--gold);box-shadow:0 0 0 3px rgba(230,174,61,.1)}
.compound-input input{width:100%;height:52px;min-width:0;padding:0 15px;border:0;outline:0;background:transparent;color:var(--text);font-size:18px;font-weight:600}.compound-prefix,.compound-suffix{padding:0 12px;color:var(--muted);font-size:17px;font-weight:700}
.compound-frequency-field{display:flex;align-items:flex-end;border-top:1px solid var(--border-gold)}
@media(min-width:761px){.compound-field:nth-child(4){border-top:1px solid var(--border-gold)}}.compound-frequency-toggle{display:grid;grid-template-columns:1fr 1fr;gap:4px;width:100%;min-height:54px;padding:4px;border:1px solid var(--border-gold);border-radius:12px;background:var(--input-bg)}
.compound-frequency{border:0;border-radius:9px;background:transparent;color:var(--muted);cursor:pointer;font-weight:800;font-size:14px}.compound-frequency.active{background:linear-gradient(180deg,var(--gold-light),var(--gold));color:#17110a;box-shadow:0 4px 16px rgba(230,174,61,.16)}
.compound-results{margin-top:20px;padding:22px;border:1px solid var(--border-gold);border-radius:var(--radius);background:radial-gradient(circle at 50% 0%,rgba(230,174,61,.035),transparent 55%),var(--surface-2)}.compound-results-heading{margin:2px 0 17px;color:var(--gold-light);font-size:24px;line-height:1.2;font-weight:800}html[data-theme="light"] .compound-results-heading{color:#bd8115}
.compound-result-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.compound-result-grid article{min-height:108px;display:flex;flex-direction:column;justify-content:center;padding:18px;border:1px solid var(--border-gold);border-radius:15px;background:var(--surface-3)}.compound-result-grid span{display:block;margin-bottom:7px;color:var(--muted);font-size:13px;font-weight:600}.compound-result-grid strong{display:block;color:var(--text);font-size:21px;line-height:1.15;overflow-wrap:anywhere}.compound-result-grid strong.positive{color:#46c477}.compound-result-grid strong.negative{color:#d86a6a}
.compound-chart-section{margin-top:20px;padding:22px;border:1px solid var(--border-gold);border-radius:var(--radius);background:var(--surface-2)}.compound-chart-heading{margin:2px 0 12px;color:var(--gold-light);font-size:16px;font-weight:800}html[data-theme="light"] .compound-chart-heading{color:#bd8115}
.compound-chart-wrap{display:grid;grid-template-columns:100px 1fr;min-height:320px;border:1px solid var(--border-gold);border-radius:15px;background:var(--surface-3);overflow:visible}.compound-axis{position:relative;min-height:320px;border-right:1px solid var(--border-gold);font-size:11px;color:var(--muted)}.compound-axis span{position:absolute;right:8px;transform:translateY(-50%);white-space:nowrap}.compound-chart-plot{min-width:0;min-height:320px;overflow:hidden}#cg-chart{display:block;width:100%;height:320px}#cg-chart .cg-grid-line{stroke:var(--border-gold);stroke-width:1}#cg-chart .cg-line{fill:none;stroke:var(--gold);stroke-width:4;stroke-linecap:round;stroke-linejoin:round}#cg-chart .cg-contribution-line{fill:none;stroke:var(--muted);stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:7 6}#cg-chart .cg-dot{fill:var(--gold-light);stroke:var(--gold);stroke-width:2}#cg-chart .cg-x-label{fill:var(--muted);font-size:13px}.compound-chart-legend{display:flex;justify-content:center;flex-wrap:wrap;gap:20px;margin-top:13px;color:var(--muted);font-size:12px;font-weight:700}.compound-chart-legend span{display:inline-flex;align-items:center;gap:7px}.compound-chart-legend i{display:inline-block;width:28px;height:3px;border-radius:999px}.compound-chart-legend .legend-growth{background:var(--gold)}.compound-chart-legend .legend-contributions{height:2px;background:var(--muted);background-image:linear-gradient(to right,var(--muted) 0 60%,transparent 60% 100%);background-size:10px 2px}
.compound-reset{width:100%;min-height:58px;margin-top:18px;display:flex;align-items:center;justify-content:center;gap:12px;border:1px solid var(--border-gold);border-radius:14px;background:linear-gradient(180deg,#f2c65b,#d99d28);color:#16100a;box-shadow:0 10px 28px rgba(214,154,35,.18);cursor:pointer;font-weight:800}.compound-reset svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
@media(min-width:761px){.compound-field{background:transparent;position:relative;z-index:1}.compound-error-slot{position:relative;z-index:2}}
@media(max-width:760px){.compound-field:nth-child(odd){border-right:0}.compound-error-slot{padding:0 18px 16px}.calculator-tabs{margin-bottom:18px}.compound-title{font-size:18px;padding:19px 18px 14px}.compound-fields{grid-template-columns:1fr}.compound-field,.compound-field:nth-child(2n){padding:19px 18px;border-right:0;border-bottom:1px solid var(--border-gold)}.compound-frequency-field{border-top:0}.compound-field:last-child{border-bottom:0}.compound-results{padding:16px}.compound-results-heading{font-size:18px}.compound-result-grid{grid-template-columns:1fr 1fr}.compound-result-grid article{min-height:94px;padding:15px}.compound-result-grid strong{font-size:18px}.compound-chart-section{padding:16px}.compound-chart-wrap,.compound-axis,.compound-chart-plot,#cg-chart{min-height:260px;height:260px}#cg-chart{height:260px}}
@media(max-width:420px){.compound-error-slot{padding:0 16px 14px}.compound-title,.compound-results-heading{font-size:16px}.compound-result-grid{grid-template-columns:1fr}.compound-chart-wrap,.compound-axis,.compound-chart-plot,#cg-chart{min-height:220px;height:220px}#cg-chart{height:220px}}

.compound-table-section{margin-top:20px;padding:22px;border:1px solid var(--border-gold);border-radius:var(--radius);background:var(--surface-2);display:flex;flex-direction:column;align-items:center}.compound-table-content{width:100%}.compound-table-section:has(.compound-table-content[hidden]){justify-content:center}.compound-table-section:has(.compound-table-content[hidden]) .compound-table-toggle{margin:0 auto}
.compound-table-toggle{display:block;margin:0 auto 20px;min-width:128px;min-height:46px;padding:0 18px;border:1px solid var(--gold-light);border-radius:6px;background:linear-gradient(180deg,#f2c65b,#d99d28);color:#17110a;font-size:14px;font-weight:850;letter-spacing:.02em;cursor:pointer;box-shadow:0 0 0 1px rgba(255,255,255,.12) inset}
.compound-table-toggle:hover{filter:brightness(1.08)}
.compound-table-toggle:focus-visible{outline:2px solid var(--gold-light);outline-offset:2px}
.compound-table-content[hidden]{display:none}
.compound-table-title{margin:0 0 6px;text-align:center;color:var(--text);font-size:18px;line-height:1.25;font-weight:850}
.compound-table-wrap{overflow-x:auto;border:1px solid var(--border-gold);border-radius:0;background:var(--surface-3)}
.compound-table{width:100%;border-collapse:collapse;min-width:560px;color:var(--text);font-size:14px}
.compound-table th,.compound-table td{padding:10px 12px;border-right:1px solid var(--border-gold);border-bottom:1px solid var(--border-gold);text-align:left;white-space:nowrap}
.compound-table th:last-child,.compound-table td:last-child{border-right:0}
.compound-table tbody tr:last-child td{border-bottom:0}
.compound-table th{background:rgba(230,174,61,.07);color:var(--text);font-weight:800}
.compound-table td{background:var(--surface-3);font-variant-numeric:tabular-nums}
@media(max-width:760px){.compound-table-section{padding:16px}.compound-table-title{font-size:16px}.compound-table{font-size:13px;min-width:500px}.compound-table th,.compound-table td{padding:9px 10px}.compound-table-toggle{margin-bottom:16px}}

.compound-field .required-star{color:#e56b6b;font-weight:900;margin-left:3px}

/* Required-field error: normal full-width row, never overlaps other controls. */
.compound-error-slot{grid-column:1 / -1;padding:0 24px 18px;z-index:2}
.compound-error-slot .error-message{pointer-events:auto}

/* Compound: one always-present structural 1px divider. The error row sits above it. */
@media(max-width:760px){
  .compound-fields::after{display:none}
}

/* Mobile: annual table shrinks to fit the screen instead of being clipped. */
.compound-table-content{min-width:0;max-width:100%}
.compound-table-wrap{max-width:100%}
@media(max-width:760px){
  .compound-table{min-width:0;table-layout:fixed;font-size:12.5px}
  .compound-table th,.compound-table td{padding:8px 7px;white-space:normal;overflow-wrap:anywhere;vertical-align:top}
  .compound-table th:first-child,.compound-table td:first-child{width:4.8em;white-space:nowrap}
}
@media(max-width:420px){
  .compound-table{font-size:12px}
  .compound-table th,.compound-table td{padding:8px 6px}
}
