@charset "UTF-8";
/**
 * MLS Genie — Design Tokens
 *
 * Single source of truth for all brand and UI colors, spacing, and scale.
 * Every other MLSG stylesheet declares this as a dependency and references
 * these vars — no raw hex values in component files.
 *
 * Structure:
 *   1. Brand — Teal (primary), Navy (secondary), and derived highlight tints
 *   2. Text
 *   3. Surfaces
 *   4. Borders
 *   5. Status — Danger, Success, Warning, Info, Purple
 *   6. WordPress admin palette
 *   7. Google sign-in (brand-locked)
 *   8. Scale / misc
 *
 * @package MLS_Genie
 * @since   1.3.43
 */

:root {

    /* -------------------------------------------------------------------------
       1. BRAND
       Three core brand colors: Teal (primary action), Navy (secondary/text),
       and Neutral. All interactive highlights are derived from Teal.
    -------------------------------------------------------------------------- */

    /* -- Teal: primary action, links, interactive highlights -- */
    --mlsg-teal:              #0d76b4;  /* primary — 4.48:1 on white before, now AA */
    --mlsg-teal-dark:         #0d6da3;  /* hover / pressed state                  */
    --mlsg-teal-deeper:       #0a5a8a;  /* deep emphasis / active border          */
    --mlsg-teal-bg:           #f2f9fe;  /* teal-tinted surface (selected, hover)  */
    --mlsg-teal-bg-light:     #f7fbff;  /* lightest teal tint (subtle highlight)  */
    --mlsg-teal-border:       #b3d9f0;  /* teal-tinted border                     */

    /* -- Brand highlight tints (derived from teal, for selections/focus) -- */
    --mlsg-highlight-bg:      #e8f4fb;  /* selected row, active card bg           */
    --mlsg-highlight-border:  #7ec4e8;  /* focused input, selected border         */
    --mlsg-highlight-text:    #107dbd;  /* highlighted text / active label        */

    /* -- Search-hit mark (amber; distinct from teal links) -- */
    --mlsg-search-hit-bg:     #fffbeb;  /* matched-text background (warning-50)    */
    --mlsg-search-hit-text:   #92400e;  /* matched-text color (warning-800)        */
    --mlsg-search-hit-border: #f5d99a;  /* subtle mark outline                     */

    /* -- Navy: secondary brand, headings, deep surfaces -- */
    --mlsg-navy:              #1a2633;  /* primary brand navy / heading text      */
    --mlsg-navy-deep:         #0f172a;  /* shell / PWA deep background            */
    --mlsg-navy-mid:          #1e293b;  /* mid-depth surface                      */

    /* -- Tooltips -- */
    --mlsg-tooltip-bg:        rgba(26, 38, 51, .92);  /* navy, so a tip reads as part of the brand */
    --mlsg-tooltip-text:      #ffffff;
    --mlsg-tooltip-shadow:    0 2px 10px rgba(15, 23, 42, .25);

    /* -------------------------------------------------------------------------
       2. TEXT
       Five-step scale from primary to faint. Use the step that matches
       the visual weight needed — avoid adding new steps.
    -------------------------------------------------------------------------- */

    --mlsg-text:              #111827;  /* primary — headings, strong body        */
    --mlsg-text-medium:       #374151;  /* secondary — body copy, field values    */
    --mlsg-text-secondary:    #4b5563;  /* tertiary — labels, captions            */
    --mlsg-text-dark:         #1e293b;  /* headings and strong body copy          */
    --mlsg-text-muted:        #535a68;  /* muted — was 3.28:1 on a light border    */
    --mlsg-text-subtle:       #606773;  /* subtle — was 2.05:1 on a light border   */
    --mlsg-text-slate:        #58687f;  /* slate-tone utility (tags, breadcrumbs) */

    /* -------------------------------------------------------------------------
       3. SURFACES
       Page backgrounds, card surfaces, and inset areas.
    -------------------------------------------------------------------------- */

    --mlsg-white:             #ffffff;
    --mlsg-on-brand:          #ffffff;  /* always white — text on colored buttons/badges */
    --mlsg-bg:                #f9fafb;  /* standard page / card background        */
    --mlsg-bg-subtle:         #f6f7f9;  /* inset surface, striped rows            */
    --mlsg-bg-light:          #f1f5f9;  /* light slate surface                    */
    --mlsg-bg-slate:          #f8fafc;  /* slate-50, lightest surface             */
    --mlsg-bg-bare:           #fafafa;  /* near-white bare surface                */

    /* -------------------------------------------------------------------------
       4. BORDERS
    -------------------------------------------------------------------------- */

    --mlsg-border:            #dcdfe4;  /* standard border                        */
    --mlsg-border-light:      #d1d5db;  /* light separator / table rule           */
    --mlsg-border-medium:     #e2e8f0;  /* form field border                      */
    --mlsg-border-slate:      #cbd5e1;  /* slate-300, subtle divider              */

    /* -------------------------------------------------------------------------
       4a. LEAD HEAT
       The four tiers MLSG_Lead_Score assigns: hot, warm, cool, cold.

       They were styled independently in four places and disagreed. The Leads
       list carried all four; lead detail and the pipeline carried three and
       had no cool at all. Warm was --mlsg-warning in two files and
       --mlsg-warning-accent in a third. Cold was gray on the list and blue
       everywhere else. Two tooltip values were raw hex.

       Named for the tier rather than mapped onto danger/warning/info, because
       a cold lead is not an error and a hot one is not a failure — reusing
       the semantic ramps is what let them drift apart.

       Each tier has a text color for a label or an icon, and a surface for
       the badge it sits in. The text value is the one that has to carry
       contrast; every pair is at least 4.5:1.
    -------------------------------------------------------------------------- */

    --mlsg-heat-hot:          #b91c1c;  /* 5.91:1 on --mlsg-heat-hot-bg           */
    --mlsg-heat-hot-bg:       #fef2f2;
    --mlsg-heat-warm:         #92400e;  /* 6.84:1 on --mlsg-heat-warm-bg          */
    --mlsg-heat-warm-bg:      #fffbeb;
    --mlsg-heat-cool:         #0d6da3;  /* 5.23:1 on --mlsg-heat-cool-bg          */
    --mlsg-heat-cool-bg:      #eff8fd;
    --mlsg-heat-cold:         #4b5563;  /* 6.87:1 on --mlsg-heat-cold-bg          */
    --mlsg-heat-cold-bg:      #f3f4f6;

    /* -------------------------------------------------------------------------
       4b. SHELL TOKENS — light mode (default)
       Used ~98 times across genie-crm.css / genie-crm-shell.css / GeniePortal
       templates. Only had dark-mode values (see body.mlsg-shell.mlsg-dark
       below) — with no light-mode definition at all, every one of those
       declarations was silently falling back to inherited/browser-default
       styling in the (default) light mode, which is why plain links and
       muted text were rendering as the browser's stock blue instead of any
       intended color. Aliased to the existing light-mode --mlsg-* tokens
       above rather than new values, so this can't drift from them.
    -------------------------------------------------------------------------- */

    --shell-bg:               var(--mlsg-bg-slate);
    --shell-surface:          var(--mlsg-white);
    --shell-text:             var(--mlsg-text);
    --shell-text-muted:       var(--mlsg-text-muted);
    --shell-muted:            var(--mlsg-text-slate);
    --shell-border:           var(--mlsg-border-medium);
    --shell-danger:           var(--mlsg-danger);
    --shell-brand:            var(--mlsg-teal);
    --shell-brand-dark:       var(--mlsg-teal-dark);
    --shell-brand-soft:       var(--mlsg-teal-bg);
    --shell-transition:       0.15s ease;


    /* -------------------------------------------------------------------------
       5. STATUS COLORS
       Semantic colors for system states. Each status has a full set:
       text (dark), action (base), background (bg), border.
    -------------------------------------------------------------------------- */

    /* -- Danger -- */
    --mlsg-danger:            #d31f1f;  /* error text — 4.7:1 on its own surface   */
    --mlsg-danger-dark:       #b91c1c;  /* hover / pressed danger                 */
    --mlsg-danger-bg:         #fef2f2;  /* danger surface                         */
    --mlsg-danger-bg-lt:      #fff5f5;  /* lightest danger surface                */
    --mlsg-danger-border:     #fecaca;  /* danger border                          */

    /* -- Success -- */
    --mlsg-success:           #007e51;  /* success text — was 3.58:1 on its surface */
    --mlsg-success-dark:      #065f46;  /* hover / pressed success                */
    --mlsg-success-bg:        #ecfdf5;  /* success surface (emerald-50)           */
    --mlsg-success-bg-mid:    #d1fae5;  /* mid success surface (emerald-100)      */
    --mlsg-success-border:    #86efac;  /* success border                         */

    /* -- Warning -- */
    --mlsg-warning:           #9c3b00;  /* warning text — was 3.48:1 on its border  */
    --mlsg-warning-dark:      #92400e;  /* hover / pressed warning (amber-800)    */
    --mlsg-warning-accent:    #dba617;  /* warning accent / admin border          */
    --mlsg-warning-bg:        #fffbeb;  /* warning surface (amber-50)             */
    --mlsg-warning-border:    #fcd34d;  /* warning border (amber-300)             */

    /* -- Info --
       Points at the brand teal rather than a separate blue. It used to be its
       own generic blue ramp (#1f5de5 and friends), which put a second, unrelated
       blue next to the teal on any screen using both — the GenieScout feature
       pills were the clearest example. Informational is a tone of the brand
       color here, not a color of its own.

       Contrast, measured: teal on white 4.92:1, teal on the info surface
       4.63:1, deep teal on white 7.39:1 — all clear AA for body text. */
    --mlsg-info:              var(--mlsg-teal);         /* info text            */
    --mlsg-info-dark:         var(--mlsg-teal-dark);    /* hover / pressed      */
    --mlsg-info-deep:         var(--mlsg-teal-deeper);  /* deep info text       */
    --mlsg-info-bg:           var(--mlsg-teal-bg);      /* info surface         */
    --mlsg-info-bg-deep:      var(--mlsg-teal-bg-light);/* mid info surface     */
    --mlsg-info-border:       var(--mlsg-teal-border);  /* info border          */

    /* -- Purple (drip campaigns, scheduled states) -- */
    --mlsg-purple:            #6b21a8;  /* purple text / icon                     */
    --mlsg-purple-bg:         #f3e8ff;  /* purple surface                         */
    --mlsg-purple-border:     #d8b4fe;  /* purple border                          */

    /* -------------------------------------------------------------------------
       6. WORDPRESS ADMIN PALETTE
       Used only in admin-scoped stylesheets. Do not use in frontend shell.
    -------------------------------------------------------------------------- */

    --mlsg-wp-border:         #dcdcde;
    --mlsg-wp-border-lt:      #ccd0d4;
    --mlsg-wp-text:           #1d2327;
    --mlsg-wp-text-dark:      #23282d;
    --mlsg-wp-muted:          #50575e;
    --mlsg-wp-separator:      #444444;
    --mlsg-wp-red:            #d63638;
    --mlsg-wp-green:          #00a32a;
    --mlsg-wp-blue:           #72aee6;

    /* -------------------------------------------------------------------------
       7. GOOGLE SIGN-IN
       Brand-locked — do not change these values.
    -------------------------------------------------------------------------- */

    --mlsg-google-text:       #3c4043;
    --mlsg-google-border:     #dadce0;
    --mlsg-google-blue:       #0284c7;

    /* -------------------------------------------------------------------------
       8. SCALE / MISC
    -------------------------------------------------------------------------- */

    /* Font scale — set by JS from localStorage, applied via zoom on shell content.
       small = 1 (default), medium = 1.25, large = 1.5                           */
    --mlsg-font-scale: 1;

    /* --------------------------------------------------------------------------
       9. DRAWERS
    -------------------------------------------------------------------------- */

    /* Every slide-in drawer — edit lead, commission, settings, help — sits inset
       from the viewport edge rather than flush against it, with its corners
       rounded. Flush to the edge, a drawer reads as a second window bolted onto
       the browser; inset, it reads as a panel over the page you are still in,
       which is what it is. Applies at every size: on a phone the inset is what
       keeps the page visible behind it.

       Defined once here so the four drawers cannot drift apart.               */
    --mlsg-drawer-inset:  1rem;
    --mlsg-drawer-radius: 1rem;
    --mlsg-drawer-shadow: 0 8px 32px rgba(15, 23, 42, 0.18);
    --mlsg-drawer-scrim:  rgba(15, 23, 42, 0.35);  /* page dimmed behind a drawer */

}

