/* =============================================
   BODY FAT CALCULATOR — body_fat.css
   Tool-specific styles only.
   Common styles are in tool.css
   ============================================= */

.bf-calc { width: 100%; }

/* Reuse from bmi/calorie */
.bmi-radio-group { display: flex; gap: 24px; padding: 10px 0; }
.bmi-radio-label { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; color: var(--text); cursor: pointer; }
.bmi-radio-label input[type="radio"] { width: 18px; height: 18px; accent-color: var(--teal); cursor: pointer; }
.bmi-dual-input { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cal-hint { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 6px; }

/* Layout: inputs left, results right */
#bf-panel-us .mort-layout,
#bf-panel-metric .mort-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

/* Results box */
.bf-results {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.bf-result-header {
    background: #16a34a;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    padding: 10px 16px;
}

/* Main BF value */
.bf-value-row {
    padding: 12px 16px 4px;
}
.bf-main-value {
    font-size: 22px;
    font-weight: 700;
}

/* Color bar */
.bf-bar-wrap {
    padding: 8px 16px 14px;
}
.bf-bar-track {
    position: relative;
    display: flex;
    height: 20px;
    border-radius: 4px;
    overflow: visible;
    margin-bottom: 4px;
}
.bf-bar-seg {
    height: 100%;
    flex-shrink: 0;
}
.bf-bar-seg:first-child { border-radius: 4px 0 0 4px; }
.bf-bar-seg:last-child  { border-radius: 0 4px 4px 0; }

.bf-bar-pointer {
    position: absolute;
    top: -22px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.bf-bar-tip {
    background: #0d2137;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}
.bf-bar-arrow {
    font-size: 12px;
    color: #0d2137;
    line-height: 1;
    margin-top: 1px;
}

/* Bar labels */
.bf-label-nums {
    position: relative;
    height: 18px;
    margin-top: 2px;
}
.bf-label-nums span {
    position: absolute;
    transform: translateX(-50%);
    font-size: 11px;
    color: var(--muted);
}
.bf-label-cats {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
}
.bf-label-cats span {
    font-size: 11px;
    color: var(--muted);
    text-align: center;
    flex: 1;
}

/* Result table */
.bf-result-table {
    margin: 0 16px 0;
    width: calc(100% - 32px);
}

/* Print row */
.bf-print-row {
    display: flex;
    justify-content: flex-end;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: var(--light);
}

/* Unit converter */
.unit-subtabs { display: flex; flex-wrap: wrap; gap: 0; margin-bottom: 20px; border-bottom: 2px solid var(--border); }
.unit-subtab { padding: 8px 18px; background: none; border: none; border-bottom: 3px solid transparent; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; font-family: var(--font-main); transition: all 0.2s; margin-bottom: -2px; white-space: nowrap; }
.unit-subtab:hover { color: var(--navy); background: var(--light); }
.unit-subtab.active { color: var(--teal); border-bottom-color: var(--teal); }
.unit-converter-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.unit-col { display: flex; flex-direction: column; gap: 8px; }
.unit-col-label { font-size: 14px; font-weight: 700; color: var(--navy); }
.unit-from-input, .unit-to-input { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; font-family: var(--font-main); color: var(--text); background: var(--white); outline: none; box-sizing: border-box; transition: border-color 0.2s; }
.unit-from-input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0,201,167,0.1); }
.unit-to-input { background: var(--light); color: var(--muted); cursor: default; }
.unit-list { width: 100%; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: var(--font-main); color: var(--text); background: var(--white); outline: none; padding: 4px; min-height: 160px; cursor: pointer; }
.unit-list option { padding: 7px 10px; border-radius: 4px; font-size: 13px; }
.unit-list option:checked { background: var(--teal); color: var(--navy); }

@media (max-width: 768px) {
    #bf-panel-us .mort-layout,
    #bf-panel-metric .mort-layout,
    .unit-converter-wrap { grid-template-columns: 1fr; }
}
