/* MyVisa — layered on Bootstrap 5.3. Logical properties (inline-start/end)
   throughout so the layout mirrors correctly under dir="rtl". */
:root {
    --bg: #eef1f5;
    --surface: #ffffff;
    --surface-2: #f7f9fc;
    --ink: #1f2937;
    --muted: #6b7280;
    --faint: #9aa1ad;
    --line: #e2e6ec;
    --accent: #2350c6;
    --accent-ink: #1b3fa0;
    --accent-bg: #eaeffb;
    --ok: #15803d;   --ok-bg: #e7f5ec;
    --warn: #b45309; --warn-bg: #fbf2e2;
    --bad: #b91c1c;  --bad-bg: #fbe9e9;
    --credit: #0f766e;
    --up: #b91c1c; --down: #15803d;
    --radius: 8px;
    /* one colour per top-level category, shared by every chart and swatch */
    --cat-food: #2f6bff; --cat-transport: #f2701f; --cat-home: #12b886; --cat-health: #e64980;
    --cat-kids: #fab005; --cat-shopping: #7950f2; --cat-leisure: #15aabf; --cat-travel: #fd7e14;
    --cat-insurance: #5c7cfa; --cat-finance: #868e96; --cat-personal: #f783ac; --cat-other: #adb5bd;
    --shadow: 0 1px 1px rgba(16,24,40,.03), 0 1px 3px rgba(16,24,40,.06);
}
[data-bs-theme="dark"] {
    --bg: #0f1218;
    --surface: #171b23;
    --surface-2: #1c212b;
    --ink: #e5e7eb;
    --muted: #9ca3af;
    --faint: #6b7280;
    --line: #2a303b;
    --accent: #7b9cf5;
    --accent-ink: #a9bff9;
    --accent-bg: #1e2a48;
    --ok: #4ade80;   --ok-bg: #12301f;
    --warn: #fbbf24; --warn-bg: #33270f;
    --bad: #f87171;  --bad-bg: #3a1717;
    --credit: #2dd4bf;
    --shadow: none;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0; background: var(--bg); color: var(--ink);
    font-family: 'Inter', 'Heebo', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 14px; -webkit-font-smoothing: antialiased;
    display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden;
}
a { color: var(--accent); }

/* ---------- Shell: fixed nav/footer, only main scrolls ---------- */
.app-nav, .app-footer, .app-banner { flex: 0 0 auto; }
.app-main { flex: 1 1 auto; min-height: 0; overflow-y: auto; width: 100%; }
.app-inner { max-width: 1500px; margin: 0 auto; padding: 1.25rem clamp(.8rem, 3vw, 2.25rem) 3rem; }

.app-nav { background: var(--surface); border-bottom: 1px solid var(--line); }
.app-nav .inner { max-width: 1500px; margin: 0 auto; padding: 0 clamp(.8rem, 3vw, 2.25rem); }
.navbar-brand { font-size: 1rem; font-weight: 650; color: var(--ink) !important; }
.brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 7px;
              background: var(--accent); color: #fff; font-size: .95rem; }
.app-nav .nav-link { color: var(--muted); font-weight: 500; padding: .4rem .7rem; border-radius: 6px; font-size: .9rem; }
.app-nav .nav-link:hover { color: var(--ink); background: var(--bg); }
.app-nav .nav-link.active { color: var(--accent-ink); background: var(--accent-bg); }
.nav-user { color: var(--faint); font-size: .82rem; }
.sync-pill { display: inline-flex; align-items: center; gap: .45rem; font-size: .8rem; color: var(--muted);
             border: 1px solid var(--line); border-radius: 999px; padding: .2rem .25rem .2rem .7rem; }
.sync-mini { font-size: .78rem; color: var(--muted); }
.sync-pill .btn { padding: .1rem .55rem; font-size: .78rem; border-radius: 999px; }

.app-banner { padding: .5rem clamp(.8rem, 3vw, 2.25rem); font-size: .86rem; border-bottom: 1px solid var(--line); }
.app-banner.warn { background: var(--warn-bg); color: var(--warn); }
.app-banner.bad { background: var(--bad-bg); color: var(--bad); }
.app-banner.info { background: var(--accent-bg); color: var(--accent-ink); }
.sync-progress .progress { height: 5px; background: color-mix(in srgb, var(--accent) 15%, transparent); }
.sync-progress .progress-bar { background: var(--accent); transition: width .6s ease; }
.app-footer { text-align: center; padding: .6rem; color: var(--faint); font-size: .78rem; border-top: 1px solid var(--line);
              background: var(--surface); }

