/* Redesign: tools pages (compare + calculators). Shared pieces live in components.css. */
.tl-page { padding-inline: var(--ff-pad-x); }
.tl-tools-nav { margin-top: 40px; }

/* ---- Compare: share bar ------------------------------------------------ */
.tl-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 20px; }
.tl-share-input { max-width: 300px; padding: 7px 10px; font-size: 14px; }
.tl-btn-sm { padding: 7px 14px; font-size: 14px; }

/* ---- Compare: table ---------------------------------------------------- */
.tl-scroll-hint { font-size: 14px; color: var(--ff-muted); margin: 0 0 10px; }
@media (min-width: 1000px) { .tl-scroll-hint { display: none; } }
.tl-cmp-wrap { background: var(--ff-card); border: 1px solid var(--ff-border); border-radius: var(--ff-radius); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tl-cmp { width: 100%; min-width: 620px; border-collapse: collapse; table-layout: fixed; }
.tl-cmp th, .tl-cmp td { padding: 16px 20px; border-bottom: 1px solid var(--ff-divider); vertical-align: middle; text-align: start; }
.tl-cmp tr > * + * { border-inline-start: 1px solid var(--ff-divider); }
.tl-cmp tbody tr:last-child > * { border-bottom: 0; }
.tl-cmp-label { width: 180px; background: var(--ff-surface); font-size: 15.5px; font-weight: 600; color: var(--ff-ink); }
.tl-cmp thead th, .tl-cmp thead td { border-bottom-color: var(--ff-border); padding-block: 22px; vertical-align: bottom; }
.tl-cmp-img { display: block; width: 64px; height: 64px; object-fit: contain; margin-bottom: 10px; }
.tl-cmp-brand { display: block; font-size: 12.5px; font-weight: 400; color: var(--ff-muted); }
.tl-cmp-name { display: block; font-family: var(--ff-font-head); font-size: 18px; font-weight: 700; line-height: 1.3; color: var(--ff-ink); text-decoration: none; }
.tl-cmp-name:hover { color: var(--ff-primary); }
.tl-cmp-val { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 7px; margin-bottom: 7px; }
.tl-cmp-val .ff-num { font-size: 23px; }
.tl-cmp-val .ff-num small { font-family: var(--ff-font-body); font-weight: 400; font-size: 13px; color: var(--ff-muted); }
.tl-cmp-tag { font-size: 12px; font-weight: 700; padding: 2px 8px; }
.tl-bar { height: 5px; background: var(--ff-divider); border-radius: 99px; overflow: hidden; }
.tl-bar span { display: block; height: 100%; background: var(--ff-primary); border-radius: 99px; }
.tl-cmp-text { font-size: 14.5px; color: var(--ff-muted); line-height: 1.55; }
.tl-cmp-may { display: block; margin-top: 4px; font-size: 13px; }
.tl-cmp-price td { font-family: var(--ff-font-head); font-size: 20px; }
.tl-cmp-price .text-success { color: var(--ff-ink) !important; font-weight: 700 !important; }
@media (max-width: 999.98px) {
    .tl-cmp-label { width: 110px; font-size: 14.5px; }
    .tl-cmp th, .tl-cmp td { padding: 14px 14px; }
}
.tl-cmp-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px; }
.tl-add-slot {
    background: var(--ff-card); border: 1.5px dashed #B6C2CA; border-radius: var(--ff-radius-lg);
    padding: 14px 24px; font-size: 16px; font-weight: 600; color: var(--ff-muted); text-decoration: none;
}
.tl-add-slot:hover { border-color: var(--ff-primary); color: var(--ff-primary); }

/* ---- Compare: picker --------------------------------------------------- */
.tl-slots { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); margin-bottom: 20px; }
.tl-ac { position: relative; }
.tl-ac .autocomplete-dropdown { position: absolute; top: 100%; inset-inline: 0; z-index: 1050; max-height: 260px; overflow-y: auto; box-shadow: 0 8px 24px rgba(16, 30, 43, .12); }
.tl-selected { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--ff-tint); border: 1px solid var(--ff-tint-border); color: var(--ff-tint-text); border-radius: var(--ff-radius); padding: 10px 12px; font-weight: 600; }
.tl-selected .btn-close { font-size: .7rem; flex: none; }
.tl-submit:disabled { opacity: .5; cursor: not-allowed; }

