/* Venire Balance design tokens (2026-11-16). Every colour, size, radius, shadow and duration the app uses has a
   name here; components and pages use the names, not raw values. The same values exist in C#
   (Layout/ThsTokens.cs) for the MudBlazor theme and the charts: change both together. /styleguide shows them.
   The dark theme = these names redefined under [data-theme="dark"] (below). */
:root {
    /* ── Colour: brand ───────────────────────────────────────────────── */
    --ths-brand:          #20B2AA;   /* teal: primary actions, "on target", highlights */
    --ths-brand-hover:    #1A9E97;   /* a teal button under the pointer */
    --ths-brand-strong:   #0F766E;   /* dark teal: teal as text and small marks (readable on white) */
    --ths-brand-deep:     #064C46;   /* the logo's ink */
    --ths-brand-pale:     #B5E3E0;   /* pale teal: "on the way" bars */
    --ths-brand-tint:     #E0F5F4;   /* teal wash: chips, selected rows and tiles */
    --ths-primary-tint:   var(--ths-brand-tint);   /* the earlier name */

    /* ── Colour: status (marks, not small text: see CLAUDE.md) ────────── */
    --ths-ok:             #20B2AA;   /* on target / reached */
    --ths-ok-text:        #0F766E;
    --ths-low:            #F59E0B;   /* low / needs attention */
    --ths-low-tint:       #FEF3C7;
    --ths-low-text:       #92400E;
    --ths-over:           #DC2626;   /* over a limit (sparingly) */
    --ths-over-tint:      #FEE2E2;
    --ths-over-text:      #991B1B;   /* text on the over-limit tint */
    --ths-neutral:        #C5CED3;   /* no verdict (a partly logged day) */

    /* ── Colour: text, surfaces, lines ───────────────────────────────── */
    --ths-text:           #1F2937;   /* primary text */
    --ths-text-2:         #6B7280;   /* secondary: labels, captions, meta */
    --ths-text-3:         #9CA3AF;   /* faint: hints, placeholders, disabled */
    --ths-text-on-brand:  #FFFFFF;
    --ths-bg:             #F7FAFA;   /* page background */
    --ths-surface:        #FFFFFF;   /* cards */
    --ths-line:           #E5E7EB;   /* borders, dividers */
    --ths-track:          #E8EEEE;   /* bar tracks, chart grid */
    --ths-line-soft:      rgba(0, 0, 0, 0.07);    /* hairlines inside cards, tile borders */
    --ths-wash:           rgba(0, 0, 0, 0.035);   /* a faint grey area: a selected tile, a chart band */
    --ths-line-input:     rgba(0, 0, 0, 0.23);    /* input borders (MudBlazor's outline) */

    /* ── Colour: series (charts and their marks) ─────────────────────── */
    --ths-protein:        #8662DA;
    --ths-carbs:          #4385DB;
    --ths-fat:            #DC6096;
    --ths-fibre:          #39AC5C;
    --ths-salt:           #6F819B;
    --ths-water:          #78ADE2;
    --ths-nova-1:         #20B2AA;
    --ths-nova-2:         #9ED9D5;
    --ths-nova-3:         #C5CED3;
    --ths-nova-4:         #E57373;

    /* ── Typography ──────────────────────────────────────────────────── */
    --ths-font:           Inter, Helvetica, Arial, sans-serif;
    --ths-font-brand:     Montserrat, Inter, sans-serif;   /* the logo only */
    --ths-fs-micro:       11px;      /* chart axes, badges, tags */
    --ths-fs-sm:          12px;      /* captions, tile labels, meta */
    --ths-fs-md:          14px;      /* body, titles of things you act on */
    --ths-fs-lg:          16px;      /* lead text, onboarding and tips body */
    --ths-fs-xl:          20px;      /* page titles */
    --ths-fs-2xl:         24px;      /* screen titles (onboarding, tips) */
    --ths-fs-num:         32px;      /* a big number (a score) */
    --ths-fs-hero:        40px;      /* the biggest number (the gauge) */
    --ths-fw-regular:     400;
    --ths-fw-medium:      500;
    --ths-fw-semibold:    600;
    --ths-fw-bold:        700;
    --ths-lh-tight:       1.3;
    --ths-lh-body:        1.5;

    /* ── Spacing: the 4 px grid ──────────────────────────────────────── */
    --ths-space-1:        4px;
    --ths-space-2:        8px;
    --ths-space-3:        12px;
    --ths-space-4:        16px;
    --ths-space-5:        20px;
    --ths-space-6:        24px;
    --ths-space-8:        32px;

    /* ── Radius ──────────────────────────────────────────────────────── */
    --ths-radius-sm:      4px;       /* chips, badges, tags */
    --ths-radius-md:      8px;       /* buttons, inputs */
    --ths-radius-lg:      12px;      /* cards, sheets */
    --ths-radius-pill:    999px;     /* pills, round buttons */
    --ths-radius-card:    var(--ths-radius-lg);   /* cards (owner 2026-11-16: 12 px) */
    --ths-radius-tile:    var(--ths-radius-md);   /* tiles and small boxes inside cards (8 px) */

    /* ── Icons (owner 2026-11-16): outlined; filled only for a state (done, the active tab) ── */
    --ths-icon-xs:        14px;      /* in small text and chips: card corner arrows, marks */
    --ths-icon-sm:        16px;      /* in body text, small buttons */
    --ths-icon-md:        20px;      /* list rows, small icon buttons (MudBlazor's Size.Small) */
    --ths-icon-lg:        24px;      /* navigation, back arrows, buttons (MudBlazor's default) */
    --ths-icon-xl:        32px;      /* feature icons: the Log page's ways, the tip's lightbulb */

    /* ── Elevation ───────────────────────────────────────────────────── */
    --ths-shadow-1:       0 1px 3px rgba(16, 40, 38, 0.08), 0 1px 2px rgba(16, 40, 38, 0.04);   /* cards */
    --ths-shadow-2:       0 6px 16px rgba(16, 40, 38, 0.14);   /* floating: the quick-add button, sheets, popovers */

    /* ── Motion (defined; used sparingly) ────────────────────────────── */
    --ths-dur-fast:       150ms;     /* hovers, small state changes */
    --ths-dur-base:       250ms;     /* opening and closing */
    --ths-ease:           cubic-bezier(0.2, 0, 0, 1);
}

