/* Top control toolbar for the health tools (same look as the TDEE / BAC toolbar):
   unit switch on the left, formula badge + related tool chips on the right.
   The unit switch keeps each tool's own buttons and ids; health-unit-tabs.js marks the active one with data-ht-active. */
[data-ht-units][data-ht-units][data-ht-units] {
    display: inline-flex !important; align-items: stretch; gap: 0 !important; width: auto !important; margin: 0 !important;
    padding: .25rem !important; border-radius: 1rem !important;
    background: rgba(228, 228, 231, .8) !important; border: 1px solid rgba(212, 212, 216, .8) !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .06) !important;
}
.dark [data-ht-units][data-ht-units][data-ht-units] { background: #18181b !important; border-color: rgba(255, 255, 255, .1) !important; }
[data-ht-units][data-ht-units][data-ht-units] > button {
    display: inline-flex !important; align-items: center; justify-content: center; gap: .375rem;
    flex: 0 0 auto !important; padding: .375rem 1rem !important; border-radius: .75rem !important;
    font-size: .75rem !important; font-weight: 500 !important; letter-spacing: .025em; line-height: 1.25rem; white-space: nowrap;
    background: transparent !important; color: #52525b !important; border: 1px solid transparent !important; box-shadow: none !important;
    cursor: pointer; transition: background-color .15s, color .15s;
}
.dark [data-ht-units][data-ht-units][data-ht-units] > button { color: #a1a1aa !important; }
[data-ht-units][data-ht-units][data-ht-units] > button:hover { background: rgba(228, 228, 231, .5) !important; color: #18181b !important; }
.dark [data-ht-units][data-ht-units][data-ht-units] > button:hover { background: rgba(39, 39, 42, .6) !important; color: #fff !important; }
[data-ht-units][data-ht-units][data-ht-units] > button[data-ht-active="true"][data-ht-active="true"],
[data-ht-units][data-ht-units][data-ht-units] > button[data-ht-active="true"][data-ht-active="true"]:hover {
    background: #e11d48 !important; color: #fff !important; font-weight: 700 !important; box-shadow: 0 1px 2px rgba(0, 0, 0, .12) !important;
}
/* Some tools hard-code a colour on the button's icon (e.g. text-rose-600), which disappears on the red active pill.
   The icon always follows the button's text colour instead. */
[data-ht-units][data-ht-units][data-ht-units] > button > i { color: inherit !important; }
[data-ht-units][data-ht-units][data-ht-units] > button:not([data-ht-active="true"]) > i { opacity: .7; }
/* Selected pill of the segmented pickers (Male / Female / Neutral ...): app.css turns every .text-white on tool pages
   near-black in light mode, which made the label and icon dark on the red pill. Keep them white. */
html .is-tool-page .ht-seg.ht-seg > button.bg-rose-600.text-white,
html .is-tool-page .ht-seg.ht-seg > button.bg-rose-600.text-white > i { color: #fff !important; }
@media (max-width: 639px) {
    [data-ht-units][data-ht-units][data-ht-units] { display: grid !important; grid-template-columns: 1fr 1fr; width: 100% !important; }
    [data-ht-units][data-ht-units][data-ht-units] > button { padding: .375rem .5rem !important; white-space: normal; }
}

/* Compact on phones (same density as the SIP tool): slimmer unit switch, smaller chips, smaller segmented pickers.
   Needed because app.css forces min-height:44px on #tab-metric / #tab-imperial / .gender-btn for touch screens. */
@media (max-width: 639px), (pointer: coarse) and (max-width: 900px) {
    [data-ht-units][data-ht-units][data-ht-units] { padding: .1875rem !important; border-radius: .875rem !important; }
    [data-ht-units][data-ht-units][data-ht-units] > button {
        min-height: 0 !important; height: auto !important; padding: .3125rem .5rem !important;
        font-size: .6875rem !important; line-height: 1.1rem; gap: .3rem; border-radius: .6875rem !important;
    }
    [data-ht-units][data-ht-units][data-ht-units] > button > i { font-size: 10px !important; }
    .ht-links { gap: .375rem !important; flex-wrap: nowrap !important; }
    .ht-links.ht-links > * { padding: .25rem .5rem !important; font-size: 10px !important; line-height: 1.1rem; border-radius: .5rem !important; gap: .3rem !important; white-space: nowrap !important; }
    .ht-links .fa-arrow-right { display: none; }
    .ht-seg.ht-seg { gap: .375rem !important; }
    .ht-seg.ht-seg > button {
        min-height: 0 !important; height: auto !important; padding: .3125rem .5rem !important;
        font-size: .6875rem !important; line-height: 1.1rem; border-radius: .6875rem !important; gap: .3rem !important;
    }
    .ht-seg.ht-seg > button > i { font-size: 10px !important; }
}