/* =============================================================================
   DARK MODE TOKEN OVERRIDES
   Applied when <body> carries .mlsg-dark (set via JS, stored in localStorage
   under key 'mlsg_theme').
   Only tokens that differ in dark mode are listed here.
============================================================================= */

body.mlsg-shell.mlsg-dark {

    /* Brand.

       The brand blue is a mid-tone: readable as text on white, but only about
       3.2:1 against a dark surface, which is why links and figures across the
       CRM measured as failures. Dark mode lifts it, and flips the text that
       sits ON a brand fill from white to near-black — white on the lifted blue
       would fail in the other direction. Both are measured, not eyeballed. */
    --mlsg-teal:              #5cb5e8;  /* 6.6:1 on the dark card surface */
    --mlsg-teal-dark:         #7cc6ef;  /* hover — lighter, not darker, in dark mode */
    --mlsg-teal-deeper:       #9bd5f4;
    --mlsg-on-brand:          #06121c;  /* near-black: 7.2:1 on the lifted brand blue */

    --mlsg-teal-bg:           #0d2d40;
    --mlsg-teal-bg-light:     #071e2b;
    --mlsg-teal-border:       #1a5a80;
    --mlsg-highlight-bg:      #0d2d40;
    --mlsg-highlight-border:  #1a6fa0;

    --mlsg-navy:              #e2e8f0;
    --mlsg-tooltip-bg:        rgba(226, 232, 240, .95);
    --mlsg-tooltip-text:      #0f172a;
    --mlsg-navy-deep:         #0f172a;
    --mlsg-navy-mid:          #1e293b;

    /* Text */
    --mlsg-text:              #f1f5f9;
    /* Was never declared in either block, so every rule using it fell back to
       the hardcoded slate and stayed unreadable in dark mode. */
    --mlsg-text-dark:         #f1f5f9;
    --mlsg-text-medium:       #cbd5e1;
    --mlsg-text-secondary:    #94a3b8;
    --mlsg-text-muted:        #a6b4c6;  /* 4.21:1 on --mlsg-border at #94a3b8 — lifted */
    --mlsg-text-subtle:       #a3b1c2;  /* 4.40:1 on --mlsg-bg-light at #7c8fa3 — lifted */
    --mlsg-text-slate:        #94a3b8;

    /* Dropdown chevrons for the dark surface. */
    --mlsg-select-chevron:       url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1.5 1.75l5.5 5.5 5.5-5.5' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    --mlsg-select-chevron-focus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1.5 1.75l5.5 5.5 5.5-5.5' fill='none' stroke='%235cb5e8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

    /* Surfaces */
    /* Card and panel surface. The shell used to carry its own literal here,
       one shade off this one, so a card styled from the base token and a card
       styled from the shell alias sat side by side in visibly different
       colors. One value now, aliased below rather than repeated. */
    --mlsg-white:             #1a2c3d;
    --mlsg-bg:                #0f172a;
    --mlsg-bg-subtle:         #1e293b;
    --mlsg-bg-light:          #1e293b;
    --mlsg-bg-slate:          #1e293b;
    --mlsg-bg-bare:           #172032;

    /* Borders */
    --mlsg-border:            #2d3f52;
    --mlsg-border-light:      #2d3f52;
    --mlsg-border-medium:     #2d3f52;
    --mlsg-border-slate:      #334155;

    /* Status — darkened surfaces for dark mode */
    /* Lead heat. Text lifts and the surface drops, the same way the semantic
       ramps do above — a tier color tuned for white is 3:1 or worse on a
       dark surface. */
    --mlsg-heat-hot:          #f87171;
    --mlsg-heat-hot-bg:       #2d1515;
    --mlsg-heat-warm:         #fbbf24;
    --mlsg-heat-warm-bg:      #2d1f05;
    --mlsg-heat-cool:         #7cc6ef;
    --mlsg-heat-cool-bg:      #0a2233;
    --mlsg-heat-cold:         #a3b1c2;
    --mlsg-heat-cold-bg:      #1e2937;

    --mlsg-danger:            #f87171;  /* red-400: 6.45:1 on dark bg */
    --mlsg-danger-bg:         #2d1515;
    --mlsg-danger-bg-lt:      #1f0d0d;
    --mlsg-danger-border:     #7f1d1d;
    --mlsg-danger-bg-lt:      #1f0d0d;

    --mlsg-success:           #6ee7b7;  /* emerald-300: 4.74:1 on dark bg */
    --mlsg-success-bg:        #052e1a;
    --mlsg-success-bg-mid:    #0a3d22;
    --mlsg-success-border:    #065f46;

    --mlsg-warning:           #fbbf24;  /* amber-400: 10.69:1 on dark bg */
    --mlsg-warning-bg:        #2d1f05;
    --mlsg-warning-border:    #78350f;

    /* Info tracks the brand teal in dark mode too, for the same reason it does
       in light: a separate blue sitting beside the teal reads as a second
       brand color. Surfaces are teal-tinted rather than blue-tinted so the
       text sits on its own hue. Measured: 7.16:1 on the surface, 6.35:1 on the
       deeper one. */
    --mlsg-info:              var(--mlsg-teal);
    --mlsg-info-bg:           #0a2233;
    --mlsg-info-bg-deep:      #102c3f;
    --mlsg-info-border:       #17557d;

    /* Hover/pressed variants are darker than their base in light mode, which
       inverts in dark mode — a darker shade on a dark surface is unreadable.
       They track the light variants here. */
    --mlsg-success-dark:      var(--mlsg-success);
    --mlsg-warning-dark:      var(--mlsg-warning);
    --mlsg-danger-dark:       var(--mlsg-danger);
    --mlsg-info-dark:         var(--mlsg-info);
    --mlsg-info-deep:         var(--mlsg-info);

    --mlsg-purple:            #c084fc;  /* purple-400: 6.76:1 on dark bg */
    --mlsg-purple-bg:         #1e0a35;
    --mlsg-purple-border:     #581c87;

    /* Shell-specific.

       These alias the tokens above exactly as they do in light mode. They
       were previously written as literals here, which is how they drifted:
       four of the five already matched their alias and the fifth did not,
       with nothing to catch it. Only the shell background genuinely differs
       from its light-mode source, and it says so.

       Anything that needs a card or panel surface should use
       --mlsg-white (or --shell-surface, which is the same value) — not a
       hardcoded color, and not one of the --mlsg-bg-* tokens, which are
       page and inset backgrounds rather than raised surfaces. */
    --shell-surface:          var(--mlsg-white);
    --shell-text:             var(--mlsg-text);
    --shell-muted:            var(--mlsg-text-slate);
    --shell-border:           var(--mlsg-border-medium);

    /* Deliberately not the light-mode source: the shell sits deeper than the
       page background in dark mode so raised surfaces read as raised. */
    --shell-bg:               #0f172a;

}