/* ---- Compare: empty state ---------------------------------------------- */
.tl-popular { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin-top: 14px; }
.tl-popular-card {
    display: flex; align-items: center; gap: 10px; background: var(--ff-card); border: 1px solid var(--ff-border);
    border-radius: var(--ff-radius); padding: 16px; color: var(--ff-ink); font-weight: 600; text-decoration: none;
}
.tl-popular-card:hover { border-color: var(--ff-border-hover); color: var(--ff-ink); }
.tl-popular-card i { color: var(--ff-primary); }

/* ---- Calculators: layout ----------------------------------------------- */
.tl-calc { display: grid; gap: clamp(16px, 4vw, 28px); align-items: start; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.tl-form { display: grid; gap: 24px; }
.tl-form .ff-card-title { margin: 0; }
.tl-group { border: 0; padding: 0; margin: 0; min-width: 0; }
.tl-group legend { float: none; width: auto; margin-bottom: 10px; }
.tl-inputs { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tl-inputs-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.tl-inputs .ff-label { white-space: nowrap; }
.ff-input[aria-invalid="true"] { border-color: var(--ff-border-hover); outline: 2px dashed var(--ff-border-hover); }

/* Radio cards (sex toggle, activity levels, goals) */
.tl-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tl-opts { display: grid; gap: 8px; }
.tl-opt {
    position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    border: 1.5px solid var(--ff-border-input); background: var(--ff-card); border-radius: var(--ff-radius);
    padding: 12px 14px; font-size: 15.5px; color: var(--ff-ink); cursor: pointer;
}
.tl-toggle .tl-opt { justify-content: center; font-size: 16px; font-weight: 600; color: var(--ff-ink-2); }
.tl-opt:hover { border-color: var(--ff-primary); }
.tl-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tl-opt span { display: flex; align-items: center; gap: 10px; }
.tl-opt small { font-size: 13px; color: var(--ff-muted); flex: none; }
.tl-opt:has(input:checked) { border-color: var(--ff-primary); background: var(--ff-tint); }
.tl-opt input:checked + span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ff-primary); flex: none; }
.tl-opt:has(input:focus-visible) { outline: 2px solid var(--ff-primary); outline-offset: 2px; }

/* Dark result card */
.tl-result { padding: clamp(22px, 5vw, 32px); }
@media (min-width: 1000px) { .tl-result { position: sticky; top: 88px; } }
.tl-result-eyebrow { font-family: var(--ff-font-body); font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; color: var(--ff-amber); margin: 0 0 18px; }
.tl-result-big { font-family: var(--ff-font-head); font-size: clamp(48px, 12vw, 66px); font-weight: 900; line-height: 1; color: #fff; }
.tl-result-sub { font-size: 16.5px; color: var(--ff-muted-on-dark); margin: 6px 0 0; }
.tl-result-rows { display: grid; gap: 12px; border-top: 1px solid #263949; padding-top: 22px; margin: 26px 0 0; }
.tl-result-rows > div { display: flex; justify-content: space-between; gap: 12px; font-size: 16px; }
.tl-result-rows dt { font-weight: 400; color: var(--ff-muted-on-dark); display: flex; align-items: center; gap: 8px; }
.tl-result-rows dd { font-weight: 700; margin: 0; }
.tl-result-rows-sm { border-top: 0; padding-top: 0; margin-top: 12px; gap: 7px; }
.tl-result-rows-sm > div { font-size: 14.5px; }
.tl-result-note, .tl-result-notes p { font-size: 14px; color: var(--ff-muted-on-dark); margin: 12px 0 0; line-height: 1.6; }
.tl-result-notes { border-top: 1px solid #263949; margin-top: 22px; padding-top: 10px; }
.tl-macros { border-top: 1px solid #263949; margin-top: 22px; padding-top: 22px; }
.tl-macros .tl-result-sub { font-size: 14.5px; margin: 0 0 12px; }
.tl-macro-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; }
.tl-macro-bar .is-p { width: 30%; } .tl-macro-bar .is-c { width: 40%; } .tl-macro-bar .is-f { width: 30%; }
.tl-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.is-p.tl-dot, .tl-macro-bar .is-p { background: var(--ff-amber); }
.is-c.tl-dot, .tl-macro-bar .is-c { background: #4E8FA8; }
.is-f.tl-dot, .tl-macro-bar .is-f { background: var(--ff-primary-on-dark); }
.tl-result-cta { width: 100%; margin-top: 26px; }
.tl-result-cta:hover { background: var(--ff-primary-on-dark); }
.tl-result-link { display: block; margin-top: 14px; text-align: center; font-size: 14.5px; color: var(--ff-muted-on-dark); }
.tl-result-link:hover { color: #fff; }
