.nav button:nth-child(7) { border-left-color: var(--lime); }

.frac {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    font-family: "Fraunces", serif;
    font-weight: 700;
    line-height: 1.05;
    margin: 0 0.18em;
    color: var(--gold-2);
}

.frac > span:first-child {
    border-bottom: 2px solid currentColor;
    padding: 0 0.28em 2px;
}

.frac > span:last-child {
    padding: 2px 0.28em 0;
}

.frac.inline-white { color: var(--text); }

.fig-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: center;
    margin: 12px 0 4px;
}

.fig {
    display: block;
    max-width: 100%;
    height: auto;
}

.fig.pie { width: min(400px, 90vw); }
.fig.pie.units { width: min(820px, 96vw); }
.fig.bar { width: min(560px, 100%); }
.fig.nline { width: min(560px, 100%); }
.fig.qty { width: min(420px, 100%); }

.pie path {
    stroke: #0b1c28;
    stroke-width: 2.2;
}

.pie[data-pie] path {
    cursor: pointer;
    fill: rgba(255, 255, 255, 0.07);
    transition: fill 0.15s ease;
}

.pie[data-pie] path:hover { fill: rgba(94, 230, 195, 0.28); }
.pie[data-pie] path.is-on { fill: #5ee6c3; }

.pie-caption,
.lab-live {
    text-align: center;
    font-size: 1.15rem;
    margin: 8px 0 0;
}

.pair-fig {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

.amp-formula {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.amp-eq {
    font-family: "Fraunces", serif;
    font-size: 1.4rem;
}

.amp-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
}

.frac .times-k,
.frac .cf {
    font-size: 0.72em;
    vertical-align: middle;
}

.pair-fig p {
    text-align: center;
    margin: 6px 0 0;
    color: var(--muted);
}

@media (max-width: 700px) {
    .pair-fig { grid-template-columns: 1fr; }
}

.role-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 12px 0;
}

.role-chip {
    min-width: 140px;
    padding: 12px 14px;
    border-radius: 16px;
    text-align: center;
}

.role-chip strong {
    display: block;
    font-family: "Fraunces", serif;
    font-size: 1.4rem;
}

.role-chip.num { background: rgba(240, 200, 90, 0.16); border: 1px solid rgba(240, 200, 90, 0.4); }
.role-chip.den { background: rgba(126, 203, 255, 0.14); border: 1px solid rgba(126, 203, 255, 0.4); }

.nline-lab .tick-hit {
    cursor: pointer;
}

.qty-legend {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.9rem;
}

.qty-legend i {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
}

.q .fig-wrap { margin-bottom: 10px; }

.q label .frac,
.choices .frac {
    font-size: 0.95em;
}

.choices button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.den-picker {
    margin: 12px 0 4px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.18);
    text-align: center;
}

.den-picker > span {
    display: block;
    margin-bottom: 8px;
    color: var(--gold-2);
    font-weight: 700;
}

.den-picker small {
    display: block;
    font-weight: 500;
    color: var(--muted);
}

.den-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.den-row strong {
    min-width: 2rem;
    font-family: "Fraunces", serif;
    font-size: 1.8rem;
}

.den-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.den-chip {
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border-radius: 999px;
    min-width: 44px;
    min-height: 40px;
    padding: 6px 10px;
    cursor: pointer;
    font: inherit;
}

.den-chip.is-on {
    background: var(--gold);
    color: #1c1408;
    font-weight: 700;
    border-color: transparent;
}
