/* ==========================================================================
   Free tools — extends the hm- design system (public/css/app.css).
   Components are prefixed `tl-`. Loaded only on /tools pages.
   ========================================================================== */

:root {
    --tl-tone: var(--hm-brand);
    --tl-tone-soft: var(--hm-brand-soft);
    --tl-ok: #059669;
    --tl-warn: #D97706;
    --tl-bad: #DC2626;
    --tl-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
}
.tone-indigo  { --tl-tone: #4F46E5; --tl-tone-soft: #EEF0FF; }
.tone-sky     { --tl-tone: #0284C7; --tl-tone-soft: #E0F2FE; }
.tone-emerald { --tl-tone: #059669; --tl-tone-soft: #DCFCE7; }
.tone-violet  { --tl-tone: #7C3AED; --tl-tone-soft: #EDE9FE; }
.tone-amber   { --tl-tone: #D97706; --tl-tone-soft: #FEF3C7; }
.tone-rose    { --tl-tone: #E11D48; --tl-tone-soft: #FFE4E6; }
.tone-slate   { --tl-tone: #334155; --tl-tone-soft: #E2E8F0; }

.tl-num-font { font-variant-numeric: tabular-nums; }

/* ---------- Hero (compact, tool-first) ---------- */
.tl-hero {
    position: relative;
    padding: 124px 0 28px;
    overflow: hidden;
    isolation: isolate;
}
.tl-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0 0 18px;
    font-size: .85rem;
    color: var(--hm-muted);
}
.tl-crumbs a { color: var(--hm-muted); }
.tl-crumbs a:hover { color: var(--hm-brand); }
.tl-crumbs li + li::before { content: '/'; margin-right: 6px; color: #C3C8D4; }
.tl-crumbs [aria-current] { color: var(--hm-ink); font-weight: 500; }

.tl-hero-row { display: flex; gap: 20px; align-items: flex-start; }
.tl-hero-icon {
    flex-shrink: 0;
    width: 60px; height: 60px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: var(--tl-tone);
    color: #fff;
    font-size: 1.6rem;
    box-shadow: 0 12px 28px -12px var(--tl-tone);
}
.tl-hero h1 {
    font-size: clamp(1.7rem, 3.6vw, 2.5rem);
    font-weight: 800;
    margin: 0;
    text-wrap: balance;
}
.tl-hero-sub {
    max-width: 720px;
    margin: 10px 0 0;
    font-size: clamp(.98rem, 1.4vw, 1.08rem);
    color: var(--hm-muted);
    text-wrap: pretty;
}
.tl-trust { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tl-trust span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px 4px 8px;
    font-size: .8rem;
    font-weight: 500;
    color: var(--hm-ink);
    background: rgba(255, 255, 255, .85);
    border: 1px solid var(--hm-line);
    border-radius: 999px;
}
.tl-trust .bi { color: var(--tl-ok); }

/* ---------- App shell ---------- */
.tl-work { padding: 8px 0 72px; }
.tl-app {
    background: #fff;
    border: 1px solid var(--hm-line);
    border-radius: var(--hm-r-lg);
    box-shadow: var(--hm-shadow-lg);
    overflow: hidden;
}
.tl-grid {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
}
.tl-grid.is-even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.tl-pane { padding: 28px; min-width: 0; }
.tl-pane + .tl-pane { border-left: 1px solid var(--hm-line); }
.tl-pane-out { background: linear-gradient(180deg, #FAFBFF 0%, #F6F7FB 100%); }
.tl-sticky { position: sticky; top: 96px; }
.tl-pane-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--hm-muted);
    margin: 0 0 16px;
}
html[lang="bn"] .tl-pane-title { letter-spacing: 0; font-size: .88rem; }

/* Toolbar under the app (print/share/reset) */
.tl-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid var(--hm-line);
    background: #fff;
}
.tl-toolbar-group { display: flex; flex-wrap: wrap; gap: 8px; }
.tl-privacy { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--hm-muted); }
.tl-privacy .bi { color: var(--tl-ok); }

/* ---------- Tabs / segmented controls ---------- */
.tl-tabs {
    display: flex;
    gap: 4px;
    padding: 6px;
    margin: 0;
    list-style: none;
    background: var(--hm-soft);
    border-bottom: 1px solid var(--hm-line);
    overflow-x: auto;
    scrollbar-width: none;
}
.tl-tabs::-webkit-scrollbar { display: none; }
.tl-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    font-weight: 600;
    font-size: .9rem;
    color: var(--hm-muted);
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .2s, color .2s, box-shadow .2s;
}
.tl-tab:hover { color: var(--hm-ink); }
.tl-tab[aria-selected="true"] { background: #fff; color: var(--hm-ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 0 0 1px var(--hm-line); }
.tl-tab[aria-selected="true"] .bi { color: var(--tl-tone); }
[role="tabpanel"][hidden] { display: none !important; }

.tl-seg {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    background: var(--hm-soft);
    border: 1px solid var(--hm-line);
    border-radius: 12px;
}
.tl-seg.is-block { display: flex; flex-wrap: nowrap; }
.tl-seg.is-block > * { flex: 1 1 0; min-width: 0; white-space: normal; line-height: 1.25; }
.tl-seg button {
    padding: 8px 14px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    font-size: .88rem;
    font-weight: 600;
    color: var(--hm-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .15s, color .15s, box-shadow .15s;
}
.tl-seg button:hover { color: var(--hm-ink); }
.tl-seg button[aria-pressed="true"] { background: #fff; color: var(--hm-ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .1), 0 0 0 1px var(--hm-line); }

.tl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tl-chip {
    min-width: 54px;
    padding: 7px 12px;
    border: 1px solid #D9DCE5;
    border-radius: 10px;
    background: #fff;
    font-size: .88rem;
    font-weight: 600;
    color: var(--hm-ink);
    cursor: pointer;
    transition: border-color .15s, background-color .15s, color .15s;
}
.tl-chip:hover { border-color: var(--tl-tone); }
.tl-chip[aria-pressed="true"] { background: var(--tl-tone); border-color: var(--tl-tone); color: #fff; }
.tl-chip small { display: block; font-weight: 500; font-size: .7rem; opacity: .75; }

/* ---------- Fields ---------- */
.tl-fields { display: grid; gap: 18px; }
.tl-row { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tl-row.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tl-field { min-width: 0; }
.tl-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    font-size: .86rem;
    font-weight: 500;
    color: var(--hm-ink);
}
.tl-label small { font-weight: 400; color: var(--hm-muted); font-size: .78rem; }
.tl-hint { margin: 6px 0 0; font-size: .78rem; color: var(--hm-muted); line-height: 1.5; }

.tl-input, .tl-select, .tl-textarea {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    font: inherit;
    font-size: .95rem;
    color: var(--hm-ink);
    background: #fff;
    border: 1px solid #D9DCE5;
    border-radius: 12px;
    outline: 0;
    transition: border-color .2s, box-shadow .2s;
    -webkit-appearance: none;
            appearance: none;
}
.tl-select {
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236B7385' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px;
}
.tl-textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.tl-input::placeholder, .tl-textarea::placeholder { color: #A3A9B7; }
.tl-input:focus, .tl-select:focus, .tl-textarea:focus { border-color: var(--tl-tone); box-shadow: 0 0 0 4px color-mix(in srgb, var(--tl-tone) 14%, transparent); }
.tl-input.is-big { min-height: 60px; font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; }
.tl-input.is-invalid { border-color: var(--tl-bad); }

.tl-ig { position: relative; }
.tl-ig .tl-input { font-variant-numeric: tabular-nums; }
.tl-ig-pre, .tl-ig-suf {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    color: var(--hm-muted);
    pointer-events: none;
}
.tl-ig-pre { left: 14px; }
.tl-ig-suf { right: 14px; font-size: .88rem; }
.tl-ig.has-pre .tl-input { padding-left: 34px; }
.tl-ig.has-suf .tl-input { padding-right: 52px; }
.tl-ig .is-big ~ .tl-ig-pre, .tl-ig.has-pre .is-big { padding-left: 42px; }
.tl-ig .tl-ig-pre.is-big-pre { font-size: 1.4rem; }

.tl-check { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--hm-ink); cursor: pointer; user-select: none; }
.tl-check input { width: 18px; height: 18px; accent-color: var(--tl-tone); cursor: pointer; }

.tl-divider { height: 1px; background: var(--hm-line); margin: 4px 0; border: 0; }
.tl-details > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .88rem;
    font-weight: 600;
    color: var(--tl-tone);
    cursor: pointer;
    list-style: none;
}
.tl-details > summary::-webkit-details-marker { display: none; }
.tl-details > summary .bi { transition: transform .2s; }
.tl-details[open] > summary .bi { transform: rotate(90deg); }
.tl-details > div { margin-top: 14px; }

/* ---------- Results ---------- */
.tl-out {
    position: relative;
    overflow: hidden;
    padding: 22px 24px;
    border-radius: 20px;
    background: radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--tl-tone) 55%, #0B1020) 0%, #0B1020 60%);
    color: #fff;
    box-shadow: 0 18px 40px -20px rgba(11, 16, 32, .6);
}
.tl-out-label { font-size: .82rem; color: rgba(255, 255, 255, .7); margin: 0 0 4px; }
.tl-out-value {
    font-size: clamp(1.9rem, 4vw, 2.6rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
.tl-out-sub { margin: 8px 0 0; font-size: .85rem; color: rgba(255, 255, 255, .75); line-height: 1.5; }
.tl-out-copy {
    position: absolute;
    top: 14px; right: 14px;
    width: 34px; height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 10px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    cursor: pointer;
}
.tl-out-copy:hover { background: rgba(255, 255, 255, .16); }

.tl-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.tl-kpis.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tl-kpi {
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--hm-line);
    border-radius: 14px;
    min-width: 0;
}
.tl-kpi small { display: block; font-size: .76rem; color: var(--hm-muted); margin-bottom: 2px; }
.tl-kpi strong { display: block; font-size: 1.15rem; font-weight: 700; color: var(--hm-ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tl-kpi.is-good strong { color: var(--tl-ok); }
.tl-kpi.is-bad strong { color: var(--tl-bad); }

.tl-rows { list-style: none; margin: 14px 0 0; padding: 4px 16px; background: #fff; border: 1px solid var(--hm-line); border-radius: 14px; }
.tl-rows li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 10px 0;
    font-size: .92rem;
    border-bottom: 1px dashed var(--hm-line);
}
.tl-rows li:last-child { border-bottom: 0; }
.tl-rows span { color: var(--hm-body); }
.tl-rows b { color: var(--hm-ink); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.tl-rows li.is-total { font-size: 1rem; }
.tl-rows li.is-total b { font-weight: 800; }
.tl-rows li.is-minus b { color: var(--tl-bad); }
.tl-rows li.is-plus b { color: var(--tl-ok); }

.tl-words {
    margin-top: 14px;
    padding: 14px 16px;
    background: var(--tl-tone-soft);
    border-radius: 14px;
    font-size: .9rem;
    color: var(--hm-ink);
    line-height: 1.55;
}
.tl-words small { display: block; font-size: .74rem; color: var(--hm-muted); margin-bottom: 2px; }

.tl-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: .86rem;
    line-height: 1.55;
    background: #FFFBEB;
    color: #92400E;
    border: 1px solid #FDE68A;
}
.tl-alert.is-info { background: var(--hm-brand-soft); color: #3730A3; border-color: #D5D8FF; }
.tl-alert.is-good { background: #ECFDF5; color: #065F46; border-color: #A7F3D0; }
.tl-alert.is-bad { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }
.tl-alert .bi { margin-top: 1px; }

.tl-bar { height: 10px; border-radius: 999px; background: var(--hm-line); overflow: hidden; display: flex; }
.tl-bar > span { display: block; height: 100%; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; font-size: .78rem; color: var(--hm-muted); }
.tl-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- Tables ---------- */
.tl-table-wrap { overflow-x: auto; border: 1px solid var(--hm-line); border-radius: 14px; background: #fff; }
.tl-table { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
.tl-table th, .tl-table td { padding: 10px 12px; border-bottom: 1px solid var(--hm-line); text-align: left; white-space: nowrap; }
.tl-table th { font-size: .74rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--hm-muted); background: var(--hm-soft); position: sticky; top: 0; }
html[lang="bn"] .tl-table th { letter-spacing: 0; font-size: .82rem; text-transform: none; }
.tl-table td.r, .tl-table th.r { text-align: right; }
.tl-table tr:last-child td { border-bottom: 0; }
.tl-table tbody tr:hover td { background: #FAFBFF; }
.tl-table tr.is-best td { background: #ECFDF5; }
.tl-table tfoot td { font-weight: 700; background: var(--hm-soft); color: var(--hm-ink); }
.tl-table .tl-input, .tl-table .tl-select { min-height: 38px; padding: 6px 10px; font-size: .88rem; border-radius: 9px; }
.tl-table td.is-input { padding: 6px; }
.tl-scroll { max-height: 420px; overflow: auto; }

.tl-icon-btn {
    width: 34px; height: 34px;
    display: inline-grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--hm-muted);
    cursor: pointer;
}
.tl-icon-btn:hover { color: var(--tl-bad); background: #FEF2F2; }

.tl-btn-sm { min-height: 38px; padding: 8px 14px; font-size: .86rem; border-radius: 10px; }
.tl-btn-tone { background: var(--tl-tone); color: #fff; }
.tl-btn-tone:hover { color: #fff; filter: brightness(1.08); transform: translateY(-1px); }
.tl-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    border: 1.5px dashed #CDD1DC;
    border-radius: 12px;
    background: transparent;
    font-weight: 600;
    font-size: .9rem;
    color: var(--hm-muted);
    cursor: pointer;
}
.tl-add:hover { border-color: var(--tl-tone); color: var(--tl-tone); background: var(--tl-tone-soft); }

/* ---------- Charts (inline SVG) ---------- */
.tl-chart { width: 100%; height: auto; display: block; }
.tl-chart text { font-size: 11px; fill: var(--hm-muted); font-family: var(--hm-font); }
.tl-chart .grid { stroke: var(--hm-line); stroke-width: 1; }

/* ---------- Below-the-tool content ---------- */
.tl-after { padding: 0 0 24px; }
.tl-content-grid { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 48px; align-items: start; }
.tl-guide.hm-prose { font-size: 1rem; }
.tl-guide.hm-prose h2 { font-size: 1.45rem; margin-top: 0; }
.tl-guide.hm-prose h2 + p { margin-top: 0; }
.tl-guide.hm-prose h2:not(:first-child) { margin-top: 1.8em; }
.tl-guide.hm-prose code { font-family: var(--tl-mono); font-size: .88em; background: var(--hm-soft); padding: 2px 6px; border-radius: 6px; }
.tl-side { position: sticky; top: 100px; display: grid; gap: 16px; }

.tl-lead {
    position: relative;
    overflow: hidden;
    padding: 24px;
    border-radius: var(--hm-r-lg);
    background: radial-gradient(140% 100% at 100% 0%, #312E81 0%, #0B1020 65%);
    color: #fff;
}
.tl-lead::after {
    content: '';
    position: absolute;
    width: 220px; height: 220px;
    right: -80px; top: -80px;
    background: radial-gradient(circle, rgba(14, 165, 233, .45), transparent 70%);
    pointer-events: none;
}
.tl-lead-eyebrow { font-size: .78rem; font-weight: 600; color: #A5B4FC; margin: 0 0 6px; }
.tl-lead h3 { color: #fff; font-size: 1.2rem; margin: 0 0 8px; }
.tl-lead p { font-size: .88rem; color: rgba(255, 255, 255, .75); margin: 0 0 16px; line-height: 1.6; }
.tl-lead form { position: relative; z-index: 1; display: grid; gap: 10px; }
.tl-lead .tl-input { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .18); color: #fff; min-height: 44px; }
.tl-lead .tl-input::placeholder { color: rgba(255, 255, 255, .5); }
.tl-lead .tl-input:focus { border-color: #A5B4FC; box-shadow: 0 0 0 4px rgba(165, 180, 252, .2); }
.tl-lead-note { font-size: .75rem !important; margin: 4px 0 0 !important; color: rgba(255, 255, 255, .55) !important; }
.tl-lead-done { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.tl-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

.tl-faq-section { padding: 56px 0; }
.tl-related { padding: 8px 0 72px; }

/* ---------- Tool cards (hub + related) ---------- */
.tl-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tl-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 22px;
    background: #fff;
    border: 1px solid var(--hm-line);
    border-radius: var(--hm-r-lg);
    color: var(--hm-body);
    transition: transform .25s var(--hm-ease), box-shadow .25s var(--hm-ease), border-color .25s;
}
.tl-card:hover {
    color: var(--hm-body);
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--tl-tone) 35%, var(--hm-line));
    box-shadow: 0 20px 40px -20px color-mix(in srgb, var(--tl-tone) 45%, transparent);
}
.tl-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tl-card-icon {
    width: 46px; height: 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--tl-tone-soft);
    color: var(--tl-tone);
    font-size: 1.3rem;
    transition: background-color .25s, color .25s;
}
.tl-card:hover .tl-card-icon { background: var(--tl-tone); color: #fff; }
.tl-card h3 { font-size: 1.05rem; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.tl-card p { font-size: .88rem; color: var(--hm-muted); margin: 0; line-height: 1.6; flex: 1; }
.tl-card-go { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; font-weight: 600; color: var(--tl-tone); }
.tl-card-go .bi { transition: transform .2s var(--hm-ease); }
.tl-card:hover .tl-card-go .bi { transform: translateX(3px); }
.tl-badge {
    padding: 3px 9px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    border-radius: 999px;
    background: #FEF3C7;
    color: #92400E;
}
.tl-badge.is-new { background: #DCFCE7; color: #166534; }
html[lang="bn"] .tl-badge { text-transform: none; letter-spacing: 0; font-size: .75rem; }

.tl-hub-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.tl-hub-search { position: relative; flex: 0 1 360px; }
.tl-hub-search .bi { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--hm-muted); }
.tl-hub-search .tl-input { padding-left: 40px; border-radius: 999px; }
.tl-hub-stats { display: flex; justify-content: center; gap: 28px; margin-top: 28px; list-style: none; padding: 0; }
.tl-hub-stats li { text-align: center; }
.tl-hub-stats strong { display: block; font-size: 1.4rem; font-weight: 800; color: var(--hm-ink); }
.tl-hub-stats span { font-size: .82rem; color: var(--hm-muted); }
.tl-cat-title { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; margin: 36px 0 16px; }
.tl-cat-title .bi { color: var(--hm-brand); }
.tl-cat[hidden] { display: none; }

/* ---------- Toast & nudge ---------- */
.tl-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 1080;
    transform: translate(-50%, 20px);
    opacity: 0;
    padding: 12px 18px;
    border-radius: 12px;
    background: var(--hm-ink);
    color: #fff;
    font-size: .9rem;
    box-shadow: 0 16px 40px -12px rgba(11, 16, 32, .5);
    transition: opacity .25s, transform .25s var(--hm-ease);
    pointer-events: none;
    max-width: calc(100vw - 32px);
}
.tl-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.tl-nudge {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1070;
    width: min(340px, calc(100vw - 32px));
    padding: 18px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--hm-line);
    box-shadow: 0 24px 60px -20px rgba(11, 16, 32, .35);
    transform: translateY(20px);
    opacity: 0;
    transition: opacity .3s, transform .3s var(--hm-ease);
}
.tl-nudge.is-on { opacity: 1; transform: none; }
.tl-nudge strong { display: block; color: var(--hm-ink); margin-bottom: 4px; }
.tl-nudge p { font-size: .86rem; color: var(--hm-muted); margin: 0 0 12px; }
.tl-nudge .tl-toolbar-group { justify-content: flex-end; }

/* ---------- Documents (invoice / payslip / sheets) ---------- */
.tl-doc {
    background: #fff;
    color: #111827;
    font-size: 12.5px;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
}
.tl-doc h2, .tl-doc h3, .tl-doc h4 { color: #111827; letter-spacing: 0; }
.tl-doc table { width: 100%; border-collapse: collapse; }
.tl-doc th, .tl-doc td { padding: 6px 8px; border: 1px solid #D1D5DB; vertical-align: top; }
.tl-doc th { background: #F3F4F6; font-weight: 600; font-size: 11px; text-align: left; }
.tl-doc .r { text-align: right; }
.tl-doc .c { text-align: center; }
.tl-paper {
    width: 100%;
    max-width: 794px;
    margin: 0 auto;
    padding: 40px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 20px 50px -20px rgba(11, 16, 32, .25);
}
.tl-preview-wrap { background: #E9ECF2; padding: 24px; border-radius: 16px; overflow-x: auto; }

.tl-print-only { display: none; }
.tl-pv { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .tl-grid, .tl-grid.is-even { grid-template-columns: 1fr; }
    .tl-pane + .tl-pane { border-left: 0; border-top: 1px solid var(--hm-line); }
    .tl-sticky { position: static; }
    .tl-content-grid { grid-template-columns: 1fr; gap: 32px; }
    .tl-side { position: static; }
    .tl-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
    .tl-hero { padding: 100px 0 20px; }
    .tl-hero-row { gap: 14px; }
    .tl-hero-icon { width: 48px; height: 48px; border-radius: 14px; font-size: 1.3rem; }
    .tl-pane { padding: 20px 16px; }
    .tl-row, .tl-row.is-3 { grid-template-columns: 1fr; }
    .tl-row.keep-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tl-kpis.is-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tl-cards { grid-template-columns: 1fr; gap: 12px; }
    .tl-card { padding: 18px; }
    .tl-toolbar { padding: 12px 16px; }
    .tl-toolbar-group { width: 100%; }
    .tl-toolbar-group .hm-btn { flex: 1; }
    .tl-preview-wrap { padding: 10px; }
    .tl-paper { padding: 20px; }
    .tl-hub-search { flex: 1 1 100%; }
    .tl-work { padding-bottom: 48px; }
}
.tl-card[hidden], .tl-cat[hidden] { display: none !important; }

/* ==========================================================================
   PRINT / SAVE AS PDF
   Last in the file so it wins over the responsive rules (a printed A4 page
   is only ~700 CSS px wide, which would otherwise trigger the mobile layout).
   Calculators (.tl-report) print as a one-page report: letterhead, inputs as
   plain values, results as light cards. Document tools (.is-doc) print their
   own document and only get the chrome stripped here.
   ========================================================================== */
@media print {
    @page { size: A4 portrait; margin: 12mm; }
    html { font-size: 12px; }
    html, body { background: #fff !important; }
    body { color: #111827; margin: 0 !important; padding: 0 !important; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    [data-aos] { opacity: 1 !important; transform: none !important; }

    /* Site chrome */
    #mainNav, .site-footer, .tl-hero, .tl-after, .tl-faq-section, .tl-related, .hm-cta-section, .phpdebugbar,
    .tl-no-print, .tl-toast, .tl-nudge, .tl-tabs, .tl-toolbar { display: none !important; }
    main { padding: 0 !important; overflow: visible !important; }
    .tl-work { padding: 0 !important; }
    .tl-work > .container { max-width: none !important; width: auto !important; padding: 0 !important; margin: 0 !important; }
    .tl-app { border: 0 !important; box-shadow: none !important; border-radius: 0 !important; overflow: visible !important; background: none !important; }
    .tl-preview-wrap { background: none !important; padding: 0 !important; overflow: visible !important; }
    .tl-paper { box-shadow: none !important; padding: 0 !important; max-width: none !important; border-radius: 0 !important; }
    .tl-print-only { display: block !important; }

    /* ---------- Report letterhead ---------- */
    .tl-print-head {
        display: flex !important;
        justify-content: space-between;
        align-items: flex-end;
        gap: 16px;
        padding-bottom: 10px;
        margin-bottom: 16px;
        border-bottom: 2.5px solid var(--tl-tone);
    }
    .tl-ph-brand img { max-height: 34px; max-width: 160px; display: block; }
    .tl-ph-brand img + strong { display: none; }
    .tl-ph-brand strong { display: block; font-size: 1.35rem; font-weight: 800; color: #111827; letter-spacing: -.01em; }
    .tl-ph-brand small, .tl-ph-title small { display: block; font-size: .8rem; color: #6B7280; margin-top: 2px; }
    .tl-ph-title { text-align: right; }
    .tl-ph-title h2 { margin: 0; font-size: 1.45rem; font-weight: 800; color: var(--tl-tone); }
    .tl-print-foot {
        margin-top: 18px;
        padding-top: 8px;
        border-top: 1px solid #E5E7EB;
        font-size: .78rem;
        color: #6B7280;
        break-inside: avoid;
    }
    .tl-print-foot p { margin: 0 0 3px; }

    /* ---------- Report layout: inputs | results ---------- */
    .tl-report .tl-grid, .tl-report .tl-grid.is-even { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }
    .tl-report .tl-pane { padding: 0 16px 0 0 !important; border: 0 !important; }
    .tl-report .tl-pane + .tl-pane { padding: 0 0 0 16px !important; border-left: 1px solid #E5E7EB !important; }
    .tl-report [role="tabpanel"]:not(.tl-grid) > .tl-pane,
    .tl-report .tl-app > .tl-pane { padding: 14px 0 0 !important; border: 0 !important; }
    .tl-report .tl-pane-out { background: none !important; }
    .tl-report .tl-sticky { position: static !important; }
    .tl-report .tl-fields { gap: 9px !important; }
    .tl-report .tl-row { gap: 10px !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .tl-report .tl-row.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
    .tl-report .tl-pane-title { margin: 0 0 8px !important; font-size: .78rem !important; color: #111827 !important; }
    .tl-report .tl-pane-title.mt-4, .tl-report .mt-4 { margin-top: 14px !important; }
    .tl-report .tl-divider { margin: 2px 0 !important; background: #E5E7EB; }

    /* Inputs read as filled-in values, not form boxes */
    .tl-report .tl-label { margin-bottom: 1px !important; font-size: .82rem !important; font-weight: 500 !important; color: #6B7280 !important; }
    .tl-report .tl-label small, .tl-report .tl-hint, .tl-report .bc-bulk-hint { display: none !important; }
    .tl-report .tl-input, .tl-report .tl-select, .tl-report .tl-textarea {
        min-height: 0 !important;
        height: auto !important;
        padding: 2px 0 3px !important;
        border: 0 !important;
        border-bottom: 1px solid #E5E7EB !important;
        border-radius: 0 !important;
        background: none !important;
        box-shadow: none !important;
        font-size: 1rem !important;
        font-weight: 600 !important;
        color: #111827 !important;
    }
    .tl-report .tl-input.is-big { font-size: 1.3rem !important; }
    .tl-report .tl-select { background-image: none !important; padding-right: 0 !important; }
    .tl-report .tl-textarea { min-height: 0 !important; resize: none; }
    .tl-report .tl-ig.has-pre .tl-input { padding-left: 15px !important; }
    .tl-report .tl-ig.has-suf .tl-input { padding-right: 46px !important; }
    .tl-report .tl-ig-pre { left: 0 !important; font-size: 1rem !important; color: #111827 !important; }
    .tl-report .tl-ig-suf { right: 0 !important; }
    .tl-report ::placeholder { color: transparent !important; }
    .tl-report input[type="date"]::-webkit-calendar-picker-indicator,
    .tl-report input[type="month"]::-webkit-calendar-picker-indicator { display: none; }
    .tl-report input[type="range"], .tl-report .tl-add, .tl-report .tl-icon-btn, .tl-report .tl-out-copy,
    .tl-report .hm-btn, .tl-report .tl-details:not([open]), .tl-report .tl-details > summary .bi { display: none !important; }
    .tl-report .tl-details > summary { color: #6B7280 !important; font-size: .82rem !important; }
    .tl-report .tl-details > div { margin-top: 6px !important; }
    .tl-report .tl-check { font-size: .9rem; }

    /* Segmented controls & chips: print only the chosen option */
    .tl-report .tl-seg { display: inline-flex !important; padding: 0 !important; border: 0 !important; background: none !important; }
    .tl-report .tl-seg button:not([aria-pressed="true"]),
    .tl-report .tl-chip:not([aria-pressed="true"]),
    .tl-report .iv-swatches button:not([aria-pressed="true"]) { display: none !important; }
    .tl-report .tl-seg button[aria-pressed="true"],
    .tl-report .tl-chip[aria-pressed="true"] {
        padding: 3px 10px !important;
        border: 1px solid #D1D5DB !important;
        border-radius: 6px !important;
        background: none !important;
        box-shadow: none !important;
        color: #111827 !important;
        font-size: .9rem !important;
        text-align: left;
    }
    .tl-report .tl-chip small { display: inline !important; margin-left: 4px; }
    .tl-report .tl-chips { gap: 0 !important; }

    /* Results */
    .tl-report .tl-out {
        padding: 12px 16px !important;
        background: #fff !important;
        color: #111827 !important;
        border: 2px solid var(--tl-tone) !important;
        border-radius: 10px !important;
        box-shadow: none !important;
        break-inside: avoid;
    }
    .tl-report .tl-out-label, .tl-report .tl-out-sub { color: #4B5563 !important; }
    .tl-report .tl-out-value { font-size: 1.9rem !important; color: var(--tl-tone) !important; }
    .tl-report .tl-kpis { gap: 6px !important; margin-top: 8px !important; }
    .tl-report .tl-kpi { padding: 7px 10px !important; border-color: #E5E7EB !important; break-inside: avoid; }
    .tl-report .tl-kpi strong { font-size: 1.05rem !important; }
    .tl-report .tl-rows { margin-top: 8px !important; padding: 0 10px !important; border-color: #E5E7EB !important; }
    .tl-report .tl-rows li { padding: 5px 0 !important; break-inside: avoid; }
    .tl-report .tl-words { margin-top: 8px !important; padding: 8px 10px !important; break-inside: avoid; }
    .tl-report .tl-alert { padding: 7px 10px !important; font-size: .85rem !important; break-inside: avoid; }
    .tl-report .mt-3 { margin-top: 8px !important; }

    /* Tables print in full */
    .tl-report .tl-table-wrap, .tl-report .tl-scroll { max-height: none !important; overflow: visible !important; border-color: #E5E7EB !important; }
    .tl-report .tl-table { font-size: .85rem !important; }
    .tl-report .tl-table th { position: static !important; }
    .tl-report .tl-table th, .tl-report .tl-table td { padding: 4px 8px !important; }
    .tl-report .tl-table td.is-input { padding: 2px 8px !important; }
    .tl-report .tl-table tr { break-inside: avoid; }
    .tl-report .tl-table thead { display: table-header-group; }
    .tl-report .tl-chart { max-height: 190px; }

    /* Field values printed as text (see preparePrintValues in core.js) */
    .tl-report .has-pv { display: none !important; }
    .tl-report .tl-pv {
        display: block !important;
        padding: 2px 0 3px;
        border-bottom: 1px solid #E5E7EB;
        font-size: 1rem;
        font-weight: 600;
        color: #111827;
        line-height: 1.4;
        white-space: pre-line;
        overflow-wrap: anywhere;
        font-variant-numeric: tabular-nums;
    }
    .tl-report .tl-pv.is-big { font-size: 1.3rem; }
    .tl-report .tl-ig.has-pre .tl-pv { padding-left: 15px; }
    .tl-report .tl-ig.has-suf .tl-pv { padding-right: 46px; }
    .tl-report .tl-table .tl-pv { border: 0; font-size: .85rem; font-weight: 500; }
    .tl-report .be-cost { grid-template-columns: minmax(0, 1fr) 130px !important; }
    .tl-report .be-cost .tl-pv { font-weight: 500; }

    /* Only the active tab prints (the grid rule above would otherwise un-hide the others) */
    .tl-report [role="tabpanel"][hidden], .tl-report [hidden] { display: none !important; }
}