/* ── Accessibility ─────────────────────────────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Shared primitives ───────────────────────────────────────────────────
   Radius, elevation, spacing and brand aliases.

   These lived in mlsg-global-admin.css, which only loads on wp-admin
   screens. Everything outside wp-admin — the CRM shell, the client portal,
   listing templates — loads this file directly, so every reference to
   --mlsg-radius or --mlsg-shadow there resolved to nothing and quietly fell
   back to square corners and no shadow.

   Values are the originals from that file, so nothing in wp-admin shifts. */
:root {
	/* Controls. One height, one radius and one border for everything a
	   person clicks or types into. Buttons and form controls shared no
	   values, so each system arrived at its own — and two shell files
	   disagreed about the radius, one of them with !important, so side by
	   side they never lined up. */
	--mlsg-control-height: 36px;
	--mlsg-control-radius: 8px;
	--mlsg-control-border: 1px;
	/* A form control keeps 16px text for iOS, a button does not have a
	   border, and both must finish at --mlsg-control-height. Two padding
	   values, one resulting height. */
	--mlsg-control-pad-y:  7px;   /* inputs and selects: 16px text + border */
	--mlsg-control-pad-y-btn: 8px;
	--mlsg-control-pad-x:  12px;

	/* Dropdowns (2026-11-22, style A — inset chevron). One look for every
	   select MLS Genie draws: a medium-weight chevron set in from the edge,
	   with room on the right so the text never runs under it. The chevron
	   turns brand blue on focus. An SVG cannot read a custom property, so
	   each colour is its own image; the dark theme swaps them below. */
	--mlsg-select-chevron:       url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1.5 1.75l5.5 5.5 5.5-5.5' fill='none' stroke='%234b5563' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	--mlsg-select-chevron-focus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1.5 1.75l5.5 5.5 5.5-5.5' fill='none' stroke='%23107dbd' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	--mlsg-select-chevron-size:  0.875rem 0.5625rem;
	--mlsg-select-inset:         1rem;   /* chevron to the right edge   */
	--mlsg-select-pad-end:       3rem;   /* text to the right edge      */

	--mlsg-radius: 10px;
	--mlsg-radius-sm: 8px;
	--mlsg-radius-pill: 999px;

	--mlsg-pad: 14px;
	--mlsg-gap: 20px;

	/* A spacing scale, so a number is chosen from a list rather than invented.
	   Every card body spaces its own children from --mlsg-space-card below,
	   which is what stops a new card arriving with everything jammed together
	   because somebody forgot to add margins. */
	--mlsg-space-1: 4px;
	--mlsg-space-2: 8px;
	--mlsg-space-3: 14px;
	--mlsg-space-4: 20px;
	--mlsg-space-5: 28px;
	--mlsg-space-6: 40px;

	/* What a card puts between its children. Matches the margin the fields
	   carried before, so nothing moves — the difference is that it now applies
	   to everything in a card rather than to fields alone. */
	--mlsg-space-card: var(--mlsg-space-3);

	--mlsg-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
	--mlsg-shadow-lg: 0 4px 14px rgba(0, 0, 0, 0.08);
	--mlsg-focus: 0 0 0 3px rgba(16, 125, 189, 0.25);

	--mlsg-surface: var(--mlsg-white);
	--mlsg-brand: var(--mlsg-teal);
	--mlsg-brand-soft: rgba(16, 125, 189, 0.12);
	--mlsg-border-soft: rgba(0, 0, 0, 0.08);
}