/* ---------- Headings / panels ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-title { font-weight: 700; letter-spacing: -.01em; margin: 0; font-size: 1.35rem; }
.subtle { color: var(--muted); }
.section-title { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; margin: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel + .panel { margin-top: 1rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1.1rem;
              border-bottom: 1px solid var(--line); }
.panel-body { padding: 1.1rem; }

/* ---------- Cycle tabs: one billing cycle (charge month) at a time ---------- */
.cycle-tabs { display: flex; gap: .4rem; overflow-x: auto; padding: .1rem .1rem .6rem; margin-bottom: .4rem;
              scrollbar-width: thin; scroll-snap-type: x proximity; }
.cycle-tab { flex: 0 0 auto; display: flex; flex-direction: column; gap: .1rem; min-width: 112px; padding: .45rem .75rem;
             border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink);
             text-decoration: none; scroll-snap-align: start; }
.cycle-tab:hover { border-color: var(--accent); color: var(--ink); }
.cycle-tab.active { border-color: var(--accent); background: var(--accent-bg); box-shadow: inset 0 -2px 0 var(--accent); }
.cycle-name { font-size: .78rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.cycle-tab.active .cycle-name { color: var(--accent-ink); }
.cycle-total { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Filters ---------- */
.filters { display: grid; grid-template-columns: minmax(200px, 2fr) repeat(2, minmax(150px, 1fr)) auto; gap: .6rem; align-items: end; }
.filters-more { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; margin-top: .75rem; }
.filters label, .filters-more label { font-size: .74rem; color: var(--muted); font-weight: 600; margin-bottom: .2rem; display: block; }
.form-control, .form-select { font-size: .88rem; border-color: var(--line); background-color: var(--surface); color: var(--ink); }
.checks { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; padding-top: 1.2rem; }
@media (max-width: 820px) { .filters { grid-template-columns: 1fr 1fr; } .filters .search { grid-column: 1 / -1; } }

.summary-line { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
                padding: .6rem 1.1rem; border-bottom: 1px solid var(--line); font-size: .86rem; color: var(--muted); }
.summary-line strong { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- Tables ---------- */
.table-pro { width: 100%; border-collapse: separate; border-spacing: 0; }
.table-pro thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600;
                      text-align: start; padding: .6rem .85rem; background: var(--surface-2); border-bottom: 1px solid var(--line);
                      white-space: nowrap; }
.table-pro tbody td { padding: .62rem .85rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table-pro tbody tr:last-child td { border-bottom: 0; }
.table-pro tbody tr:hover { background: var(--surface-2); }
.table-pro tbody tr.row-link { cursor: pointer; }
.table-pro .num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-pro tbody tr.flag-warn td:first-child { border-inline-start: 3px solid var(--warn); }
.table-pro tbody tr.flag-bad td:first-child { border-inline-start: 3px solid var(--bad); }
.table-pro tbody tr.is-excluded { opacity: .55; }
.table-pro tbody tr.is-pending td { background: color-mix(in srgb, var(--warn-bg) 45%, transparent); }
/* Hebrew merchants: right-aligned in the merchant column; on phones the whole row card flips */
.table-pro tbody tr.row-rtl td.merchant-cell { direction: rtl; text-align: right; }
.cat-line { font-size: .78rem; color: var(--muted); margin-top: .1rem; }
.cat-name { color: var(--accent-ink); font-weight: 500; }
.cat-src.low { color: var(--warn); }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .5rem 1.1rem; border-bottom: 1px solid var(--line);
            font-size: .82rem; }
.bulk-bar .form-select { width: auto; min-width: 200px; }
.table-pro .pick { width: 2.2rem; padding-inline-end: 0; }
.merchant { font-weight: 600; color: var(--ink); text-decoration: none; unicode-bidi: plaintext; }
.raw { color: var(--faint); font-size: .78rem; unicode-bidi: plaintext; }
.amt-credit { color: var(--credit); }
.date { white-space: nowrap; font-variant-numeric: tabular-nums; }

@media (max-width: 820px) {
    .table-pro thead { display: none; }
    .table-pro, .table-pro tbody, .table-pro tr, .table-pro td { display: block; width: 100%; }
    .table-pro tbody tr { border: 1px solid var(--line); border-radius: var(--radius); margin: .6rem; width: auto;
                          padding: .2rem; background: var(--surface); }
    .table-pro tbody td { border: 0; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .35rem .7rem; }
    .table-pro tbody td::before { content: attr(data-label); font-weight: 600; color: var(--muted); font-size: .72rem;
                                  text-transform: uppercase; letter-spacing: .03em; flex: 0 0 auto; }
    .table-pro tbody td[data-label=""]::before { content: none; }
    .table-pro tbody tr.flag-warn td:first-child, .table-pro tbody tr.flag-bad td:first-child { border-inline-start: 0; }
    .table-pro tbody tr.flag-warn, .table-pro tbody tr.flag-bad { border-inline-start: 3px solid var(--warn); }
    .table-pro tbody tr.flag-bad { border-inline-start-color: var(--bad); }
    .table-pro tbody tr.row-rtl { direction: rtl; }
    .table-pro td.pick { position: absolute; inset-inline-end: .4rem; top: .4rem; width: auto; }
    .table-pro tbody tr { position: relative; }
    .table-pro tbody tr.is-pending { background: color-mix(in srgb, var(--warn-bg) 45%, var(--surface)); }
    .table-pro tbody tr.is-pending td { background: transparent; }
}

/* ---------- Badges ---------- */
.tag { display: inline-flex; align-items: center; gap: .25rem; border-radius: 5px; padding: .05rem .4rem; font-size: .7rem;
       font-weight: 600; border: 1px solid var(--line); color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.tag.pending { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.tag.credit { color: var(--credit); background: color-mix(in srgb, var(--credit) 12%, transparent); border-color: transparent; }
.tag.inst { color: var(--accent-ink); background: var(--accent-bg); border-color: transparent; }
.tags { display: inline-flex; flex-wrap: wrap; gap: .25rem; vertical-align: middle; }

.status { display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.s-ok { color: var(--ok); } .s-ok .dot { background: var(--ok); }
.s-warn { color: var(--warn); } .s-warn .dot { background: var(--warn); }
.s-bad { color: var(--bad); } .s-bad .dot { background: var(--bad); }
.s-run { color: var(--accent); } .s-run .dot { background: var(--accent); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- Detail ---------- */
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem 1.5rem; }
.kv dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.kv dd { margin: .15rem 0 0; font-variant-numeric: tabular-nums; }
.big-amount { font-size: 1.8rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

/* ---------- Empty / states ---------- */
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty i { font-size: 2rem; color: var(--faint); display: block; margin-bottom: .5rem; }
.empty h3 { font-size: 1.05rem; color: var(--ink); font-weight: 650; }

.btn { font-size: .86rem; border-radius: 6px; font-weight: 500; }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.hours { display: flex; flex-wrap: wrap; gap: .3rem; }
.hours label { border: 1px solid var(--line); border-radius: 6px; padding: .2rem .45rem; font-size: .8rem; cursor: pointer;
               font-variant-numeric: tabular-nums; }
.hours input { margin-inline-end: .25rem; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: .7rem 1.1rem; border-top: 1px solid var(--line);
         font-size: .85rem; color: var(--muted); }
.login-wrap { min-height: 70vh; display: grid; place-items: center; }
.login-card { max-width: 380px; width: 100%; text-align: center; }

.cat-tree details { border-bottom: 1px solid var(--line); padding: .5rem 0; }
.cat-tree details:last-child { border-bottom: 0; }
.cat-tree summary { cursor: pointer; }

/* ---------- Dashboard ---------- */
.period-bar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; margin-bottom: 1rem; }
.period-bar label { font-size: .74rem; color: var(--muted); font-weight: 600; margin-bottom: .2rem; display: block; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem;
       display: grid; gap: .2rem; color: var(--ink); text-decoration: none; box-shadow: var(--shadow); }
a.kpi:hover { border-color: var(--accent); color: var(--ink); }
.kpi-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.kpi-value { font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi-note { font-size: .8rem; color: var(--muted); }
.up { color: var(--up); font-weight: 600; } .down { color: var(--down); font-weight: 600; }
.cat-breakdown details { border-bottom: 1px solid var(--line); }
.cat-breakdown details:last-child { border-bottom: 0; }
.cat-breakdown summary { display: grid; grid-template-columns: 12px minmax(110px, 1.2fr) 2fr auto 3rem; gap: .7rem;
                         align-items: center; padding: .6rem 1.1rem; cursor: pointer; list-style: none; }
.cat-breakdown summary::-webkit-details-marker { display: none; }
.cat-link { color: var(--ink); font-weight: 600; text-decoration: none; }
.cat-link:hover { color: var(--accent); }
.swatch { width: 10px; height: 10px; border-radius: 3px; }
.bar { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 4px; }
.amt { font-variant-numeric: tabular-nums; font-weight: 600; text-align: end; white-space: nowrap; }
.pct { text-align: end; font-size: .8rem; }
.subs { padding: 0 1.1rem .6rem calc(1.1rem + 22px); display: grid; gap: .15rem; }
.sub { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem .4rem; border-radius: 6px; color: var(--ink);
       text-decoration: none; font-size: .88rem; }
.sub:hover { background: var(--surface-2); color: var(--ink); }
.chart-box { position: relative; height: 320px; }
[data-cat="food"] { background: var(--cat-food); } [data-cat="transport"] { background: var(--cat-transport); }
[data-cat="home"] { background: var(--cat-home); } [data-cat="health"] { background: var(--cat-health); }
[data-cat="kids"] { background: var(--cat-kids); } [data-cat="shopping"] { background: var(--cat-shopping); }
[data-cat="leisure"] { background: var(--cat-leisure); } [data-cat="travel"] { background: var(--cat-travel); }
[data-cat="insurance"] { background: var(--cat-insurance); } [data-cat="finance"] { background: var(--cat-finance); }
[data-cat="personal"] { background: var(--cat-personal); } [data-cat="other"] { background: var(--cat-other); }
.swatch:not([data-cat="food"]):not([data-cat="transport"]):not([data-cat="home"]):not([data-cat="health"]):not([data-cat="kids"]):not([data-cat="shopping"]):not([data-cat="leisure"]):not([data-cat="travel"]):not([data-cat="insurance"]):not([data-cat="finance"]):not([data-cat="personal"]) { background: var(--cat-other); }
@media (max-width: 820px) { .cat-breakdown summary { grid-template-columns: 12px 1fr auto; } .cat-breakdown .bar, .cat-breakdown .pct { display: none; } }

/* ---------- Compare ---------- */
.findings { list-style: none; margin: 0; padding: .3rem 0; }
.findings li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .2rem 1rem; padding: .45rem 1.1rem;
               border-bottom: 1px solid var(--line); }
.findings li:last-child { border-bottom: 0; }
.findings a { color: var(--ink); font-weight: 600; text-decoration: none; }
.findings a:hover { color: var(--accent); }
.find-detail { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: .88rem; }
.table-pro tr.cat-top td { background: var(--surface-2); }
.matrix-wrap { overflow-x: auto; }
.matrix { border-collapse: separate; border-spacing: 2px; width: 100%; font-size: .8rem; font-variant-numeric: tabular-nums; }
.matrix th { font-weight: 600; color: var(--muted); white-space: nowrap; padding: .35rem .5rem; text-align: end; }
.matrix tbody th { text-align: start; color: var(--ink); }
.matrix td { text-align: end; padding: .35rem .5rem; border-radius: 4px; white-space: nowrap;
             background: color-mix(in srgb, var(--accent) calc(var(--heat, 0) * 45%), var(--surface-2)); }
.matrix td a { color: var(--ink); text-decoration: none; }
.matrix tr.total td, .matrix tr.total th { font-weight: 700; background: transparent; border-top: 1px solid var(--line); }

/* ---------- Insights ---------- */
.alert-list { list-style: none; margin: 0; padding: 0; }
.alert-item { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem 1.5rem; padding: .85rem 1.1rem;
              border-bottom: 1px solid var(--line); border-inline-start: 3px solid transparent; }
.alert-item:last-child { border-bottom: 0; }
.alert-item.sev-warn { border-inline-start-color: var(--warn); }
.alert-item.sev-bad { border-inline-start-color: var(--bad); }
.alert-item.sev-info { border-inline-start-color: var(--accent); }
.alert-main { min-width: 0; flex: 1 1 420px; display: grid; gap: .2rem; }
.alert-title { font-weight: 650; }
.alert-body { color: var(--ink); }
.alert-actions { display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; }
.routing td, .routing th { padding: .35rem .5rem; }

/* ---------- Ask ---------- */
.thread { display: grid; gap: .8rem; max-width: 900px; }
.bubble { border-radius: 14px; padding: .8rem 1rem; max-width: 100%; }
.bubble.user { background: var(--accent); color: #fff; justify-self: end; max-width: 75%; white-space: pre-wrap; }
.bubble.ai { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: grid; gap: .7rem; }
.answer p { margin: 0 0 .5rem; } .answer p:last-child { margin: 0; }
.answer ul { margin: 0 0 .5rem; padding-inline-start: 1.2rem; }
.ai-findings { display: grid; gap: .4rem; }
.ai-finding { border-inline-start: 3px solid var(--accent); padding: .3rem .7rem; background: var(--surface-2); border-radius: 6px; font-size: .9rem; }
.ai-finding.sev-concern { border-inline-start-color: var(--bad); } .ai-finding.sev-notable { border-inline-start-color: var(--warn); }
.ai-questions, .ai-proposals { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.ai-questions .section-title, .ai-proposals .section-title { flex-basis: 100%; }
.ai-question { border: 1px dashed var(--accent); background: transparent; color: var(--accent-ink); border-radius: 8px;
               padding: .35rem .6rem; font-size: .88rem; text-align: start; }
.ai-question:hover { background: var(--accent-bg); }
.ai-evidence ul { margin: .4rem 0 0; padding-inline-start: 1.1rem; font-size: .88rem; }

.summary-item { border-bottom: 1px solid var(--line); padding: .7rem 1.1rem; }
.summary-item:last-child { border-bottom: 0; }
.summary-item summary { cursor: pointer; }
.summary-item ul { margin: .5rem 0 0; }

.budget-bar { position: relative; height: 10px; background: var(--surface-2); border-radius: 5px; margin-top: .35rem; }
.budget-bar .fill { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 5px; background: var(--ok); }
.budget-bar .fill.warn { background: var(--warn); } .budget-bar .fill.over { background: var(--bad); }
.budget-bar .pace-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); opacity: .5; }

.edit-dialog { border: 1px solid var(--bs-border-color); border-radius: 12px; padding: 1.25rem; width: min(440px, 92vw); }
.edit-dialog::backdrop { background: rgba(15, 23, 42, .35); }
.commit-row { display: grid; grid-template-columns: 7rem 1fr auto; gap: .75rem; align-items: center; }
.commit-row .bar { height: 8px; background: var(--bs-tertiary-bg); border-radius: 4px; overflow: hidden; }
.commit-row .bar > span { display: block; height: 100%; background: var(--bs-primary); border-radius: 4px; }
.settings-index { display: flex; flex-wrap: wrap; gap: .25rem .75rem; position: sticky; top: 0; z-index: 5; background: var(--bs-body-bg); padding: .5rem 0; margin-bottom: .5rem; border-bottom: 1px solid var(--bs-border-color); }
.settings-index a { font-size: .875rem; text-decoration: none; }
.nav-sync .sync-pill { flex-wrap: nowrap; white-space: nowrap; }

.setup-list { list-style: none; margin: 0; padding: 0; }
.setup-list li a { display: flex; align-items: center; padding: .7rem 1.25rem; border-top: 1px solid var(--bs-border-color); color: inherit; text-decoration: none; }
.setup-list li a:hover { background: var(--bs-tertiary-bg); }
.settings-tabs { position: sticky; top: 0; z-index: 5; background: var(--bs-body-bg); }
.bubble.ai.thinking .live-text { white-space: pre-line; margin-top: .5rem; }

/* Compare: long tables fold (closed by default on phones, see app.js) */
details.fold > summary { list-style: none; cursor: pointer; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary .section-title::after { content: " ▾"; color: var(--bs-secondary-color); }
details.fold:not([open]) > summary .section-title::after { content: " ▸"; }
.sort-link { color: inherit; text-decoration: none; white-space: nowrap; }
.sort-link:hover { text-decoration: underline; }

/* Phones: touch targets of at least ~40 px, and a menu that scrolls inside the screen */
@media (max-width: 576px) {
    .form-check-input { width: 1.35rem; height: 1.35rem; }
    .table-pro td .form-check-input, .table-pro th .form-check-input { margin: .35rem; }
    .panel-head a.small, .alert-item a.small, .kpi-note a, .find-detail a, .alert-actions .btn-link,
    .panel-body a.small { display: inline-block; padding: .6rem .25rem; }
    .btn-sm { min-height: 2.5rem; }
    .settings-tabs { flex-wrap: nowrap; overflow-x: auto; }
    .settings-tabs .nav-link { white-space: nowrap; }
    .table-pro tbody tr { padding: .6rem .75rem; }
}
@media (max-width: 991.98px) {
    .app-nav .navbar-collapse { max-height: calc(100dvh - 64px); overflow-y: auto; }
}
