/* CSS Document */

/* ================ Home Loan Calculator — page-specific styles ======================= */

/* ---------- Field / slider overrides ---------- */
.field { display: flex; flex-direction: column; gap: 14px;}

/*.field-head { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 18px;}*/

/* ---------- Donut ---------- */
.donut-wrap {  display: flex; align-items: center; gap: 32px; margin-bottom: 32px; flex-wrap: wrap;}
.donut-svg { flex: 0 0 160px; width: 160px; height: 160px;}
.donut-legend { display: flex;  flex-direction: column; gap: 14px; flex: 1;}
.donut-item { display: flex; align-items: center;  gap: 12px;}
.donut-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;}

.donut-label { font-size: 12px; color: var(--ink-3); letter-spacing: .04em; text-transform: uppercase; font-family: 'Montserrat', sans-serif; font-weight: 600;}
.donut-val { font-size: 20px; font-weight: 300; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums;}

/* ---------- Chart ---------- */
.swatch.princ { background: var(--sapphire);}
.swatch.inter { background: var(--crimson);}

/* ---------- Amortization table ---------- */
.amort-wrap { margin-top: 48px;}
.amort-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px;}
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch;}
.amort-table { width: 100%;  border-collapse: collapse; font-size: 13px; min-width: 380px;}

.amort-table th {
    text-align: right; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); font-family: 'Montserrat', sans-serif; font-weight: 600; padding: 0 0 10px; border-bottom: 1px solid var(--rule);
}

.amort-table th:first-child { text-align: left;}
.amort-table td { text-align: right; padding: 9px 0; border-bottom: 1px solid var(--rule); font-variant-numeric: tabular-nums; color: var(--ink-2);}
.amort-table td:first-child { text-align: left; color: var(--ink); font-weight: 500;}

.amort-table tr:last-child td { border-bottom: none; color: var(--ink); font-weight: 600;}

.amort-table .princ-cell { color: var(--sapphire);}

.amort-table .inter-cell {  color: var(--crimson);}

/* ---------- Chart hover / tooltip ---------- */
.tip-line {
    stroke: rgba(26, 26, 26, .18); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; transition: opacity .12s;
}

.tip-line.on { opacity: 1;}

.tip-label { 
	font-family: 'Plus Jakarta Sans', 'Neue Montreal', sans-serif; fill: var(--ink); 
	font-variant-numeric: tabular-nums; opacity: 0; transition: opacity .12s;
}

.tip-label.on { opacity: 1;}

.tip-dot {
    stroke: #fff; stroke-width: 2;  opacity: 0; transition: opacity .12s;
}

.tip-dot.on { opacity: 1;}

.draw { stroke-dasharray: 3000; stroke-dashoffset: 3000; animation: dash 1.6s .5s cubic-bezier(.2, .8, .2, 1) forwards;}

@keyframes dash {
    to { stroke-dashoffset: 0; }
}

.fade-in { opacity: 0; animation: fadeI 1s .8s forwards;}

@keyframes fadeI {
    to { opacity: 1; }
}

/* ---------- Result grid ---------- */
.result-grid { display: grid; grid-template-columns: 1fr 1fr;  gap: 48px 64px; align-items: end;}





/* ---------- Segmented toggle (Standard / Step-up) ---------- */
.seg {
    display: inline-flex;
    gap: 24px;
    border-bottom: 1px solid var(--rule);
}

.seg button {
    position: relative;
    padding: 10px 2px 12px;
    font-size: 13px;
    color: var(--ink-3);
    letter-spacing: .04em;
    transition: color .2s;
    background: none;
    border: 0;
    cursor: pointer;
    font-family: inherit;
}

.seg button[aria-pressed="true"] {
    color: var(--ink);
}

.seg button[aria-pressed="true"]::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: var(--grad);
}

.seg button:hover {
    color: var(--ink);
}

/* ---------- Refine result section ---------- */
#refine-result {
    display: none;
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--rule);
    gap: 40px;
    flex-wrap: wrap;
}

#refine-result .cell {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ---------- Toggle prepay button ---------- */
#toggle-prepay {
    border: 1px solid var(--rule-2);
    border-radius: 999px;
    padding: 6px 16px;
    font-size: 13px;
    color: var(--ink-2);
    background: none;
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
}

#toggle-prepay:hover {
    border-color: var(--crimson);
    color: var(--crimson);
}

#toggle-prepay[aria-pressed="true"] {
    background: var(--crimson);
    color: #fff;
    border-color: var(--crimson);
}

/* ---------- Responsive fixes ---------- */
@media (max-width: 480px) {
    .seg {
        gap: 16px;
    }
    .seg button {
        font-size: 12px;
        padding: 8px 0 10px;
    }
    #refine-result {
        gap: 20px;
    }
}

@media (max-width: 375px) {
    #refine-result {
        flex-direction: column;
        gap: 12px;
    }
}








/* ---------- Responsive ---------- */
@media (max-width: 1700px) {

}

@media (max-width: 1600px) {
 
}

@media (max-width: 1280px) {
 
}

@media (max-width: 1100px) {
 
}

@media (max-width: 900px) {
   
    .result-grid {  grid-template-columns: 1fr 1fr; gap: 32px 24px; }
   
    .amort-table { font-size: 12px; min-width: 300px; }
    .amort-table th,
    .amort-table td { padding: 6px 0; }
}

@media(max-width:480px){
	.amort-table td {text-align: center;}

	svg.chart{height: 230px;}
	.lede { max-width: 90%; }
	.amort-table th{ width: 7ch;  text-align: center; vertical-align: baseline;}

	
}

@media(max-width:375px){
	.donut-svg { flex: 0 0 130px; width: 120px;  height: 120px;}
	.donut-val {font-size: 1rem;}
}

@media(max-width:320px){
	.amort-table th { text-align: center; font-size: 0.5rem; letter-spacing: 0.08em;}
	.amort-table td {font-size: 0.6rem;}
	.sentence { max-width: 90%; }
	.donut-svg {flex: 0 0 100px;}
	.result-grid { max-width: 93%;grid-template-columns: 1fr; }
}