/* ── Dark theme (2026-11-19, testers): the colour names redefined. Set on <html data-theme="dark"> by
   wwwroot/js/theme.js (Settings → Application: System / Light / Dark, Light by default). The same values in
   C# are ThsTokens.Dark* (the MudBlazor dark palette). Sizes, radii and motion stay as they are. */
[data-theme="dark"] {
    color-scheme: dark;

    --ths-brand:          #2EC4BB;   /* a touch brighter on a dark ground */
    --ths-brand-hover:    #3AD3CA;
    --ths-brand-strong:   #5FD6CE;   /* teal as text: light enough to read on dark */
    --ths-brand-deep:     #A7EDE8;
    --ths-brand-pale:     #1E4A47;   /* "on the way" bars */
    --ths-brand-tint:     #163532;   /* teal wash */

    --ths-ok:             #2EC4BB;
    --ths-ok-text:        #5FD6CE;
    --ths-low:            #F5A524;
    --ths-low-tint:       #3A2C0E;
    --ths-low-text:       #FCD58A;
    --ths-over:           #F05252;
    --ths-over-tint:      #3E1719;
    --ths-over-text:      #FCA5A5;
    --ths-neutral:        #56646A;

    --ths-text:           #E6EDEC;
    --ths-text-2:         #A3B1AF;
    --ths-text-3:         #6E7D7B;
    --ths-text-on-brand:  #FFFFFF;
    --ths-bg:             #0E1514;   /* page background */
    --ths-surface:        #18211F;   /* cards */
    --ths-line:           #2B3735;
    --ths-track:          #253230;
    --ths-line-soft:      rgba(255, 255, 255, 0.09);
    --ths-wash:           rgba(255, 255, 255, 0.05);
    --ths-line-input:     rgba(255, 255, 255, 0.28);

    --ths-protein:        #9B7BE8;
    --ths-carbs:          #5B99E6;
    --ths-fat:            #E57AA9;
    --ths-fibre:          #4CC073;
    --ths-salt:           #8B9BB3;
    --ths-water:          #8DBCEB;
    --ths-nova-1:         #2EC4BB;
    --ths-nova-2:         #3F8D88;
    --ths-nova-3:         #56646A;
    --ths-nova-4:         #E57373;

    --ths-shadow-1:       0 1px 3px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3);
    --ths-shadow-2:       0 6px 16px rgba(0, 0, 0, 0.55);
}

@media (prefers-reduced-motion: reduce) {
    :root { --ths-dur-fast: 0ms; --ths-dur-base: 0ms; }
}