/* ── Toast ────────────────────────────────────────────────────────────────
   The one toast in MLS Genie (toast standard, style A, 2.2.104): a card
   with the type's icon on the left, the message, a close button, and a bar
   along the top that runs out right to left while the toast is shown.
   Hover or focus pauses it. Failed messages have no bar and stay until
   closed. Colours come from the tokens above, so dark mode follows
   body.mlsg-dark on its own.

   Top centre, in the reading path, never touching a screen edge: 16px clear
   on both sides at any width, at most 440px wide.

   Declared on the toast itself, not :root, so the colour tokens they point
   at are read where dark mode redefines them. */
.mlsg-toast-region,
.mlsg-toast {
	--mlsg-toast-bg: var(--mlsg-white);
	--mlsg-toast-text: var(--mlsg-text);
	--mlsg-toast-close: var(--mlsg-text-muted);
	--mlsg-toast-accent: var(--mlsg-info, var(--mlsg-teal));
	--mlsg-toast-accent-success: var(--mlsg-success);
	--mlsg-toast-accent-error: var(--mlsg-danger);
	--mlsg-toast-accent-warning: var(--mlsg-warning);
	--mlsg-toast-radius: 12px;
	--mlsg-toast-shadow: 0 10px 30px rgba(15, 31, 51, 0.18);
	--mlsg-toast-gap: 0.875rem;
	--mlsg-toast-offset: 16px;
	--mlsg-toast-width: 440px;
	--mlsg-toast-z: 100000;
}
body.mlsg-shell.mlsg-dark .mlsg-toast { --mlsg-toast-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }

.mlsg-toast-region {
	position: fixed;
	top: calc(var(--mlsg-toast-offset) + env(safe-area-inset-top, 0px));
	left: max(var(--mlsg-toast-offset), env(safe-area-inset-left, 0px));
	right: max(var(--mlsg-toast-offset), env(safe-area-inset-right, 0px));
	max-width: var(--mlsg-toast-width);
	margin-inline: auto;
	z-index: var(--mlsg-toast-z);
	display: flex;
	flex-direction: column;
	gap: 0.625rem;
	pointer-events: none;
}

/* Inside the CRM the top bar is fixed: clear it. */
body.mlsg-shell .mlsg-toast-region {
	top: calc(var(--shell-topbar-h, 56px) + 12px);
}

.mlsg-toast {
	--mlsg-toast-c: var(--mlsg-toast-accent);
	position: relative;
	overflow: hidden;
	box-sizing: border-box;
	width: 100%;
	display: flex;
	align-items: center;
	gap: var(--mlsg-toast-gap);
	padding: 1.125rem 1rem 1rem 1.125rem;
	background: var(--mlsg-toast-bg);
	color: var(--mlsg-toast-text);
	font-size: 1rem;
	line-height: 1.45;
	border-radius: var(--mlsg-toast-radius);
	box-shadow: var(--mlsg-toast-shadow);
	pointer-events: auto;
	animation: mlsg-toast-in 0.22s ease;
}
.mlsg-toast--success { --mlsg-toast-c: var(--mlsg-toast-accent-success); }
.mlsg-toast--error   { --mlsg-toast-c: var(--mlsg-toast-accent-error); }
.mlsg-toast--warning { --mlsg-toast-c: var(--mlsg-toast-accent-warning); }

