/* Border-radius scale synced from the SuperControl v2 Design System Figma
   "border-radius" variable group (Light.tokens.json). MudBlazor's theme only
   exposes a single radius (--mud-default-borderradius, set via
   AppTheme.LayoutProperties.DefaultBorderRadius), so the rest of the scale
   lives here. Radii don't vary by theme mode, so a single :root block is used.
   Token name maps to the property: mud-lg-border-radius -> --sc-border-radius-lg. */
:root {
    --sc-border-radius-default: var(--mud-default-borderradius); /* 6px */
    --sc-border-radius-sm: 8px;
    --sc-border-radius-md: 10px;
    --sc-border-radius-lg: 12px;
    --sc-border-radius-xl: 14px;
    --sc-border-radius-2xl: 20px;
    --sc-border-radius-3xl: 28px;
    --sc-border-radius-4xl: 32px;
    --sc-border-radius-5xl: 36px;
    --sc-border-radius-6xl: 9999999px;
    --sc-yellow-50: #fefce8;
}

:root {
    --mud-palette-dark-hover: rgba(66, 66, 66, 0.01) !important;
}

@media (max-width: 960px) { /* < md (mobile) */
    body {
        --mud-drawer-width-left: min(320px, 100vw);
    }
}

@media (min-width: 1280px) { /* lg+ */
    body {
        --mud-drawer-width-left: 320px;
    }
}

/* Blazor WASM template leftovers. .valid/.invalid/.validation-message only apply to EditForm +
   InputBase; .blazor-error-boundary needs <ErrorBoundary>; .form-floating is Bootstrap. None of
   those exist in this app. Safe to delete in a later cleanup. */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

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

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

code {
    color: #c02d76;
}

.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;
}

/* A closed responsive/persistent drawer is slid off-canvas but kept display:flex,
   so its nav links stay in the keyboard tab order while invisible. Hide it once the
   slide-out finishes to keep hidden links out of the tab order (accessibility). */
.mud-drawer.mud-drawer-responsive.mud-drawer--closed:not(.mud-drawer-mini),
.mud-drawer.mud-drawer-persistent.mud-drawer--closed:not(.mud-drawer-mini) {
    visibility: hidden;
    transition: left 225ms cubic-bezier(0, 0, 0.2, 1), visibility 0s linear 225ms;
}

/* Text */
.fw-light { font-weight: 300; }
.fw-normal { font-weight: 400; }
.fw-medium { font-weight: 500; }
.fw-semibold { font-weight: 600; }
.fw-bold { font-weight: 700; }
.fst-italic { font-style: italic; }
.fst-normal { font-style: normal; }

/* Uppercase picker action buttons (Clear/Today/Cancel/OK). MudButton reads its
   text-transform from this token, which inherits to the buttons in the actions bar. */
.mud-picker-actions {
    --mud-typography-button-text-transform: uppercase;
}

/* MudBlazor auto-derives --mud-palette-*-hover from base × HoverOpacity and
   injects them at :root from a runtime <style> in <body>, so our overrides
   need !important to win the cascade. Values come from Figma light/dark
   variables (mud-palette-action-default-hover, mud-palette-tertiary-hover,
   mud-palette-warning-hover); Figma authored them as first-class tokens even
   though MudBlazor's Palette class exposes no matching slots.

   Dark solids match SC-v2 Unified Inbox guest/host bubbles.
   Scope them under .sc-theme-dark — MudBlazor does not put .mud-theme-dark on
   the document (that class is only a Mud color utility). Boot JS and
   ThemeModeService toggle .sc-theme-dark on html when IsDarkMode is true.

   action-default-hover (dark #0c212c) is the guest bubble fill. List row hover
   uses that token in light mode, and --mud-palette-surface in dark so it stays
   charcoal rather than navy.
   tertiary-hover (dark #282828) is the host bubble fill; the thread pane uses
   --mud-palette-background so those bubbles contrast.

   warning-hover stays on the light translucent value in both themes: the
   referenced Figma dark frame has no opaque dark warning-hover token. */
