/* =========================================================================
   The site's component kit (inc/ui-kit.php): Web Awesome, in the site's colours.

   Web Awesome's own theme (vendor/webawesome-3.14.0/styles/themes/default.css) sets its tokens in a cascade
   layer on :where(:root), so anything outside a layer wins over it. Here they are set again to the site's own
   palette (Avada's global colours), so every component draws in navy, jade and white. The theme also gives
   :root a font and a colour inside its layer; Avada's own body rules are outside any layer and win, so the page
   does not change.

   Grey boxes and lines are the Teacher Dashboard's (css/teacher-dashboard.css :root, CLAUDE.md 4e "One grey,
   declared once"). The values after the commas are the same values, for a page without that stylesheet.
   ========================================================================= */
:root
{
    --lh-ui-soft: var( --lh-td-soft, rgba( 1, 47, 70, .04 ) );
    --lh-ui-line: var( --lh-td-line, rgba( 1, 47, 70, .12 ) );

    --wa-font-family-body: var( --body_typography-font-family );
    --wa-font-family-heading: var( --body_typography-font-family );
    --wa-color-text-normal: var( --awb-custom_color_1 );
    --wa-color-text-quiet: var( --awb-custom_color_12 );
    --wa-color-focus: var( --awb-custom_color_1 );
    --wa-color-surface-default: var( --awb-color1 );
    --wa-color-surface-border: var( --lh-ui-line );
    --wa-color-brand-fill-loud: var( --awb-custom_color_1 );
    --wa-color-brand-on-loud: var( --awb-color1 );
    --wa-color-brand-border-loud: var( --awb-custom_color_1 );
    --wa-color-brand-fill-normal: var( --awb-color2 );
    --wa-color-brand-on-normal: var( --awb-custom_color_1 );
    --wa-color-brand-border-normal: var( --awb-custom_color_4 );
    --wa-color-brand-fill-quiet: var( --lh-ui-soft );
    --wa-color-brand-on-quiet: var( --awb-custom_color_1 );
    --wa-color-brand-border-quiet: var( --lh-ui-line );
    --wa-color-neutral-fill-normal: var( --awb-color2 );
    --wa-color-neutral-on-normal: var( --awb-custom_color_1 );
    --wa-color-neutral-border-normal: var( --awb-custom_color_4 );
    --wa-color-neutral-fill-quiet: var( --lh-ui-soft );
    --wa-color-neutral-on-quiet: var( --awb-custom_color_12 );
    --wa-color-neutral-border-quiet: var( --lh-ui-line );
    --wa-color-neutral-border-loud: var( --awb-custom_color_4 );
    /* A control's edge at least 3:1 on white and on the amber tint: navy at 68% (the old grey was 1.4:1 on amber). */
    --wa-form-control-border-color: var( --awb-custom_color_4 );
    --wa-form-control-activated-color: var( --awb-custom_color_1 );
    --wa-border-radius-s: 8px;
    --wa-border-radius-m: 12px;
    --wa-border-radius-l: 14px;
}

/* hidden wins over every part's own display (CLAUDE.md 4d). */
.lh-ui-switch[hidden],
.lh-ui-check[hidden]
{
    display: none !important;
}

/* ----- The switch: the live switch's look (Ben, 2026-11-01), label left, switch right, help under the label ----- */
.lh-ui-switch
{
    --width: 46px;
    --height: 26px;
    --thumb-size: 18px;
    --wa-form-control-background-color: var( --awb-color1 );
    --wa-form-control-border-color: var( --awb-custom_color_1 );
    --wa-form-control-border-width: 2px;
    --wa-form-control-activated-color: var( --awb-color5 );
    display: flex;
    width: 100%;
}

/* Web Awesome turns the edge jade and the knob white when on; the live switch keeps both navy. */
.lh-ui-switch::part(control)
{
    border-color: var( --awb-custom_color_1 );
}

.lh-ui-switch::part(thumb)
{
    background-color: var( --awb-custom_color_1 );
}

.lh-ui-switch::part(base)
{
    flex-direction: row-reverse;
    justify-content: space-between;
    width: 100%;
    min-height: 44px;
}

.lh-ui-switch::part(label)
{
    margin: 0;
    font-size: 16px;
    line-height: 1.4;
    font-weight: 400;
    color: var( --awb-custom_color_1 );
}

.lh-ui-switch::part(hint)
{
    margin-top: -6px;
    font-size: 14px;
    line-height: 1.4;
    text-wrap: balance;
    color: var( --awb-custom_color_12 );
}

/* Its state in words beside the label: On or Off, whichever it is now. */
.lh-ui-state
{
    font-weight: 600;
    white-space: nowrap;
}

.lh-ui-switch:not( :state(checked) ) .lh-ui-on,
.lh-ui-switch:state(checked) .lh-ui-off
{
    display: none;
}

/* ----- The tick box ----- */
.lh-ui-check
{
    --wa-form-control-border-color: var( --awb-custom_color_4 );
}

/* The tick is drawn here, not by Web Awesome's icon, which it fetches: no request, and nothing to wait for. */
.lh-ui-check::part(checked-icon)
{
    display: none;
}

.lh-ui-check:state(checked)::part(control)
{
    background-image: url( "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E" );
    background-position: center;
    background-repeat: no-repeat;
    background-size: 80%;
}

/* ----- The label (lh_ui_badge()): its look is the chip's (.lh-td-fact, css/teacher-dashboard.css), on the badge
   itself, where Web Awesome draws its own background, padding and edge (measured 2026-11-04: they made a ring round
   the chip). Its own edge, weight and spacing are taken off so that rule is all that shows. ----- */
.lh-ui-badge
{
    display: inline-flex;
    border: 0;
    font-weight: inherit;
    letter-spacing: normal;
}

/* ----- The message box (lh_ui_callout()): the amber box is the Teacher Dashboard's (its tint and edge). ----- */
.lh-ui-callout
{
    --wa-color-warning-fill-quiet: var( --lh-td-warn-bg, rgba( 255, 183, 16, .12 ) );
    --wa-color-warning-border-quiet: var( --lh-td-warn-line, rgba( 255, 183, 16, .4 ) );
    --wa-color-warning-on-quiet: var( --awb-custom_color_1 );
    font-size: 15px;
    line-height: 1.4;
}

.lh-ui-callout[hidden],
.lh-ui-dialog[hidden]
{
    display: none !important;
}

/* ----- The dialog (lh_ui_dialog()) ----- */
.lh-ui-dialog
{
    --width: min( 480px, calc( 100vw - 32px ) );
}

.lh-ui-dialog::part(title)
{
    font-size: 20px;
    line-height: 1.4;
    font-weight: 500;
    color: var( --awb-custom_color_1 );
}

.lh-ui-dialog p
{
    margin: 0 0 12px;
    font-size: 16px;
    line-height: 1.4;
    color: var( --awb-custom_color_1 );
}

.lh-ui-dialog-acts
{
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}