.mlsg-toast__icon { flex: 0 0 auto; font-size: 1.625rem; line-height: 1; color: var(--mlsg-toast-c); }
.mlsg-toast__msg  { flex: 1; min-width: 0; font-weight: 600; }

.mlsg-toast__close {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--mlsg-toast-close);
	font-size: 1.125rem;
	cursor: pointer;
}
.mlsg-toast__close:hover { color: var(--mlsg-toast-text); }
.mlsg-toast__close:focus-visible { outline: 2px solid var(--mlsg-teal); outline-offset: 2px; }

/* The time left, running out right to left. */
.mlsg-toast__bar {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 4px;
	background: var(--mlsg-toast-c);
	transform-origin: left center;
	animation: mlsg-toast-time var(--mlsg-toast-time, 5s) linear forwards;
}
.mlsg-toast:hover .mlsg-toast__bar,
.mlsg-toast:focus-within .mlsg-toast__bar { animation-play-state: paused; }

/* One button on a toast, such as Undo (2.1.1368). */
.mlsg-toast__action {
	flex: 0 0 auto;
	min-height: 2.25rem;
	padding: 0 0.75rem;
	font: inherit;
	font-weight: 600;
	color: var(--mlsg-teal-dark, var(--mlsg-teal));
	background: transparent;
	border: 1px solid currentColor;
	border-radius: var(--mlsg-radius-sm, 6px);
	cursor: pointer;
}
.mlsg-toast__action:hover { background: var(--mlsg-teal-bg, transparent); }
.mlsg-toast__action:focus-visible { outline: 2px solid var(--mlsg-teal); outline-offset: 2px; }

