html, body {
    /* --mk-font keeps Plus Jakarta Sans first, then adds the Noto families.
       The old stack fell through to Helvetica/Arial, neither of which has a
       single Indic glyph — every Hindi/Marathi/Tamil string rendered as tofu
       on any machine without a system Noto. */
    font-family: var(--mk-font);
    height: 100%;
    margin: 0;
    padding: 0;

    /* Explicit, from a token. Without it the page ground stays browser-white in
       dark mode and every gap between cards glares — the cards flip, the canvas
       behind them doesn't. */
    background: var(--mk-bg-app);
    color: var(--mk-text);
}

/* Shared compact control sizing — keeps native <input type=date> and custom
   toggle/segmented buttons visually aligned with MyStackBlazor's own
   StackInput/StackSelect/StackButton baseline (36px height, 6px radius, 14px font). */
.mk-date-input {
    width: 100%; height: 36px; padding: 0 12px; box-sizing: border-box;
    border: 1.5px solid #e2e8f0; border-radius: 6px;
    font-size: 14px; color: #0f172a; outline: none; background: white;
}
.mk-toggle-btn {
    height: 36px; padding: 0 14px; border-radius: 6px;
    font-size: 13.5px; font-weight: 700; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    transition: border-color .15s, background .15s, color .15s, transform .12s, box-shadow .12s;
}
.mk-toggle-btn:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(15,23,42,.08); }

/* eKash personal finance nav section labels */
.nav-section-label {
    font-size: 11px;
    font-weight: 700;
    /* Was a literal #9ca3af, which is the cold grey the dark ramp no longer
       uses — it left the PF nav headings reading blue against warm charcoal. */
    color: var(--mk-text-2);
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* eKash + bootstrap palette tokens — BRIDGE ONLY.
   These values are no longer authored here. Every one of them now derives
   from the --mk-* base in css/design-tokens.css, which loads before this
   file; the aliases exist so the ~6 Personal Finance pages written against
   --ek-* and bootstrap's own --bs-* rules keep working unchanged.
   To change a brand color, edit design-tokens.css — editing it here only
   desynchronises this namespace from the rest of the app.
   No .dark block is needed anymore either: --mk-* is already redefined under
   .dark in the base file, so these aliases follow the theme automatically. */
:root {
    --bs-primary: var(--mk-primary);
    /* Bootstrap needs the channels unpacked for its rgba() mixes, so this one
       cannot be an alias — keep it in step with --mk-orange by hand. */
    --bs-primary-rgb: 249, 115, 22;

    --ek-primary: var(--mk-primary);
    --ek-primary-lt: var(--mk-primary-lt);
    --ek-success: var(--mk-success);
    --ek-success-lt: var(--mk-success-lt);
    --ek-danger: var(--mk-danger);
    --ek-danger-lt: var(--mk-danger-lt);
    --ek-warning: var(--mk-warning);
    --ek-warning-lt: var(--mk-warning-lt);
    --ek-info: var(--mk-info);
    --ek-info-lt: var(--mk-info-lt);
    --ek-purple: var(--mk-purple);
    --ek-purple-lt: var(--mk-purple-lt);
    --ek-text: var(--mk-text);
    --ek-muted: var(--mk-text-2);
    --ek-surface: var(--mk-bg-app);
    --ek-border: var(--mk-border);
    --ek-card: var(--mk-bg-surface);
    --ek-r: var(--mk-r-md);
    --ek-r-btn: var(--mk-r-sm);
    --ek-shadow: var(--mk-sh-sm);
    --ek-shadow-md: var(--mk-sh-md);
}

/* Link color is the darkened orange, not the primary: the brand orange on
   white is only ~2.9:1, well under the 4.5:1 AA floor for body-size text. */
a, .btn-link {
    color: var(--mk-primary-ink);
}

.btn-primary {
    color: var(--mk-text-oncolor);
    background-color: var(--mk-primary);
    border-color: var(--mk-primary-hover);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem var(--mk-bg-surface), 0 0 0 0.25rem var(--mk-orange-dark);
}

.content {
    padding-top: 0;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92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cuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ── Global responsive fixes ─────────────────────────────────────────────
   MyStackBlazor's <StackGridLayout Columns="N"> (used across ~40+ pages —
   Accounting, Inventory, GST, Analytics, Niche, Reports, etc.) renders an
   unclassed <div style="display:grid;grid-template-columns:repeat(N,
   minmax(0,1fr))"> with no breakpoints of its own — confirmed by inspecting
   the actual DOM output (no grid-cols-N class is ever present, so a
   class-based override cannot match it). The only hook available is the
   inline style itself; !important is required to beat it since inline
   styles otherwise always win over stylesheet rules. */
@media (max-width: 640px) {
    div[style*="grid-template-columns:repeat("] {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}
@media (max-width: 420px) {
    div[style*="grid-template-columns:repeat("] {
        grid-template-columns: 1fr !important;
    }
}

/* Ultrawide monitors (1920px+ desktops) — page content otherwise stretches
   edge-to-edge with no cap, leaving dashboard grids very sparse. Only kicks
   in well above laptop width so normal desktops are unaffected. */
@media (min-width: 1800px) {
    /* Full-screen overlays are excluded. A modal backdrop is a direct child of the content
       area but is `position: fixed; inset: 0`, so capping it at 1800px and auto-centring it
       shrinks the *backdrop* — the dim stops 60px short on each side at 1920px wide and the
       page shows through undimmed beside the modal. The cap is meant for in-flow page content
       only. `[class*="overlay"]` covers .pos-overlay / .rm-overlay / .del-overlay /
       .bill-del-overlay, `[class*="backdrop"]` covers .bsheet-backdrop; add .mk-full-bleed to
       anything new that must span the viewport. */
    main > article.content > *:not([class*="overlay"]):not([class*="backdrop"]):not(.mk-full-bleed) {
        max-width: 1800px;
        margin-left: auto;
        margin-right: auto;
    }
}