:root{--bg:#f7f9fc;--card:#fff;--accent:#1e88e5;--muted:#666}
*{box-sizing:border-box;font-family:Segoe UI,Roboto,Helvetica,Arial,sans-serif}
html,body{height:100%;margin:0;background:var(--bg);color:#111}
.container{max-width:980px;margin:28px auto;padding:20px;height:calc(100vh - 56px);display:flex;flex-direction:column}
h1{margin:0 0 12px}
.card{background:var(--card);border-radius:8px;padding:14px;margin-top:16px;box-shadow:0 1px 3px rgba(0,0,0,.06)}
.layout{display:grid;grid-template-columns:max-content 1.5fr;gap:18px;align-items:start;flex:1}
.results{display:flex;flex-direction:column;gap:16px;min-height:0;margin-top:16px}
.results .card{margin-top:0}
.sidebar{padding:6px;align-self:start}
.sidebar .grid{display:grid;grid-template-columns:1fr;gap:10px}
.sidebar .actions{margin-top:12px}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px}
label{display:flex;flex-direction:column;font-size:14px}
input{padding:8px;border:1px solid #ccd;border-radius:6px;margin-top:6px}
.muted{opacity:0.6}
/* Status badge styles */
.status-badge{
  display:inline-block;
  padding:6px 12px;
  border-radius:6px;
  font-size:15px;
  font-weight:600;
  margin-left:10px;
}
.status-good{background:#d4edda;color:#155724}
.status-ok{background:#fff3cd;color:#856404}
.status-bad{background:#f8d7da;color:#721c24}
/* small info icon next to form labels */
.info-icon{display:inline-block;margin-left:8px;color:var(--muted);font-size:14px;line-height:1;cursor:help}
.info-icon:focus{outline:2px solid rgba(30,136,229,0.25);border-radius:4px}

/* round clickable info button with tooltip (hover/focus shows tooltip; click toggles) */
.info-btn{appearance:none;border:0;background:var(--bg);color:var(--muted);width:22px;height:22px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:13px;line-height:1;margin-left:8px;cursor:pointer}
.info-btn:focus{outline:2px solid rgba(30,136,229,0.25)}
.info-btn[aria-expanded="true"]{color:var(--accent)}
.info-btn::after{content:attr(data-tooltip);position:absolute;white-space:nowrap;background:#222;color:#fff;padding:6px 8px;border-radius:6px;font-size:13px;transform:translateY(-6px);opacity:0;pointer-events:none;transition:opacity .12s ease,transform .12s ease;z-index:60}
.info-btn:hover::after,.info-btn:focus::after{opacity:1;transform:translateY(-10px);pointer-events:auto}
.info-btn.tooltip-visible::after{opacity:1;transform:translateY(-10px);pointer-events:auto}
.actions{margin-top:12px}
button{background:var(--accent);color:#fff;border:0;padding:8px 12px;border-radius:6px;margin-right:8px;cursor:pointer}
button#resetBtn{background:#777}
.hidden{display:none}
#tableSection{flex:1;display:flex;flex-direction:column;min-height:0;max-height:calc(100vh - 170px)}
.table-scroll{overflow:auto;flex:1}
table{width:100%;border-collapse:collapse}
th,td{padding:8px;border-bottom:1px solid #eee;text-align:right}
/* Default: numeric cells right-aligned. Override per-column so headers align with values */
th{text-align:left}

/* Age and Year (first two columns) align left for both header and cells */
#resultsTable th:nth-child(1),
#resultsTable td:nth-child(1),
#resultsTable th:nth-child(2),
#resultsTable td:nth-child(2) {
	text-align: left;
}

/* All columns from the 3rd onward (Balance, Return, SS, Contribs/Withdrawals, Net %) align right */
#resultsTable th:nth-child(n+3),
#resultsTable td:nth-child(n+3) {
	text-align: right;
}
footer{margin-top:14px;color:var(--muted)}
#summaryText{font-size:15px}
#summary{padding-top:0}
canvas{width:100%;height:220px}
@media (max-width:520px){.grid{grid-template-columns:1fr}}
@media (max-width:880px){
	.layout{grid-template-columns:1fr;}
	.sidebar{order:0}
	.results{order:1}
}

/* Toggle (slider) style for partial retirement enable/disable */
.toggle{display:flex;align-items:center;justify-content:space-between;gap:12px}
.toggle input{margin:0}
.toggle .switch{position:relative;display:inline-block;width:44px;height:24px}
.toggle .switch input{opacity:0;width:0;height:0}
.toggle .slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background:#ccc;border-radius:24px;transition:.2s}
.toggle .slider:before{position:absolute;content:'';height:18px;width:18px;left:3px;top:3px;background:white;border-radius:50%;transition:.2s}
.toggle input:checked + .slider{background:var(--accent)}
.toggle input:checked + .slider:before{transform:translateX(20px)}
.toggle .labelText{font-size:14px}