.mlsg-toast.is-leaving { animation: mlsg-toast-out 0.2s ease forwards; }

@keyframes mlsg-toast-in   { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes mlsg-toast-out  { to { opacity: 0; transform: translateY(-8px); } }
@keyframes mlsg-toast-time { from { transform: scaleX(1); } to { transform: scaleX(0); } }

@media (prefers-reduced-motion: reduce) {
	.mlsg-toast, .mlsg-toast.is-leaving { animation: none; }
}

/* ── Link color ─────────────────────────────────────────────────────────
   A default for links MLS Genie renders but has never given a color to.
   Without one the browser supplies its own — blue unvisited, purple once
   clicked — which is where the purple was coming from.

   Wrapped in :where() so the whole rule carries ZERO specificity. That is
   the point: an author rule always outranks the browser's default whatever
   its specificity, but this one loses to every rule in the plugin. So the
   navigation, cards, table links and everything else keep the colors their
   own components give them, and only genuinely unstyled links change.

   An earlier attempt set a:visited directly. Being a real selector it
   outranked those components, and every visited nav item turned teal.

   :any-link covers visited and unvisited in one selector, so the two states
   cannot drift apart later — which is the actual defect being fixed here,
   not the color itself.

   In application UI a visited link should look the same as an unvisited one.
   Distinguishing them helps in long documents and search results, where
   "have I read this?" is a real question. In a CRM it just looks broken.

   Worth knowing when testing: browsers restrict :visited for privacy. Only
   color properties may differ, and JavaScript is deliberately told the
   unvisited style, so this cannot be verified in code — only by looking. */
:where(body.mlsg-shell, body.mlsg-portal, .mlsg-wrap, [class^="mlsg-"], [class*=" mlsg-"]) :any-link {
	color: var(--mlsg-teal);
}