:root {
    --mud-palette-action-default-hover: #F5F5F5 !important;
    --mud-palette-tertiary-hover: rgba(119, 192, 67, 0.08) !important;
    --mud-palette-warning-hover: rgba(245, 158, 11, 0.06) !important;
}

.sc-theme-dark {
    --mud-palette-action-default-hover: #0c212c !important;
    --mud-palette-tertiary-hover: #282828 !important;
    --sc-yellow-50: #422006;
}

/* MudBlazor generates .mud-{color}-text only for base palette entries (primary,
   secondary, tertiary, …), not their -lighten/-darken shades. Extend that
   convention for the shade tokens we consume from razor. */
.mud-tertiary-darken-text {
    color: var(--mud-palette-tertiary-darken) !important;
}
.mud-error-darken-text {
    color: var(--mud-palette-error-darken) !important;
}
.mud-gray-lighter-text {
    color: var(--mud-palette-gray-lighter) !important;
}

/* Single-line ellipsis truncation (Bootstrap-style; MudBlazor ships no
   white-space/text-overflow utilities). Pairs with a flex parent that has min-width:0. */
.text-truncate {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Text-overflow ellipsis does not reliably truncate through an atomic inline-level box
   (e.g. MudTooltip's `.mud-tooltip-root.mud-tooltip-inline` wrapper, display:inline-block) —
   browsers may render the whole box or clip it as a unit instead of ellipsizing mid-text.
   Add this class to any ancestor element of ScTooltip's rendered root — this is a descendant
   selector, not an immediate-parent requirement, so it also works from a further-up wrapper
   (verified in a real browser: styling a wrapper span around ScTooltip's own text child does
   not work — the ellipsis owner must be MudTooltip's own root element). */
.tooltip-truncate .mud-tooltip-root.mud-tooltip-inline {
    display: block;
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* min-width:0 utility (MudBlazor ships no equivalent) — lets a flex/grid item shrink below
   its content's intrinsic width so overflow/ellipsis can engage. */
.min-w-0 {
    min-width: 0;
}

/* Text read by assistive technology but not shown (Bootstrap-style; MudBlazor ships no
   equivalent). Reach for this only where an ARIA name cannot be attached, such as a
   role-less element, where ARIA prohibits naming. Taken out of flow so it never widens
   its parent — components that measure rendered widths depend on that. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    white-space: nowrap;
    clip-path: inset(50%);
}

/* Vertically centre the alert icon against its message. MudBlazor top-aligns
   (.mud-alert-position { align-items: start }), which looks off-centre next to
   multi-line messages. Applied globally so every alert stays consistent. */
.mud-alert-position {
    align-items: center;
}

/* Font Awesome web-font glyphs have a ~1.25em advance width, which stretches
   MudBlazor's icon box wider than tall (and, in turn, shrink-wrapped icon buttons
   and icon badges). Re-assert a 1em square box and center the glyph so every icon
   stays square. Material SVG icons are already 1em square, so this is a no-op for
   them. */
.mud-icon-root {
    width: 1em;
    text-align: center;
}

/* Hide the native Chrome/Edge search ✕ on InputType.Search, which otherwise
   duplicates MudBlazor's Clearable button. MudBlazor 9.5 no longer emits a
   type-based class, so target the type="search" attribute it sets on the input. */
.mud-input input.mud-input-slot[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

/* Grid helpers (MudBlazor ships no equivalents). */
.col-start-1 {
    grid-column-start: 1;
}

.col-start-2 {
    grid-column-start: 2;
}

/* Extends MudBlazor's d-* display scale with `display: contents`, which MudBlazor
   doesn't ship. The element remains in the DOM while its box is removed from the
   layout tree, so children participate in the grandparent's flex/grid flow. */
.d-contents {
    display: contents;
}
