:root
{
    /*
     * -------------------------------------------------------------------------
     * Daily Rate design tokens
     * -------------------------------------------------------------------------
     * This file is the single source of truth for the visual language used by
     * the shell and every mini-app. Mini-app styles should consume these
     * variables rather than introducing local colours, shadows, radii or
     * repeated spacing values. Keeping those decisions here means a future
     * redesign can be made without hunting through individual applications.
     */

    /* Typography */
    --font-family-base: Helvetica, Arial, sans-serif;
    --font-size-body: 1rem;
    --font-size-small: 0.875rem;
    --font-size-tiny: 0.75rem;
    --font-size-heading-small: 1.25rem;
    --font-size-heading-medium: 1.5rem;
    --font-size-heading-large: clamp(1.75rem, 4vw, 2.25rem);
    --line-height-body: 1.6;
    --line-height-heading: 1.2;

    /* Core colours */
    --color-bg: #f9f9f7;
    --color-surface: var(--color-white);
    --color-surface-subtle: #f3f3f1;
    --color-surface-hover: #f5f5f1;
    --color-text: #1a1a1a;
    --color-muted: #6b6b6b;
    --color-border: #deded8;
    --color-border-strong: #2b2b2b;
    --color-accent: #ffd400;
    --color-accent-hover: #f2ca00;
    --color-accent-soft: #fff8cc;
    --color-accent-border: #dfbd00;
    --color-accent-text: #1a1a1a;
    --color-button-bg: var(--color-surface);
    --color-button-hover: var(--color-accent-soft);
    --color-button-border: #d8d8d1;
    --color-danger: #b33434;
    --color-danger-surface: #f1dddd;
    --color-success: #247a42;
    --color-success-surface: #e6f2e9;
    --color-success-transparent: rgb(40 100 58 / 12%);
    --color-warning: #8a5b08;
    --color-warning-transparent: rgb(180 115 12 / 14%);
    --color-danger-transparent: rgb(139 37 37 / 14%);
    --color-black: #000000;
    --color-white: #ffffff;
    --color-overlay: rgb(0 0 0 / 45%);
    --color-shadow: rgb(0 0 0 / 18%);
    --color-notification-text: var(--color-white);
    --color-notification-hover: rgb(255 255 255 / 18%);

    /* Layout */
    --sidebar-width: 12.5rem;
    --topbar-height: 3.5rem;
    --footer-height: 2.5rem;
    --content-max-width: 72rem;
    --mini-app-max-width: 84rem;
    --mini-app-min-height: 48rem; /* Keep workspaces usable on short desktop screens. */
    --viewport-padding-inline: var(--space-md); /* Shared by the page-header breakout. */
    --content-narrow-width: 44rem;
    --dialog-max-width: 34rem;
    --mobile-width: 50rem;
    --attendance-project-column-width: 16rem;
    --attendance-workspace-min-height: 28rem;
    --calendar-day-min-height: 6.5rem;
    --calendar-mobile-min-width: 38rem;
    --calendar-dialog-width: 42rem;
    --calendar-status-dot-size: 0.625rem;
    --calendar-month-label-width: 9rem;

    /* Spacing */
    --space-2xs: 0.25rem;
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;

    --padding-tiny: var(--space-2xs);
    --padding-half: var(--space-xs);
    --padding-standard: var(--space-sm);
    --padding-double: var(--space-lg);
    --padding-window-sides: var(--space-lg);
    --padding-app: var(--space-lg);

    /* Controls */
    --control-height: 2.5rem;
    --control-height-large: 3rem;
    --control-padding-y: 0.625rem;
    --control-padding-x: 0.875rem;
    --touch-target: 2.75rem;

    /* Radius and borders */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-pill: 999rem;
    --border-thin: var(--line-width) solid var(--color-border);
    --border-strong: var(--line-width) solid var(--color-border-strong);
    --border-button: var(--line-width) solid var(--color-button-border);

    /* Effects */
    --shadow-dialog: 0 1.125rem 3rem var(--color-shadow);
    --shadow-control: 0 0.125rem 0.35rem rgb(0 0 0 / 7%);
    --shadow-control-hover: 0 0.2rem 0.6rem rgb(0 0 0 / 9%);
    --transition-fast: 120ms ease;
    --loader-size: 3rem;
    --loader-border-width: 0.25rem;
    --notification-width: 26rem;
    --notification-close-size: 2.25rem;
    --header-icon-size: 2.5rem;
    --navigation-icon-size: 1.25rem;

    /* Compatibility aliases used by older mini-app styles. */
    --spacing-small: var(--space-xs);
    --spacing-medium: var(--space-sm);
    --spacing-large: var(--space-md);
    --radius-large: var(--radius-md);
    --radius-medium: var(--radius-md);
    --shadow-small: 0 0.35rem 1.2rem rgb(20 30 50 / 6%);
    --color-button-text: var(--color-accent-text);
}

html,
body
{
    margin: 0;
    padding: 0;
    width: 100%;
    min-width: 0;
    height: 100%;
}

html
{
    background: var(--color-bg);
}

body
{
    font-family: var(--font-family-base);
    font-size: var(--font-size-body);
    line-height: var(--line-height-body);
    background: var(--color-bg);
    color: var(--color-text);
}

*,
*::before,
*::after
{
    box-sizing: border-box;
}

button,
input,
select,
textarea
{
    font: inherit;
}

button,
input,
select,
textarea
{
    border-radius: var(--radius-sm);
}

input,
select,
textarea
{
    width: 100%;
    min-width: 0;
    padding: var(--control-padding-y) var(--control-padding-x);
    border: var(--border-thin);
    background: var(--color-surface);
    color: var(--color-text);
}

textarea
{
    resize: vertical;
}

button
{
    min-height: var(--control-height);
    padding: var(--control-padding-y) var(--control-padding-x);
    border: var(--border-button);
    background: var(--color-button-bg);
    color: var(--color-text);
    font-weight: 600;
    box-shadow: var(--shadow-control);
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

button:hover:not(:disabled)
{
    border-color: var(--color-accent-border);
    background: var(--color-button-hover);
    box-shadow: var(--shadow-control-hover);
    transform: translateY(-0.0625rem);
}

button:active:not(:disabled)
{
    box-shadow: var(--shadow-control);
    transform: translateY(0);
}

button:disabled
{
    cursor: default;
    opacity: 0.55;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible
{
    outline: 0.125rem solid var(--color-border-strong);
    outline-offset: 0.125rem;
}

a
{
    color: inherit;
}

h1,
h2,
h3
{
    line-height: var(--line-height-heading);
}

#application
{
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
}

#header
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 var(--topbar-height);
    gap: var(--space-sm);
    min-width: 0;
    padding: 0 var(--padding-window-sides);
    background: var(--color-surface);
    border-bottom: var(--border-thin);
}

#header-logo
{
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    min-width: 0;
    color: var(--color-text);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

#header-logo {
display: flex;
align-items: center;
gap: 0.5rem;
min-width: 0;
flex-shrink: 1;
}

#header-logo img {
display: block;
width: auto;
height: auto;
max-height: 48px;
max-width: min(160px, 35vw);
object-fit: contain;
flex-shrink: 1;
}

#header-logo .daily-rate-logo-text {
white-space: nowrap;
}

.daily-rate-logo-mark
{
    display: grid;
    place-items: center;
    width: 2.15rem;
    height: 2.15rem;
    flex: 0 0 2.15rem;
    overflow: hidden;
    border-radius: 0.65rem;
    background: var(--color-accent);
    box-shadow: inset 0 0 0 0.0625rem color-mix(in srgb, var(--color-accent-border) 70%, transparent);
}

.daily-rate-logo-mark svg
{
    width: 1.6rem;
    height: 1.6rem;
    fill: currentColor;
}

.daily-rate-logo-text
{
    font-size: 1.05rem;
    letter-spacing: -0.015em;
}

.daily-rate-logo-text strong
{
    font-weight: 800;
}



#header-account
{
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex-shrink: 0;
}

#header-actions
{
    display: flex;
    align-items: center;
    gap: var(--space-2xs);
}

#header-actions[hidden]
{
    display: none;
}

.header-icon-button
{
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--header-icon-size);
    height: var(--header-icon-size);
    min-height: var(--header-icon-size);
    padding: 0;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--color-muted);
    box-shadow: none;
    text-decoration: none;
}

.header-icon-button svg
{
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.header-icon-button:hover:not(:disabled),
a.header-icon-button:hover
{
    border-color: transparent;
    background: var(--color-surface-hover);
    color: var(--color-text);
    box-shadow: none;
    transform: none;
}

.header-icon-button[aria-current="page"]
{
    background: var(--color-accent-soft);
    color: var(--color-text);
}

.header-notification-badge
{
    position: absolute;
    top: 0.08rem;
    right: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.28rem;
    border: 0.125rem solid var(--color-surface);
    border-radius: var(--radius-pill);
    background: var(--color-danger);
    color: var(--color-white);
    font-size: 0.66rem;
    font-weight: 800;
    line-height: 1;
}

.header-notification-badge[hidden]
{
    display: none;
}

#login-panel
{
    display: flex;
    align-items: center;
}

#application-body
{
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
}

#navigation
{
    position: sticky;
    top: 0;
    align-self: stretch;
    width: var(--sidebar-width);
    height: 100%;
    flex: 0 0 var(--sidebar-width);
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    background: var(--color-surface);
    border-right: var(--border-thin);
}

#navigation-menu
{
    display: flex;
    flex-direction: column;
}

#navigation-menu
{
    gap: var(--space-2xs);
    padding: var(--space-xs);
}

#navigation-menu a
{
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    min-height: var(--touch-target);
    padding: var(--padding-half) var(--padding-standard);
    border-radius: var(--radius-sm);
    color: var(--color-muted);
    text-decoration: none;
    transition: background var(--transition-fast), color var(--transition-fast);
}

#navigation-menu a:hover
{
    background: var(--color-surface-hover);
    color: var(--color-text);
}

#navigation-menu a[aria-current="page"]
{
    background: var(--color-accent-soft);
    color: var(--color-text);
    font-weight: 700;
}

.navigation-icon
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--navigation-icon-size);
    height: var(--navigation-icon-size);
    flex: 0 0 var(--navigation-icon-size);
}

.navigation-icon svg
{
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.navigation-label
{
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#viewport
{
    position: relative;
    container-name: dr-mini-app-viewport;
    container-type: inline-size;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    /* This is a vertical workspace. Keep horizontal scroll tracks disabled;
       responsive children must fit the available content column instead. */
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
    padding: var(--viewport-padding-inline);
    background: var(--color-bg);
}

/*
 * Every routed mini-app now occupies the same centred content frame. Individual
 * apps can still use narrower cards/forms internally, but the application
 * viewport itself no longer changes width between routes.
 */
#viewport > :not(.router-loader)
{
    width: min(100%, var(--mini-app-max-width));
    /* The viewport scrolls; the page is never squashed to a short monitor. */
    min-height: var(--mini-app-min-height);
    margin-inline: auto;
}

/* Messages uses a height-constrained grid with its own inner scroll areas.
 * Give that grid the same minimum height without its old max-height: 100%
 * preventing the outer viewport from scrolling on short monitors. */
#viewport > .messages-app
{
    height: max(100%, var(--mini-app-min-height));
    max-height: none;
}

/*
 * Older mini-apps supplied their own outer page padding. The viewport now owns
 * that gutter so switching routes does not make content jump left or right.
 */
#viewport > .accounts-app,
#viewport > .bookings-app,
#viewport > .users-page,
#viewport > .login-container,
#viewport > .registration-app,
#viewport > .verification-app
{
    padding: 0;
}

.header-icon-static
{
    pointer-events: none;
}

.money-positive
{
    color: var(--color-success) !important;
}

.money-negative
{
    color: var(--color-danger) !important;
}

/*
 * -------------------------------------------------------------------------
 * Router loading state
 * -------------------------------------------------------------------------
 * The router keeps this overlay mounted while a mini-app is being fetched and
 * while its initial render() promise is still running. All incoming app markup
 * is present in the live DOM underneath the overlay so the mini-app can bind
 * listeners and populate data normally, but visibility is withheld until the
 * router knows that initial rendering has completed.
 */
#viewport.router-loading
{
    overflow: hidden;
}

#viewport.router-loading > :not(.router-loader)
{
    visibility: hidden;
}

.router-loader
{
    position: absolute;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    min-width: 0;
    min-height: 100%;
    padding: var(--space-lg);
    background: var(--color-bg);
    color: var(--color-text);
}

.router-loader-spinner
{
    width: var(--loader-size);
    height: var(--loader-size);
    flex: 0 0 var(--loader-size);
    border: var(--loader-border-width) solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: var(--radius-pill);
    animation: router-loader-spin 0.8s linear infinite;
}

.router-loader-copy
{
    min-width: 0;
}

.router-loader-title
{
    font-weight: 700;
    line-height: var(--line-height-heading);
}

.router-loader-message
{
    margin-top: var(--space-2xs);
    color: var(--color-muted);
    font-size: var(--font-size-small);
}

#viewport.router-view-visible > *
{
    animation: router-view-reveal 160ms ease-out;
}

@keyframes router-loader-spin
{
    to
    {
        transform: rotate(360deg);
    }
}

@keyframes router-view-reveal
{
    from
    {
        opacity: 0;
        transform: translateY(0.25rem);
    }

    to
    {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce)
{
    .router-loader-spinner,
    #viewport.router-view-visible > *
    {
        animation: none;
    }
}


/*
 * -------------------------------------------------------------------------
 * Global action notifications
 * -------------------------------------------------------------------------
 * The notification stack sits outside #viewport, so router navigation cannot
 * destroy a message before the user has read it. Desktop places the stack in
 * the lower-right corner while narrow screens allow it to span the available
 * width above the viewport edge. Pointer events remain disabled on the empty
 * stack itself and are restored only on actual notifications, preventing the
 * invisible container from blocking controls beneath it.
 */
.notification-stack
{
    position: fixed;
    right: var(--space-md);
    bottom: var(--space-md);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-xs);
    width: min(var(--notification-width), calc(100% - (2 * var(--space-md))));
    pointer-events: none;
}

.notification
{
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
    min-width: 0;
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    color: var(--color-notification-text);
    box-shadow: var(--shadow-dialog);
    pointer-events: auto;
    animation: notification-enter 220ms ease-out both;
}

.notification-success
{
    background: var(--color-success);
}

.notification-error
{
    background: var(--color-danger);
}

.notification-message
{
    min-width: 0;
    font-size: var(--font-size-small);
    font-weight: 600;
    line-height: var(--line-height-heading);
    overflow-wrap: anywhere;
}

.notification-close
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--notification-close-size);
    height: var(--notification-close-size);
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: inherit;
    font-size: var(--font-size-heading-small);
    line-height: 1;
}

.notification-close:hover:not(:disabled)
{
    background: var(--color-notification-hover);
}

.notification-close:focus-visible
{
    outline-color: currentColor;
}

.notification-leaving
{
    animation: notification-leave 220ms ease-in both;
}

@keyframes notification-enter
{
    from
    {
        opacity: 0;
        transform: translateY(var(--space-sm));
    }

    to
    {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes notification-leave
{
    from
    {
        opacity: 1;
        transform: translateY(0);
    }

    to
    {
        opacity: 0;
        transform: translateY(var(--space-xs));
    }
}

@media (prefers-reduced-motion: reduce)
{
    .notification,
    .notification-leaving
    {
        animation-duration: 1ms;
    }
}

@media (max-width: 30rem)
{
    .notification-stack
    {
        right: var(--space-sm);
        bottom: var(--space-sm);
        width: calc(100% - (2 * var(--space-sm)));
    }
}


/*
 * HTML hidden is authoritative across all mini-apps. Shared component rules
 * such as display:flex/grid must never accidentally reveal hidden controls.
 */
[hidden]
{
    display: none !important;
}

/*
 * -------------------------------------------------------------------------
 * Shared Daily Rate UI components
 * -------------------------------------------------------------------------
 * Reusable mini-app building blocks live here rather than in individual
 * application stylesheets. New mini-apps should compose these dr-* classes
 * before introducing page-specific CSS. This keeps forms, cards, buttons,
 * status pills, dialogs, stacks and responsive behaviour consistent site-wide.
 */
.dr-page
{
    width: 100%;
    max-width: var(--mini-app-max-width);
    min-width: 0;
    margin-inline: auto;
}

.dr-header,
.dr-section-heading,
.dr-dialog-header,
.dr-panel-heading,
.dr-actions,
.dr-form-actions
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
}

.dr-header
{
    margin-bottom: var(--space-lg);
}

.dr-header h1,
.dr-section-heading h2,
.dr-dialog-header h2,
.dr-panel h2
{
    margin: 0;
}

.dr-header p,
.dr-section-heading p
{
    margin: var(--space-2xs) 0 0;
    color: var(--color-muted);
}

.dr-kicker
{
    margin: 0 0 var(--space-2xs) !important;
    color: var(--color-muted);
    font-size: var(--font-size-tiny);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}











.dr-tabs
{
    display: flex;
    gap: var(--space-2xs);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-xs);
    overflow-x: auto;
    border-bottom: var(--border-thin);
}

.dr-tab
{
    white-space: nowrap;
    box-shadow: none;
}

.dr-tab-active
{
    border-color: var(--color-border-strong);
    background: var(--color-accent-soft);
}

.dr-panel
{
    min-width: 0;
    padding: var(--space-md);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.dr-panel-plain
{
    min-width: 0;
}

.dr-form,
.dr-stack,
.dr-team
{
    display: grid;
    gap: var(--space-md);
}

.dr-form
{
    margin-top: var(--space-md);
}

.dr-form-compact
{
    margin-top: 0;
}

.dr-form label,
.dr-filter-bar label
{
    display: grid;
    gap: var(--space-2xs);
    font-weight: 600;
}

.dr-form label span,
.dr-filter-bar label span
{
    font-size: var(--font-size-small);
}

.dr-form-row
{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-sm);
}

.dr-check
{
    display: flex !important;
    align-items: center;
}

.dr-check input
{
    width: auto;
}

.dr-help,
.dr-form small
{
    margin: 0;
    color: var(--color-muted);
    font-size: var(--font-size-small);
    font-weight: 400;
}

.dr-filter-bar
{
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: var(--space-sm);
    align-items: end;
    padding: var(--space-md);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.dr-summary
{
    margin: var(--space-md) 0 var(--space-sm);
    color: var(--color-muted);
}

.dr-grid
{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
    gap: var(--space-sm);
}

.dr-card,
.dr-member-card
{
    min-width: 0;
    padding: var(--space-md);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.dr-card
{
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.dr-member-card
{
    display: grid;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background: var(--color-surface-subtle);
}

.dr-card h3,
.dr-card p
{
    margin: 0;
}

.dr-card-description
{
    color: var(--color-muted);
}

.dr-meta,
.dr-tags,
.dr-card-footer,
.dr-badges
{
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    align-items: center;
}

.dr-meta
{
    color: var(--color-muted);
    font-size: var(--font-size-small);
}

.dr-card-footer
{
    justify-content: space-between;
    margin-top: auto;
}

.dr-pill
{
    display: inline-flex;
    align-items: center;
    min-height: 1.8rem;
    padding: var(--space-2xs) var(--space-xs);
    border-radius: var(--radius-pill);
    background: var(--color-surface-subtle);
    font-size: var(--font-size-tiny);
    font-weight: 700;
}

.dr-status-open,
.dr-status-in_progress,
.dr-status-negotiating
{
    background: var(--color-accent-soft);
}

.dr-status-accepted,
.dr-status-completed
{
    background: var(--color-success-surface);
    color: var(--color-success);
}

.dr-status-declined,
.dr-status-withdrawn,
.dr-status-cancelled
{
    background: var(--color-danger-surface);
    color: var(--color-danger);
}

.dr-link,
.dr-back-link
{
    font-weight: 700;
    text-decoration: none;
}

.dr-link:hover
{
    text-decoration: underline;
}

.dr-back-link
{
    display: inline-block;
    margin-bottom: var(--space-md);
    color: var(--color-muted);
}

.dr-back-link:hover
{
    color: var(--color-text);
}

.dr-empty
{
    grid-column: 1 / -1;
    padding: var(--space-lg);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-muted);
    text-align: center;
}

.dr-section-spaced
{
    margin-top: var(--space-xl);
}

.dr-dialog
{
    width: min(calc(100% - 2rem), var(--content-narrow-width));
    max-height: calc(100dvh - 2rem);
    padding: 0;
    border: var(--border-thin);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-dialog);
}

.dr-dialog::backdrop
{
    background: var(--color-overlay);
}

.dr-dialog .dr-form
{
    margin-top: 0;
    padding: var(--space-lg);
}

.dr-layout-sidebar
{
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 21rem);
    gap: var(--space-md);
    align-items: start;
}

.dr-main-stack
{
    display: grid;
    gap: var(--space-md);
    min-width: 0;
}

.dr-sticky-side
{
    position: sticky;
    top: var(--space-sm);
}

.dr-description
{
    margin: 0 0 var(--space-md);
    white-space: pre-wrap;
}

.dr-person
{
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.dr-avatar
{
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    flex: 0 0 3rem;
    border-radius: var(--radius-pill);
    background: var(--color-accent);
    font-weight: 800;
}

.dr-person h3,
.dr-person p
{
    margin: 0;
}

.dr-person p
{
    color: var(--color-muted);
    font-size: var(--font-size-small);
}

.dr-offers
{
    display: grid;
    gap: var(--space-xs);
}

.dr-offer
{
    padding: var(--space-xs) var(--space-sm);
    border-left: 0.2rem solid var(--color-border);
    background: var(--color-surface);
}

.dr-offer p
{
    margin: 0;
}

.dr-offer-meta
{
    color: var(--color-muted);
    font-size: var(--font-size-tiny);
}

.dr-inline-form
{
    display: grid;
    grid-template-columns: minmax(8rem, 0.6fr) minmax(0, 1fr) auto;
    gap: var(--space-xs);
    align-items: end;
}

.dr-inline-actions
{
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.dr-messages
{
    display: grid;
    gap: var(--space-xs);
    max-height: 28rem;
    margin: var(--space-md) 0;
    overflow-y: auto;
}

.dr-message
{
    max-width: 85%;
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    background: var(--color-surface-subtle);
}

.dr-message-own
{
    justify-self: end;
    background: var(--color-accent-soft);
}

.dr-message-header
{
    margin-bottom: var(--space-2xs);
    color: var(--color-muted);
    font-size: var(--font-size-tiny);
    font-weight: 700;
}

.dr-message-body
{
    margin: 0;
    white-space: pre-wrap;
}

.dr-message-form
{
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-xs);
    align-items: end;
}

@media (max-width: 58rem)
{
    .dr-filter-bar
    {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dr-layout-sidebar
    {
        grid-template-columns: 1fr;
    }

    .dr-sticky-side
    {
        position: static;
    }
}

@media (max-width: 42rem)
{
    .dr-header,
    .dr-section-heading,
    .dr-dialog-header,
    .dr-panel-heading,
    .dr-actions,
    .dr-form-actions
    {
        align-items: stretch;
        flex-direction: column;
    }

    .dr-filter-bar,
    .dr-form-row,
    .dr-inline-form,
    .dr-message-form
    {
        grid-template-columns: 1fr;
    }

    .dr-message
    {
        max-width: 100%;
    }
}

#footer
{
    display: flex;
    align-items: center;
    flex: 0 0 var(--footer-height);
    min-width: 0;
    padding: 0 var(--padding-window-sides);
    background: var(--color-surface);
    border-top: var(--border-thin);
    color: var(--color-muted);
    font-size: var(--font-size-small);
}

/*
 * Shared pagination styling lives with the application shell because the
 * pagination renderer is a core component and can be used by any mini-app.
 */
.pagination
{
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-2xs);
}

.pagination-button
{
    min-width: var(--control-height);
}

.pagination-button.active
{
    border-color: var(--color-accent-border);
    background: var(--color-accent-soft);
    color: var(--color-text);
    font-weight: 700;
}

.pagination-button.active:hover:not(:disabled)
{
    background: var(--color-accent-soft);
}

/*
 * On narrow screens the desktop side rail becomes a horizontal navigation
 * bar above the routed application content. Keeping navigation before the
 * viewport means it is immediately visible after the site header and does not
 * depend on the content area's height or scrolling state to remain reachable.
 *
 * CSS custom properties cannot currently be used directly in a media-query
 * condition, so this value mirrors --mobile-width above.
 */
@media (max-width: 50rem)
{
    :root
    {
        --padding-window-sides: var(--space-sm);
        --padding-app: var(--space-sm);
        --mini-app-min-height: 34rem;
        --viewport-padding-inline: var(--space-sm);
    }

    #application-body
    {
        flex-direction: column;
    }

    #navigation
    {
        order: 1;
        width: 100%;
        flex: 0 0 auto;
        border-right: 0;
        border-bottom: var(--border-thin);
    }

    #viewport
    {
        order: 2;
        flex: 1 1 auto;
        min-height: 0;
        padding: var(--viewport-padding-inline);
    }

    #navigation-menu
    {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: var(--space-2xs);
        padding: var(--space-2xs) var(--space-xs);
    }

    #navigation-menu a
    {
        justify-content: center;
        min-width: 0;
        min-height: var(--control-height-large);
        padding: var(--space-xs);
        text-align: center;
    }

    .navigation-label
    {
        position: absolute;
        width: 0.0625rem;
        height: 0.0625rem;
        padding: 0;
        margin: -0.0625rem;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
        border: 0;
    }

    .navigation-icon
    {
        width: 1.4rem;
        height: 1.4rem;
        flex-basis: 1.4rem;
    }

    #footer
    {
        display: none;
    }
}

@media (max-width: 30rem)
{
    #header
    {
        gap: var(--space-xs);
    }

    .daily-rate-logo-text
    {
        display: none;
    }

    #header-account
    {
        gap: var(--space-2xs);
    }

    
}

/* Shared project/team workflow components */
.dr-check-row
{
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    align-items: center;
}

.dr-gallery
{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
    gap: var(--space-sm);
}

.dr-gallery-item
{
    margin: 0;
    overflow: hidden;
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.dr-gallery-item img
{
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.dr-gallery-item figcaption
{
    padding: var(--space-xs);
    color: var(--color-muted);
    font-size: var(--font-size-small);
}

.dr-register-row
{
    display: flex;
    justify-content: space-between;
    gap: var(--space-sm);
    align-items: center;
    padding: var(--space-sm);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.dr-register-actions
{
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs);
}



.dr-main-stack > .dr-panel
{
    padding-block: var(--space-md);
}

.dr-panel-heading
{
    margin-bottom: var(--space-sm);
}

@media (max-width: 42rem)
{
    .dr-register-row,
    .dr-check-row
    {
        align-items: stretch;
        flex-direction: column;
    }

    .dr-register-actions > button
    {
        flex: 1 1 auto;
    }
}

/* Shared selection and image-management controls */
.dr-field
{
    display: grid;
    gap: var(--space-2xs);
    min-width: 0;
}

.dr-field-label
{
    font-size: var(--font-size-small);
    font-weight: 600;
}

.dr-selection-list
{
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    min-height: var(--control-height);
    padding-top: var(--space-2xs);
}

.dr-selection-card
{
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    min-height: var(--control-height);
    padding: var(--space-2xs) var(--space-2xs) var(--space-2xs) var(--space-sm);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface-subtle);
    font-size: var(--font-size-small);
    font-weight: 700;
}



.dr-selection-empty
{
    align-self: center;
    color: var(--color-muted);
    font-size: var(--font-size-small);
}

.dr-dialog-wide
{
    width: min(calc(100% - 2rem), var(--mini-app-max-width));
}

.dr-modal-content
{
    display: grid;
    gap: var(--space-md);
    padding: var(--space-lg);
}

.dr-upload-control
{
    display: grid;
    gap: var(--space-2xs);
    font-weight: 600;
}

.dr-image-manager
{
    display: grid;
    gap: var(--space-md);
}

.dr-image-preview
{
    overflow: hidden;
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface-subtle);
}

.dr-image-preview > img
{
    display: block;
    width: 100%;
    max-height: 28rem;
    object-fit: contain;
    background: var(--color-bg);
}

.dr-image-preview-meta
{
    display: flex;
    justify-content: space-between;
    gap: var(--space-sm);
    align-items: center;
    padding: var(--space-sm);
}

.dr-image-preview-meta .dr-summary
{
    margin: 0;
}

.dr-gallery-compact
{
    grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
}

.dr-gallery-button
{
    display: grid;
    width: 100%;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    text-align: left;
    box-shadow: none;
}

.dr-gallery-button img
{
    aspect-ratio: 4 / 3;
}

.dr-gallery-button span
{
    display: block;
    min-width: 0;
    padding: var(--space-xs);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--color-muted);
    font-size: var(--font-size-tiny);
}

.dr-gallery-item-selected
{
    border-color: var(--color-accent-border);
    box-shadow: inset 0 0 0 0.125rem var(--color-accent);
}

@media (max-width: 42rem)
{
    .dr-dialog-wide
    {
        width: calc(100% - 1rem);
        max-height: calc(100dvh - var(--space-sm));
    }

    .dr-modal-content
    {
        padding: var(--space-md);
    }

    .dr-selection-card
    {
        width: 100%;
        justify-content: space-between;
    }

    .dr-image-preview-meta
    {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* Prevent the page behind the gallery from scrolling. */
body.dr-image-viewer-open
{
    overflow: hidden;
}

/* Shared full-size image gallery viewer */
.dr-image-viewer-overlay
{
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    background: var(--color-gallery-overlay);
}

.dr-image-viewer-overlay[hidden]
{
    display: none;
}

.dr-image-viewer-dialog
{
    display: flex;
    flex-direction: column;
    width: min(100%, 74rem);
    max-height: calc(100dvh - 2rem);
    overflow: hidden;
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    box-shadow: var(--shadow-modal);
}

.dr-image-viewer-header
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-md);
    border-bottom: var(--border-thin);
}

.dr-image-viewer-title
{
    margin: 0;
    color: var(--color-text);
    font-size: var(--font-size-heading-small);
}

.dr-image-viewer-close,
.dr-image-viewer-nav
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: var(--border-thin);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    font: inherit;
}

.dr-image-viewer-close
{
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    font-size: 1.5rem;
}

.dr-image-viewer-stage
{
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 18rem;
    flex: 1 1 auto;
    overflow: hidden;
    background: var(--color-image-stage);
}

.dr-image-viewer-image
{
    display: block;
    max-width: 100%;
    max-height: calc(100dvh - 11rem);
    object-fit: contain;
}

.dr-image-viewer-nav
{
    position: absolute;
    top: 50%;
    width: 3rem;
    height: 3rem;
    padding: 0;
    transform: translateY(-50%);
    background: var(--color-gallery-control);
    font-size: 1.75rem;
}

button.dr-image-viewer-nav:hover:not(:disabled),
button.dr-image-viewer-nav:active:not(:disabled)
{
    transform: translateY(-50%);
}

.dr-image-viewer-nav:disabled
{
    display: none;
}

.dr-image-viewer-prev
{
    left: var(--space-sm);
}

.dr-image-viewer-next
{
    right: var(--space-sm);
}

.dr-image-viewer-footer
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-md);
    border-top: var(--border-thin);
    color: var(--color-muted);
    font-size: var(--font-size-small);
}

.dr-gallery-button
{
    cursor: zoom-in;
}

@media (max-width: 48rem)
{
    .dr-image-viewer-overlay
    {
        padding: 0;
    }

    .dr-image-viewer-dialog
    {
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }

    .dr-image-viewer-image
    {
        max-height: calc(100dvh - 9rem);
    }
}

/* ==========================================================================
   Shared calendar component (consolidated from assets/calendar.css)
   ========================================================================== */
/*
 * Shared calendar presentation. The public user-profile calendar deliberately
 * mirrors the dashboard calendar: the same panel treatment, month navigation,
 * readable seven-column grid, semantic status chips and mobile scrolling.
 */
.calendar
{
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    box-shadow: var(--shadow-small);
    font-family: inherit;
}

.calendar-header
{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
    gap: var(--space-md);
    padding: var(--space-md);
    border-bottom: var(--border-thin);
}

.calendar-heading
{
    min-width: 0;
}

.calendar-title,
.calendar-copy,
.calendar-month
{
    margin: 0;
}

.calendar-title
{
    font-size: var(--font-size-heading-medium);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.calendar-copy
{
    margin-top: var(--space-2xs);
    color: var(--color-muted);
    font-size: var(--font-size-small);
}

.calendar-navigation
{
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: var(--space-xs);
}

.calendar-month
{
    min-width: var(--calendar-month-label-width);
    color: var(--color-text);
    font-size: var(--font-size-small);
    font-weight: 700;
    text-align: center;
}

.calendar-legend
{
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-bottom: var(--border-thin);
    background: var(--color-surface-subtle);
}

.calendar-legend-item
{
    display: inline-flex;
    align-items: center;
    gap: var(--space-2xs);
    color: var(--color-muted);
    font-size: var(--font-size-tiny);
    font-weight: 600;
}

.calendar-dot
{
    width: var(--calendar-status-dot-size);
    height: var(--calendar-status-dot-size);
    flex: 0 0 auto;
    border-radius: var(--radius-pill);
}

.calendar-dot-available
{
    background: var(--color-success);
}

.calendar-dot-pending
{
    background: var(--color-warning);
}

.calendar-dot-booked
{
    background: var(--color-danger);
}

.calendar-scroll
{
    min-width: 0;
    overflow-x: auto;
}

.calendar-weekdays,
.calendar-grid
{
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekday
{
    min-width: 0;
    padding: var(--space-xs);
    border-right: var(--border-thin);
    border-bottom: var(--border-thin);
    background: var(--color-surface-subtle);
    color: var(--color-muted);
    font-size: var(--font-size-tiny);
    font-weight: 700;
    text-align: center;
}

.calendar-weekday:last-child
{
    border-right: 0;
}

.calendar-day
{
    position: relative;
    min-width: 0;
    min-height: var(--calendar-day-min-height);
    padding: var(--space-xs);
    border-right: var(--border-thin);
    border-bottom: var(--border-thin);
    background: var(--color-surface);
    overflow: hidden;
    transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.calendar-day:nth-child(7n)
{
    border-right: 0;
}

.calendar-day-outside
{
    background: var(--color-surface-subtle);
    color: var(--color-muted);
    opacity: 0.6;
}

.calendar-day-disabled:not(.calendar-day-outside)
{
    background: var(--color-surface-subtle);
    color: var(--color-muted);
    opacity: 0.72;
}

.calendar-day-today
{
    box-shadow: inset 0 0 0 var(--focus-width) var(--color-accent-border);
}

.calendar-day-selectable
{
    cursor: pointer;
}

.calendar-day-selectable:hover,
.calendar-day-selectable:focus-visible
{
    background: var(--color-surface-hover);
    box-shadow: inset 0 0 0 var(--focus-width) var(--color-border-strong);
    outline: 0;
}

.calendar-day-number
{
    display: block;
    min-width: 0;
    margin-bottom: var(--space-xs);
    font-size: var(--font-size-small);
    font-weight: 700;
    text-align: right;
}

.calendar[data-mode="public"] .calendar-day-booked
{
    cursor: not-allowed;
}

.calendar-day-status
{
    display: block;
    min-width: 0;
    max-width: 100%;
    padding: var(--space-2xs) var(--space-xs);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-tiny);
    font-weight: 700;
    line-height: var(--line-height-heading);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-day-status-free
{
    background: var(--color-success-surface);
    color: var(--color-success);
}

.calendar-day-status-pending
{
    background: var(--color-warning-transparent);
    color: var(--color-warning);
}

.calendar-day-status-booked
{
    background: var(--color-danger-surface);
    color: var(--color-danger);
}

.calendar-bookings
{
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: var(--space-2xs);
}

.calendar-booking
{
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    padding: var(--space-2xs) var(--space-xs);
    border-radius: var(--radius-sm);
    background: var(--color-accent-soft);
    color: var(--color-text);
    overflow: hidden;
}

.calendar-booking-title
{
    width: 100%;
    min-width: 0;
    overflow: hidden;
    font-size: var(--font-size-tiny);
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-booking-skill,
.calendar-booking-rate,
.calendar-booking-time
{
    min-width: 0;
    margin-top: var(--space-2xs);
    color: var(--color-muted);
    font-size: var(--font-size-tiny);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/*
 * Booking modal
 *
 * The overlay owns the outer spacing while the modal uses border-box sizing.
 * This prevents the form from becoming wider than the modal header, which was
 * the source of the earlier calendar-modal alignment issue.
 */
.calendar-modal-overlay
{
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100%;
    padding: var(--space-lg);
    overflow: auto;
    background: var(--color-overlay);
}

.calendar-modal
{
    display: flex;
    flex-direction: column;
    width: min(100%, var(--dialog-max-width));
    max-height: calc(100dvh - 4rem);
    margin: auto;
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    box-shadow: var(--shadow-dialog);
    overflow: auto;
}

.calendar-modal-header
{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
    gap: var(--space-sm);
    padding: var(--space-sm);
    border-bottom: var(--border-thin);
}

.calendar-modal-header > div:first-child
{
    flex: 1 1 auto;
    min-width: 0;
}

.calendar-modal-title
{
    width: 100%;
    margin: 0;
    font-size: var(--font-size-heading-small);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.calendar-modal-date
{
    width: 100%;
    margin-top: var(--space-2xs);
    color: var(--color-muted);
    font-size: var(--font-size-small);
    overflow-wrap: anywhere;
}

.calendar-modal-close
{
    flex: 0 0 var(--control-height);
    width: var(--control-height);
    height: var(--control-height);
    min-height: var(--control-height);
    padding: 0;
    background: transparent;
    color: var(--color-muted);
    font-size: 1.5rem;
    line-height: 1;
}

.calendar-booking-form
{
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    gap: var(--space-sm);
    margin: 0;
    padding: var(--space-sm);
}

.calendar-form-field
{
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    gap: var(--space-xs);
}

.calendar-form-label
{
    width: 100%;
    color: var(--color-text);
    font-size: var(--font-size-small);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.calendar-form-select,
.calendar-form-textarea,
.calendar-form-file
{
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
}

.calendar-form-textarea
{
    min-height: 7rem;
}

.calendar-form-rate
{
    min-width: 0;
    min-height: var(--control-height);
    padding: var(--control-padding-y) var(--control-padding-x);
    border-radius: var(--radius-sm);
    background: var(--color-surface-subtle);
    color: var(--color-text);
    font-size: var(--font-size-small);
    overflow-wrap: anywhere;
}

.calendar-form-file
{
    border-style: dashed;
    background: var(--color-surface-subtle);
    overflow: hidden;
}

.calendar-modal-actions
{
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    width: 100%;
    min-width: 0;
    gap: var(--space-xs);
    padding-top: var(--space-2xs);
}









/*
 * On phones the calendar keeps the dashboard-style readable grid and scrolls
 * horizontally. Only the booking modal itself collapses into a sheet.
 */
@media (max-width: 37.5rem)
{
    .calendar-header
    {
        align-items: stretch;
        flex-direction: column;
    }

    .calendar-navigation
    {
        justify-content: space-between;
        width: 100%;
    }

    .calendar-month
    {
        flex: 1 1 auto;
        min-width: 0;
    }

    .calendar-modal-overlay
    {
        align-items: flex-start;
        padding: var(--space-xs);
    }

    .calendar-modal
    {
        max-height: calc(100dvh - var(--space-sm));
    }

    .calendar-modal-actions
    {
        flex-direction: column-reverse;
    }
}
/* ==========================================================================
 * Wide two-column booking modal
 *
 * Booking requests contain considerably more information than the standard
 * calendar dialog, so only the booking modal opts into this wider layout.
 * Job location is displayed on the left and job details on the right.
 * ========================================================================== */

.calendar-booking-modal
{
    width: min(calc(100vw - (var(--space-lg) * 2)), var(--content-max-width));
    max-width: var(--content-max-width);
}

.calendar-booking-form
{
    gap: var(--space-md);
}

.calendar-booking-layout
{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    min-width: 0;
    gap: var(--space-lg);
    align-items: start;
}

.calendar-booking-section
{
    width: 100%;
    min-width: 0;
    padding: var(--space-md);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface-subtle);
}

.calendar-booking-section-title
{
    margin: 0 0 var(--space-md);
    color: var(--color-text);
    font-size: var(--font-size-heading-small);
    font-weight: 600;
}

.calendar-booking-section-fields
{
    width: 100%;
    min-width: 0;
}

.calendar-booking-address-grid
{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    min-width: 0;
    gap: var(--space-sm) var(--space-md);
}

.calendar-booking-details .calendar-booking-section-fields
{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    min-width: 0;
    gap: var(--space-sm) var(--space-md);
}

.calendar-booking-section .calendar-form-field
{
    min-width: 0;
    margin: 0;
}

.calendar-form-field-description,
.calendar-form-field-images
{
    grid-column: 1 / -1;
}

.calendar-form-field-description .calendar-form-textarea
{
    min-height: 8rem;
    resize: vertical;
}

.calendar-modal-actions
{
    padding-top: var(--space-md);
    border-top: var(--border-thin);
}

/*
 * Once there is no longer enough width for two useful sections, return to a
 * single-column booking form. The normal modal scrolling behaviour is retained
 * here because smaller screens may genuinely need vertical scrolling.
 */
@media (max-width: 58rem)
{
    .calendar-booking-modal
    {
        width: min(calc(100vw - (var(--space-md) * 2)), var(--content-narrow-width));
        max-width: var(--content-narrow-width);
    }

    .calendar-booking-layout
    {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 36rem)
{
    .calendar-booking-address-grid,
    .calendar-booking-details .calendar-booking-section-fields
    {
        grid-template-columns: 1fr;
    }

    .calendar-form-field-description,
    .calendar-form-field-images
    {
        grid-column: auto;
    }
}

/* ==========================================================================
   apps/login/style.css (consolidated)
   ========================================================================== */
/* Login-page layout. Controls inherit their base treatment from root style.css. */
.login-container
{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100%;
    padding: var(--padding-app);
}

.login-box
{
    width: min(100%, 24rem);
    padding: var(--padding-double);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.login-box h1,
.login-box h2
{
    margin-top: 0;
}

.login-field
{
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}



@media (max-width: 30rem)
{
    .login-container
    {
        align-items: flex-start;
        padding: 0;
    }

    .login-box
    {
        border: 0;
        background: transparent;
        padding: var(--space-sm) 0;
    }
}

/* ==========================================================================
   apps/register/style.css (consolidated)
   ========================================================================== */
.registration-app
{
    width: 100%;
    padding: var(--padding-app);
}

.registration-panel
{
    width: min(100%, var(--content-narrow-width));
    margin: 0 auto;
    overflow: hidden;
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    box-shadow: var(--shadow-dialog);
}

.registration-header,
.registration-form,
.registration-footer
{
    padding: var(--padding-standard);
}

.registration-header
{
    border-bottom: var(--border-thin);
}

.registration-eyebrow
{
    display: block;
    margin-bottom: var(--space-xs);
    color: var(--color-accent);
    font-size: var(--font-size-small);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.registration-header h1
{
    margin: 0;
    color: var(--color-text);
    font-size: var(--font-size-heading-medium);
}

.registration-header p
{
    margin: var(--space-sm) 0 0;
    color: var(--color-muted);
    line-height: 1.6;
}

.registration-form
{
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.registration-grid
{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-md);
}

.registration-field
{
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: var(--space-xs);
}

.registration-field label
{
    color: var(--color-text);
    font-weight: 600;
}

.registration-field input
{
    width: 100%;
    min-height: var(--control-height-large);
    padding: 0 var(--space-sm);
    border: var(--border-thin);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
}

.registration-field input:focus
{
    border-color: var(--color-border-strong);
    outline: 0.125rem solid color-mix(in srgb, var(--color-accent) 28%, transparent);
    outline-offset: 0.125rem;
}

.registration-hint
{
    color: var(--color-muted);
    font-size: var(--font-size-small);
}

.registration-message
{
    padding: var(--space-sm);
    border: var(--border-thin);
    border-radius: var(--radius-sm);
    background: var(--color-surface-subtle);
    color: var(--color-text);
}

.registration-message-error
{
    border-color: var(--color-danger);
    color: var(--color-danger);
}







.registration-footer
{
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-xs);
    border-top: var(--border-thin);
    color: var(--color-muted);
}

.registration-footer a
{
    color: var(--color-accent);
    font-weight: 700;
    text-decoration: none;
}

.registration-footer a:hover
{
    text-decoration: underline;
}

@media (max-width: 48rem)
{
    .registration-app
    {
        padding: 0;
    }

    .registration-panel
    {
        border-right: 0;
        border-left: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .registration-grid
    {
        grid-template-columns: 1fr;
    }

    
}

/* ==========================================================================
   apps/verify/style.css (consolidated)
   ========================================================================== */
.verification-app
{
    width: 100%;
    padding: var(--padding-app);
}

.verification-panel
{
    width: min(100%, 34rem);
    margin: 0 auto;
    overflow: hidden;
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    box-shadow: var(--shadow-dialog);
}

.verification-header,
.verification-form,
.verification-footer
{
    padding: var(--padding-standard);
}

.verification-header
{
    border-bottom: var(--border-thin);
}

.verification-eyebrow
{
    display: block;
    margin-bottom: var(--space-xs);
    color: var(--color-accent);
    font-size: var(--font-size-small);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.verification-header h1
{
    margin: 0;
    color: var(--color-text);
    font-size: var(--font-size-heading-medium);
}

.verification-header p
{
    margin: var(--space-sm) 0 0;
    color: var(--color-muted);
    line-height: 1.6;
}

.verification-form
{
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.verification-field
{
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.verification-field label
{
    color: var(--color-text);
    font-weight: 600;
}

.verification-field input
{
    width: 100%;
    min-height: var(--control-height-large);
    padding: 0 var(--space-sm);
    border: var(--border-thin);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
}

#verification-code
{
    font-size: var(--font-size-heading-medium);
    font-weight: 700;
    letter-spacing: 0.2em;
}

.verification-field input:focus
{
    border-color: var(--color-border-strong);
    outline: 0.125rem solid color-mix(in srgb, var(--color-accent) 28%, transparent);
    outline-offset: 0.125rem;
}

.verification-hint
{
    color: var(--color-muted);
    font-size: var(--font-size-small);
}

.verification-message
{
    padding: var(--space-sm);
    border: var(--border-thin);
    border-radius: var(--radius-sm);
    background: var(--color-surface-subtle);
    color: var(--color-text);
}

.verification-message-error
{
    border-color: var(--color-danger);
    color: var(--color-danger);
}

.verification-actions
{
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-sm);
}









.verification-footer
{
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-xs);
    border-top: var(--border-thin);
    color: var(--color-muted);
}

.verification-footer a
{
    color: var(--color-accent);
    font-weight: 700;
    text-decoration: none;
}

.verification-footer a:hover
{
    text-decoration: underline;
}

@media (max-width: 48rem)
{
    .verification-app
    {
        padding: 0;
    }

    .verification-panel
    {
        border-right: 0;
        border-left: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .verification-actions
    {
        align-items: stretch;
        flex-direction: column;
    }

    
}

/* ==========================================================================
   apps/profile/style.css (consolidated)
   ========================================================================== */
/* Profile-specific layout built entirely from the root Daily Rate design tokens. */
.profile-container
{
    display: flex;
    justify-content: center;
    width: 100%;
    min-height: 100%;
}

.profile-box
{
    width: 100%;
    max-width: var(--mini-app-max-width);
    padding: 0;
}

.profile-box h1
{
    margin-top: 0;
}

.profile-box h2
{
    margin-top: var(--space-lg);
}

.profile-avatar-section
{
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--space-lg);
    align-items: center;
    margin-bottom: var(--space-xl);
    padding: var(--space-md);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.profile-avatar-frame
{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 8rem;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-bg);
}

#profile-avatar-image
{
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-placeholder
{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--color-muted);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.profile-avatar-controls
{
    min-width: 0;
}

.profile-avatar-controls h2
{
    margin: 0 0 var(--space-xs) 0;
}

.profile-avatar-controls p
{
    margin: 0 0 var(--space-sm) 0;
    color: var(--color-muted);
}

.profile-avatar-actions
{
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.profile-avatar-status
{
    display: block;
    min-height: 1.25em;
    margin-top: var(--space-xs);
    color: var(--color-muted);
}

.profile-field
{
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

.profile-skills
{
    margin-top: var(--space-lg);
}

.profile-skill-selector
{
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

.profile-skill-search
{
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-xs);
}

#profile-skill-list
{
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.profile-skill
{
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(7rem, 10rem) auto;
    gap: var(--space-xs);
    align-items: center;
    padding: var(--space-xs);
    border: var(--border-thin);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
}

.profile-skill-name
{
    min-width: 0;
    overflow-wrap: anywhere;
}

#profile-save
{
    margin-top: var(--space-md);
    width: 100%;
}

@media (max-width: 40rem)
{
    .profile-box
    {
        padding: 0;
    }

    .profile-avatar-section
    {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .profile-avatar-actions
    {
        justify-content: center;
    }

    .profile-skill
    {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .profile-skill input[type="number"]
    {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

@media (max-width: 26rem)
{
    .profile-skill-search
    {
        grid-template-columns: 1fr;
    }

    .profile-skill-search button,
    .profile-avatar-actions button
    {
        width: 100%;
    }
}


.profile-alert-settings
{
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: var(--border-thin);
}

.profile-alert-settings-header p
{
    margin: 0 0 var(--space-md) 0;
    color: var(--color-muted);
}

.profile-alert-list
{
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.profile-alert-group
{
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin: 0;
    padding: var(--space-md);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.profile-alert-group legend
{
    padding: 0 var(--space-xs);
    font-weight: 700;
}

.profile-alert-option
{
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--space-sm);
    align-items: start;
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.profile-alert-option:hover
{
    background: var(--color-surface-hover);
}

.profile-alert-option input[type="checkbox"]
{
    width: 1.2rem;
    height: 1.2rem;
    margin-top: 0.15rem;
    accent-color: var(--color-accent);
}

.profile-alert-option-text
{
    display: flex;
    flex-direction: column;
    gap: var(--space-2xs);
}

.profile-alert-option-text span
{
    color: var(--color-muted);
    font-size: 0.9rem;
}

.profile-alert-loading
{
    margin: 0;
    color: var(--color-muted);
}

#profile-alert-save
{
    width: 100%;
    margin-top: var(--space-md);
}

/* ==========================================================================
   apps/users/style.css (consolidated)
   ========================================================================== */
/* User-search layout and result cards, using only root Daily Rate design tokens. */
.users-page
{
    width: 100%;
    max-width: var(--mini-app-max-width);
    margin: 0 auto;
    padding: var(--padding-app);
}

.users-header
{
    margin-bottom: var(--space-md);
}

.users-title
{
    margin: 0;
    font-size: var(--font-size-heading-large);
}

.users-search
{
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    padding: var(--space-sm);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.users-search-field
{
    display: flex;
    flex: 1 1 12rem;
    flex-direction: column;
    gap: var(--space-xs);
    min-width: 0;
}

.users-search-field label
{
    color: var(--color-muted);
    font-size: var(--font-size-small);
    font-weight: 600;
}



.users-results
{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
    gap: var(--space-sm);
}

.user-tile
{
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: var(--space-sm);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    text-decoration: none;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.user-tile:hover
{
    border-color: var(--color-border-strong);
    background: var(--color-surface-subtle);
}

.user-tile-avatar
{
    width: 100%;
    aspect-ratio: 1 / 1;
    margin-bottom: var(--space-sm);
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--color-surface-subtle);
}

.user-tile-name
{
    margin: 0 0 var(--space-xs);
    font-size: var(--font-size-heading-small);
    overflow-wrap: anywhere;
}

.user-tile-skills
{
    color: var(--color-muted);
    font-size: var(--font-size-small);
    overflow-wrap: anywhere;
}

.users-loading,
.users-empty,
.users-error
{
    grid-column: 1 / -1;
    padding: var(--space-lg) var(--space-sm);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-muted);
    text-align: center;
}

.users-error
{
    color: var(--color-danger);
}

@media (max-width: 40rem)
{
    .users-page
    {
        padding: 0;
    }

    .users-search
    {
        align-items: stretch;
        flex-direction: column;
    }

    .users-search-field
    {
        flex-basis: auto;
    }

    
}

/* ==========================================================================
   apps/users/user/style.css (consolidated)
   ========================================================================== */
/* Public user-profile layout, with shared controls and tokens supplied globally. */
.user-container
{
    display: flex;
    justify-content: center;
    width: 100%;
    min-height: 100%;
}

.user-box
{
    width: 100%;
    max-width: var(--mini-app-max-width);
    padding: 0;
}

.user-header
{
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.user-avatar
{
    width: 10rem;
    max-width: 35%;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: var(--radius-md);
    background: var(--color-surface-subtle);
}

.user-header-details
{
    flex: 1;
    min-width: 0;
}

.user-header-details h1
{
    margin: 0 0 var(--space-xs);
    overflow-wrap: anywhere;
}

.user-location
{
    margin-bottom: var(--space-sm);
    color: var(--color-muted);
    font-size: 0.95rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.user-location::before
{
    content: "⌖";
    margin-right: var(--space-xs);
}

.user-location-missing
{
    font-style: italic;
}

.user-section
{
    margin-bottom: var(--space-lg);
}

.user-section h2
{
    margin-top: 0;
}

#user-skills
{
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.user-skill
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    border: var(--border-thin);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
}

.user-skill-name
{
    min-width: 0;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.user-skill-rate
{
    flex-shrink: 0;
    color: var(--color-success);
    font-weight: 700;
    white-space: nowrap;
}

#user-calendar
{
    min-height: 18rem;
}

#user-bio
{
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

@media (max-width: 40rem)
{
    .user-box
    {
        padding: 0;
    }

    .user-header
    {
        align-items: flex-start;
    }
}

@media (max-width: 28rem)
{
    .user-header
    {
        flex-direction: column;
    }

    .user-avatar
    {
        width: 7rem;
        max-width: none;
    }

    .user-message
    {
        width: 100%;
    }

    .user-skill
    {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* ==========================================================================
   apps/alerts/style.css (consolidated)
   ========================================================================== */
.alerts-app
{
    width: 100%;
}

.alerts-header
{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.alerts-header h1
{
    margin: 0;
}

.alerts-header p
{
    margin: var(--space-xs) 0 0 0;
    color: var(--color-muted);
}

.alerts-filters
{
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

.alerts-filters button[aria-pressed="true"]
{
    border-color: var(--color-accent-border);
    background: var(--color-accent-soft);
}

.alerts-list
{
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.alert-card
{
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-md);
    align-items: center;
    padding: var(--space-md);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.alert-card-unread
{
    border-left: 0.3rem solid var(--color-accent);
}

.alert-card-body
{
    min-width: 0;
}

.alert-card-meta
{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xs);
    margin-bottom: var(--space-xs);
    color: var(--color-muted);
    font-size: 0.82rem;
}

.alert-card-group
{
    font-weight: 700;
}

.alert-card h2
{
    margin: 0 0 var(--space-xs) 0;
    font-size: 1.05rem;
}

.alert-card p
{
    margin: 0;
    color: var(--color-muted);
    overflow-wrap: anywhere;
}

.alert-card-actions
{
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--space-xs);
}

.alerts-empty
{
    margin: 0;
    padding: var(--space-lg);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-muted);
    text-align: center;
}

@media (max-width: 42rem)
{
    .alert-card
    {
        grid-template-columns: 1fr;
    }

    .alerts-header
    {
        flex-direction: column;
    }

    
}

/* ==========================================================================
   apps/dashboard/style.css (consolidated)
   ========================================================================== */
.home-dashboard
{
    width: min(100%, var(--mini-app-max-width));
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-large, 1.5rem);
}

.home-header
{
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--spacing-large, 1.5rem);
}

.home-eyebrow,
.home-panel-kicker
{
    margin: 0 0 var(--spacing-small, 0.5rem);
    color: var(--color-accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.home-header h1,
.home-panel h2
{
    margin: 0;
    color: var(--color-text);
}

.home-header h1
{
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    line-height: 1.1;
}

.home-subtitle
{
    margin: var(--spacing-small, 0.5rem) 0 0;
    max-width: 40rem;
    color: var(--color-muted);
    line-height: 1.6;
}

.home-date
{
    flex: 0 0 auto;
    color: var(--color-muted);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: right;
}

.home-money
{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--spacing-medium, 1rem);
}

.home-summary-card,
.home-panel
{
    background: var(--color-surface);
    border: var(--line-width) solid var(--color-border);
    border-radius: var(--radius-large, 1rem);
    box-shadow: var(--shadow-small);
}

.home-summary-card
{
    position: relative;
    overflow: hidden;
    min-width: 0;
    padding: var(--spacing-large, 1.5rem);
}

.home-summary-card::after
{
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 0.35rem;
    height: 100%;
    background: var(--summary-accent);
}

.home-summary-card-positive
{
    --summary-accent: var(--color-success);
}

.home-summary-card-negative
{
    --summary-accent: var(--color-danger);
}

.home-summary-heading
{
    display: flex;
    align-items: center;
    gap: var(--spacing-medium, 1rem);
}

.home-summary-icon
{
    width: 2.6rem;
    height: 2.6rem;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    color: var(--summary-accent);
    background: color-mix(in srgb, var(--summary-accent) 12%, transparent);
    font-size: 1.2rem;
    font-weight: 800;
}

.home-summary-label,
.home-summary-period,
.home-summary-value
{
    margin: 0;
}

.home-summary-label
{
    color: var(--color-text);
    font-weight: 700;
}

.home-summary-period
{
    margin-top: 0.2rem;
    color: var(--color-muted);
    font-size: 0.82rem;
}

.home-summary-value
{
    margin-top: var(--spacing-large, 1.5rem);
    color: var(--color-text);
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
}

/* Dashboard project attendance */
.home-attendance-card
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-md);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    box-shadow: var(--shadow-small);
}

.home-attendance-card-copy
{
    min-width: 0;
}

.home-attendance-card h2,
.home-attendance-register-heading h3
{
    margin: 0;
}

.home-attendance-summary,
.home-attendance-date
{
    margin: var(--space-2xs) 0 0;
    color: var(--color-muted);
    font-size: var(--font-size-small);
}

.home-attendance-dialog
{
    width: min(calc(100% - var(--space-lg)), var(--content-max-width));
}

.home-attendance-dialog > .dr-dialog-header
{
    padding: var(--space-md);
    border-bottom: var(--border-thin);
}

.home-attendance-workspace
{
    display: grid;
    grid-template-columns: var(--attendance-project-column-width) minmax(0, 1fr);
    min-height: var(--attendance-workspace-min-height);
}

.home-attendance-projects
{
    padding: var(--space-sm);
    border-right: var(--border-thin);
    background: var(--color-surface-subtle);
}

.home-attendance-project-list
{
    display: grid;
    gap: var(--space-xs);
}

.home-attendance-project
{
    display: grid;
    gap: var(--space-2xs);
    width: 100%;
    min-height: auto;
    padding: var(--space-sm);
    text-align: left;
}

.home-attendance-project strong,
.home-attendance-project span
{
    display: block;
}

.home-attendance-project span
{
    color: var(--color-muted);
    font-size: var(--font-size-tiny);
    font-weight: 500;
}

.home-attendance-project-active
{
    border-color: var(--color-accent-border);
    background: var(--color-accent-soft);
    box-shadow: inset 0 0 0 var(--line-width) var(--color-accent-border);
}

.home-attendance-register
{
    min-width: 0;
    padding: var(--space-md);
}

.home-attendance-register-heading
{
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: var(--border-thin);
}

.home-attendance-member-list
{
    display: grid;
    gap: var(--space-xs);
}

.home-attendance-member .dr-person
{
    min-width: 0;
}

.home-attendance-member .dr-register-actions
{
    justify-content: flex-end;
}


/* Dashboard personal calendar */
.home-calendar-section
{
    min-width: 0;
    overflow: hidden;
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    box-shadow: var(--shadow-small);
}

.home-calendar-header
{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-md);
    border-bottom: var(--border-thin);
}

.home-calendar-header h2,
.home-calendar-month,
.home-calendar-copy
{
    margin: 0;
}

.home-calendar-copy
{
    margin-top: var(--space-2xs);
    color: var(--color-muted);
    font-size: var(--font-size-small);
}

.home-calendar-navigation
{
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex: 0 0 auto;
}

.home-calendar-month
{
    min-width: var(--calendar-month-label-width);
    color: var(--color-text);
    font-size: var(--font-size-small);
    font-weight: 700;
    text-align: center;
}

.home-calendar-legend
{
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-bottom: var(--border-thin);
    background: var(--color-surface-subtle);
}

.home-calendar-legend-item
{
    display: inline-flex;
    align-items: center;
    gap: var(--space-2xs);
    color: var(--color-muted);
    font-size: var(--font-size-tiny);
    font-weight: 600;
}

.home-calendar-dot
{
    width: var(--calendar-status-dot-size);
    height: var(--calendar-status-dot-size);
    flex: 0 0 auto;
    border-radius: var(--radius-pill);
}

.home-calendar-dot-booked
{
    background: var(--color-accent-border);
}

.home-calendar-dot-worked
{
    background: var(--color-success);
}

.home-calendar-dot-pending
{
    background: var(--color-warning);
}

.home-calendar
{
    min-width: 0;
    overflow-x: auto;
}

.home-calendar-weekdays,
.home-calendar-grid
{
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.home-calendar-weekday
{
    padding: var(--space-xs);
    border-right: var(--border-thin);
    border-bottom: var(--border-thin);
    background: var(--color-surface-subtle);
    color: var(--color-muted);
    font-size: var(--font-size-tiny);
    font-weight: 700;
    text-align: center;
}

.home-calendar-weekday:last-child
{
    border-right: 0;
}

.home-calendar-day
{
    position: relative;
    min-width: 0;
    min-height: var(--calendar-day-min-height);
    padding: var(--space-xs);
    border-right: var(--border-thin);
    border-bottom: var(--border-thin);
    background: var(--color-surface);
    cursor: pointer;
    transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.home-calendar-day:nth-child(7n)
{
    border-right: 0;
}

.home-calendar-day:hover:not(.home-calendar-day-outside):not(.home-calendar-day-past),
.home-calendar-day:focus-visible:not(.home-calendar-day-outside):not(.home-calendar-day-past)
{
    background: var(--color-surface-hover);
    box-shadow: inset 0 0 0 var(--focus-width) var(--color-border-strong);
    outline: 0;
}

.home-calendar-day-outside
{
    background: var(--color-surface-subtle);
    color: var(--color-muted);
    cursor: default;
    opacity: 0.6;
}

.home-calendar-day-today
{
    box-shadow: inset 0 0 0 var(--focus-width) var(--color-accent-border);
}

.home-calendar-day-number
{
    display: block;
    margin-bottom: var(--space-xs);
    font-size: var(--font-size-small);
    font-weight: 700;
    text-align: right;
}

.home-calendar-day-summary
{
    display: flex;
    flex-direction: column;
    gap: var(--space-2xs);
}

.home-calendar-day-chip
{
    display: block;
    min-width: 0;
    padding: var(--space-2xs) var(--space-xs);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-tiny);
    font-weight: 700;
    line-height: var(--line-height-heading);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-calendar-day-chip-accepted
{
    background: var(--color-accent-soft);
    color: var(--color-accent-text);
}

.home-calendar-day-chip-completed
{
    background: var(--color-success-surface);
    color: var(--color-success);
}

.home-calendar-day-chip-pending
{
    background: var(--color-warning-transparent);
    color: var(--color-warning);
}

.home-calendar-dialog
{
    width: min(calc(100% - var(--space-lg)), var(--calendar-dialog-width));
}

.home-calendar-dialog > .dr-dialog-header
{
    padding: var(--space-md);
    border-bottom: var(--border-thin);
}

.home-calendar-dialog-events
{
    display: grid;
    gap: var(--space-sm);
    max-height: calc(100dvh - 12rem);
    padding: var(--space-md);
    overflow-y: auto;
}

.home-calendar-event
{
    display: grid;
    gap: var(--space-sm);
    padding: var(--space-md);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.home-calendar-event-top
{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-sm);
}

.home-calendar-event h3,
.home-calendar-event-relation,
.home-calendar-event-detail
{
    margin: 0;
}

.home-calendar-event-relation
{
    margin-top: var(--space-2xs);
    color: var(--color-muted);
    font-size: var(--font-size-small);
}

.home-calendar-event-status
{
    flex: 0 0 auto;
}

.home-calendar-event-status-accepted
{
    border-color: var(--color-accent-border);
    background: var(--color-accent-soft);
}

.home-calendar-event-status-completed
{
    border-color: var(--color-success);
    background: var(--color-success-surface);
    color: var(--color-success);
}

.home-calendar-event-status-pending
{
    border-color: var(--color-warning);
    background: var(--color-warning-transparent);
    color: var(--color-warning);
}

.home-calendar-event-details
{
    display: grid;
    gap: var(--space-xs);
    padding-top: var(--space-sm);
    border-top: var(--border-thin);
}

.home-calendar-event-detail
{
    color: var(--color-muted);
    font-size: var(--font-size-small);
    overflow-wrap: anywhere;
}

.home-calendar-event-detail strong
{
    color: var(--color-text);
}

.home-calendar-event-actions
{
    padding-top: var(--space-sm);
    border-top: var(--border-thin);
}


.home-grid
{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--spacing-medium, 1rem);
    align-items: start;
}

.home-panel
{
    min-width: 0;
    overflow: hidden;
}

.home-panel-header
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-medium, 1rem);
    padding: var(--spacing-large, 1.5rem);
    border-bottom: var(--line-width) solid var(--color-border);
}

.home-panel h2
{
    font-size: 1.15rem;
}

.home-panel-link
{
    flex: 0 0 auto;
    color: var(--color-accent);
    font-size: 0.86rem;
    font-weight: 700;
    text-decoration: none;
}

.home-panel-link:hover
{
    text-decoration: underline;
}

.home-panel-body
{
    display: flex;
    flex-direction: column;
}

.home-booking,
.home-message
{
    display: flex;
    align-items: center;
    gap: var(--spacing-medium, 1rem);
    padding: var(--spacing-medium, 1rem) var(--spacing-large, 1.5rem);
    border-bottom: var(--line-width) solid var(--color-border);
}

.home-booking:last-child,
.home-message:last-child
{
    border-bottom: 0;
}

.home-booking-time
{
    flex: 0 0 auto;
    min-width: 4.6rem;
    color: var(--color-accent);
    font-size: 0.82rem;
    font-weight: 800;
}

.home-booking-details,
.home-message-details
{
    min-width: 0;
    flex: 1;
}

.home-booking-title,
.home-message-title,
.home-booking-meta,
.home-message-preview,
.home-message-time
{
    margin: 0;
}

.home-booking-title,
.home-message-title
{
    color: var(--color-text);
    font-weight: 700;
}

.home-booking-meta,
.home-message-preview,
.home-message-time
{
    margin-top: 0.22rem;
    color: var(--color-muted);
    font-size: 0.82rem;
}

.home-message-preview
{
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.home-message
{
    position: relative;
}

.home-message-unread::before
{
    content: "";
    width: 0.55rem;
    height: 0.55rem;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--color-accent);
}

.home-message:not(.home-message-unread)::before
{
    content: "";
    width: 0.55rem;
    height: 0.55rem;
    flex: 0 0 auto;
}

.home-empty,
.home-error,
.home-loading
{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-small, 0.5rem);
    min-height: 8rem;
    padding: var(--spacing-large, 1.5rem);
    color: var(--color-muted);
    text-align: center;
}

.home-error
{
    color: var(--color-danger);
}

.home-loading-spinner
{
    width: 1rem;
    height: 1rem;
    border: 0.16rem solid color-mix(in srgb, var(--color-muted) 25%, transparent);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: home-spin 0.75s linear infinite;
}

@keyframes home-spin
{
    to
    {
        transform: rotate(360deg);
    }
}

@media (max-width: 52rem)
{
    .home-header
    {
        align-items: flex-start;
        flex-direction: column;
    }

    .home-date
    {
        text-align: left;
    }

    .home-grid
    {
        grid-template-columns: 1fr;
    }

    .home-attendance-card
    {
        align-items: stretch;
        flex-direction: column;
    }

    .home-attendance-workspace
    {
        grid-template-columns: 1fr;
    }

    .home-calendar-header
    {
        align-items: stretch;
        flex-direction: column;
    }

    .home-calendar-navigation
    {
        justify-content: space-between;
    }

    .home-attendance-projects
    {
        border-right: 0;
        border-bottom: var(--border-thin);
    }

    .home-attendance-project-list
    {
        grid-template-columns: repeat(auto-fit, minmax(var(--attendance-project-column-width), 1fr));
    }
}

@media (max-width: 36rem)
{
    .home-money
    {
        grid-template-columns: 1fr;
    }

    .home-panel-header
    {
        align-items: flex-start;
        flex-direction: column;
    }

    .home-booking,
    .home-message
    {
        align-items: flex-start;
    }

    .home-attendance-dialog > .dr-dialog-header
    {
        align-items: stretch;
        flex-direction: column;
    }

    .home-attendance-register
    {
        padding: var(--space-sm);
    }

    .home-attendance-member
    {
        align-items: stretch;
        flex-direction: column;
    }

    .home-attendance-member .dr-register-actions
    {
        justify-content: stretch;
    }

    .home-attendance-member .dr-register-actions > button
    {
        flex: 1 1 auto;
    }

    .home-calendar-dialog > .dr-dialog-header,
    .home-calendar-event-top
    {
        align-items: stretch;
        flex-direction: column;
    }

    .home-calendar-event-status
    {
        align-self: flex-start;
    }
}

/* ==========================================================================
   apps/accounts/style.css (consolidated)
   ========================================================================== */
/*
 * Accounts mini-app.
 *
 * All layout, spacing, type and colour values are taken from the shared root
 * design tokens so this page remains consistent with the rest of Daily Rate.
 */
.accounts-app
{
    width: 100%;
    max-width: var(--mini-app-max-width);
    margin: 0 auto;
    padding: var(--padding-app);
    box-sizing: border-box;
    color: var(--color-text);
    font-family: var(--font-family-base);
    font-size: var(--font-size-body);
    line-height: var(--line-height-body);
}

.accounts-app *,
.accounts-app *::before,
.accounts-app *::after
{
    box-sizing: border-box;
}

.accounts-header
{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.accounts-header-copy
{
    min-width: 0;
}

.accounts-header h1,
.accounts-section-header h2
{
    margin-top: 0;
    color: var(--color-text);
}

.accounts-header h1
{
    margin-bottom: var(--space-xs);
    font-size: var(--font-size-heading-large);
    line-height: 1.15;
}

.accounts-header p,
.accounts-section-header p
{
    margin: 0;
    color: var(--color-muted);
}









.accounts-message
{
    margin-bottom: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    border: var(--border-thin);
    border-radius: var(--radius-sm);
    background: var(--color-surface-subtle);
    color: var(--color-muted);
}

.accounts-summary
{
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.accounts-balance-card,
.accounts-summary-card
{
    min-width: 0;
    padding: var(--space-lg);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.accounts-balance-card
{
    grid-column: span 2;
    background: var(--color-surface-subtle);
}

.accounts-card-label
{
    margin: 0 0 var(--space-xs);
    color: var(--color-muted);
    font-size: var(--font-size-small);
    font-weight: 600;
}

.accounts-balance-value,
.accounts-summary-value
{
    margin: 0;
    color: var(--color-text);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.accounts-balance-value
{
    font-size: var(--font-size-heading-large);
    line-height: 1.1;
}

.accounts-summary-value
{
    font-size: var(--font-size-heading-small);
}

.accounts-summary-date
{
    font-size: var(--font-size-body);
}

.accounts-card-help
{
    max-width: 32rem;
    margin: var(--space-sm) 0 0;
    color: var(--color-muted);
    font-size: var(--font-size-small);
}

.accounts-payment-methods
{
    margin-bottom: var(--space-xl);
}

.accounts-payment-method-list
{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-md);
}

.accounts-payment-method-card
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    min-width: 0;
    padding: var(--space-md);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.accounts-payment-method-details
{
    min-width: 0;
}

.accounts-payment-method-title-row
{
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.accounts-payment-method-title-row strong
{
    overflow-wrap: anywhere;
}

.accounts-payment-method-details p
{
    margin: var(--space-2xs) 0 0;
    color: var(--color-muted);
    font-size: var(--font-size-small);
}

.accounts-payment-method-default
{
    display: inline-flex;
    align-items: center;
    min-height: 1.5rem;
    padding: 0 var(--space-xs);
    border: var(--border-thin);
    border-radius: var(--radius-pill);
    background: var(--color-surface-subtle);
    color: var(--color-text);
    font-size: var(--font-size-small);
    font-weight: 700;
}

.accounts-payment-method-actions,
.accounts-payout-actions
{
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: var(--space-xs);
    flex-shrink: 0;
}

.accounts-payment-method-empty
{
    grid-column: 1 / -1;
    margin: 0;
    padding: var(--space-lg);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-muted);
    text-align: center;
}

.accounts-payout-setup
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.accounts-payout-setup h2
{
    margin: 0 0 var(--space-xs);
    font-size: var(--font-size-heading-small);
}

.accounts-payout-setup p
{
    margin: 0;
    color: var(--color-muted);
}

.accounts-transactions
{
    width: 100%;
}

.accounts-section-header
{
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-lg);
    margin-bottom: var(--space-md);
}

.accounts-section-header h2
{
    margin-bottom: var(--space-xs);
    font-size: var(--font-size-heading-small);
}

.accounts-section-actions
{
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex-shrink: 0;
}

.accounts-filter-label
{
    color: var(--color-muted);
    font-size: var(--font-size-small);
    font-weight: 600;
}

.accounts-filter
{
    min-height: var(--control-height);
    padding: 0 var(--space-sm);
    border: var(--border-thin);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
}



.accounts-count
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    min-height: 2rem;
    padding: 0 var(--space-xs);
    border: var(--border-thin);
    border-radius: var(--radius-pill);
    background: var(--color-surface-subtle);
    color: var(--color-muted);
    font-size: var(--font-size-small);
    font-weight: 700;
}

.accounts-table-container
{
    width: 100%;
    overflow-x: auto;
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.accounts-table
{
    width: 100%;
    min-width: 72rem;
    border-collapse: collapse;
}

.accounts-table th,
.accounts-table td
{
    padding: var(--space-sm) var(--space-md);
    border-bottom: var(--border-thin);
    text-align: left;
    vertical-align: middle;
}

.accounts-table th
{
    background: var(--color-surface-subtle);
    color: var(--color-muted);
    font-size: var(--font-size-small);
    font-weight: 600;
    white-space: nowrap;
}

.accounts-table tbody tr:last-child td
{
    border-bottom: 0;
}

.accounts-table tbody tr:hover
{
    background: var(--color-surface-hover);
}

.accounts-table-message
{
    color: var(--color-muted);
    text-align: center !important;
}

.accounts-money-column,
.accounts-table td.accounts-money-column
{
    text-align: right;
    white-space: nowrap;
}

.accounts-id
{
    display: inline-block;
    max-width: 11rem;
    overflow: hidden;
    color: var(--color-muted);
    font-family: monospace;
    font-size: var(--font-size-small);
    text-overflow: ellipsis;
    vertical-align: bottom;
    white-space: nowrap;
}

.accounts-direction,
.accounts-status
{
    display: inline-flex;
    align-items: center;
    gap: var(--space-2xs);
    white-space: nowrap;
}

.accounts-direction-icon
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border: var(--border-thin);
    border-radius: var(--radius-pill);
    background: var(--color-surface-subtle);
    color: var(--color-text);
    font-weight: 700;
}

.accounts-direction-income .accounts-direction-icon
{
    border-color: color-mix(in srgb, var(--color-success) 40%, var(--color-border));
    color: var(--color-success);
}

.accounts-status
{
    padding: var(--space-2xs) var(--space-xs);
    border: var(--border-thin);
    border-radius: var(--radius-pill);
    background: var(--color-surface-subtle);
    color: var(--color-muted);
    font-size: var(--font-size-small);
    text-transform: capitalize;
}

.accounts-status-due,
.accounts-status-late
{
    border-color: var(--color-border-strong);
    color: var(--color-text);
}

.accounts-value-income
{
    color: var(--color-success);
    font-weight: 700;
}

.accounts-value-expense
{
    color: var(--color-danger);
    font-weight: 700;
}

.accounts-mobile-list
{
    display: none;
}

.accounts-mobile-card
{
    padding: var(--space-md);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.accounts-mobile-card + .accounts-mobile-card
{
    margin-top: var(--space-sm);
}

.accounts-mobile-card-header
{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.accounts-mobile-card-value
{
    margin: 0;
    font-size: var(--font-size-heading-small);
    font-weight: 700;
    white-space: nowrap;
}

.accounts-mobile-meta
{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-sm) var(--space-md);
    margin: 0;
}

.accounts-mobile-meta div
{
    min-width: 0;
}

.accounts-mobile-meta dt
{
    margin-bottom: var(--space-2xs);
    color: var(--color-muted);
    font-size: var(--font-size-small);
}

.accounts-mobile-meta dd
{
    margin: 0;
    overflow-wrap: anywhere;
}

.accounts-mobile-empty
{
    padding: var(--space-lg);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-muted);
    text-align: center;
}

@media (max-width: 64em)
{
    .accounts-summary
    {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 48em)
{
    .accounts-header,
    .accounts-section-header
    {
        align-items: stretch;
        flex-direction: column;
    }

    

    .accounts-section-actions
    {
        flex-wrap: wrap;
    }

    .accounts-summary,
    .accounts-payment-method-list
    {
        grid-template-columns: 1fr;
    }

    .accounts-payment-method-card,
    .accounts-payout-setup
    {
        align-items: stretch;
        flex-direction: column;
    }

    .accounts-payment-method-actions,
    .accounts-payout-actions
    {
        justify-content: flex-start;
    }

    .accounts-balance-card
    {
        grid-column: auto;
    }

    .accounts-table-container
    {
        display: none;
    }

    .accounts-mobile-list
    {
        display: block;
    }
}

@media (max-width: 32em)
{
    .accounts-mobile-meta
    {
        grid-template-columns: 1fr;
    }

    .accounts-section-actions
    {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .accounts-filter
    {
        width: 100%;
        min-width: 0;
    }
}

/* ==========================================================================
   apps/bookings/style.css (consolidated)
   ========================================================================== */
/*
 * Booking management mini-app.
 *
 * All visual values are built from the shared design tokens in /style.css.
 * The page is split into three clear views: bookings received, bookings made,
 * and a deliberately quieter archive for dates before today.
 */
.bookings-app
{
    width: 100%;
    max-width: var(--mini-app-max-width);
    margin: 0 auto;
    padding: var(--padding-app);
    box-sizing: border-box;
    color: var(--color-text);
    font-family: var(--font-family-base);
    font-size: var(--font-size-body);
    line-height: var(--line-height-body);
}

.bookings-app *,
.bookings-app *::before,
.bookings-app *::after
{
    box-sizing: border-box;
}

.bookings-header
{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.bookings-header-copy
{
    min-width: 0;
}

.bookings-header h1,
.bookings-panel h2,
.bookings-archive-section h3,
.booking-modal h2,
.booking-actions-section h3,
.booking-data-section h3
{
    margin-top: 0;
    color: var(--color-text);
}

.bookings-header h1
{
    margin-bottom: var(--space-xs);
    font-size: var(--font-size-heading-large);
    line-height: 1.15;
}

.bookings-header p,
.bookings-panel-header p
{
    margin: 0;
    color: var(--color-muted);
}













/*
 * The tab strip is the main navigation for the mini-app. Counts sit inside the
 * tab so the user can see where attention is needed without opening each view.
 */
.bookings-tabs
{
    display: flex;
    gap: var(--space-xs);
    width: 100%;
    margin-bottom: var(--space-lg);
    padding: var(--space-xs);
    overflow-x: auto;
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface-subtle);
}

.bookings-tab
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 0 10rem;
    gap: var(--space-xs);
    min-height: var(--control-height-large);
    padding: var(--space-xs) var(--space-sm);
    border: var(--line-width) solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-muted);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.bookings-tab:hover
{
    background: var(--color-surface-hover);
    color: var(--color-text);
}

.bookings-tab:focus-visible
{
    outline: 0.125rem solid var(--color-border-strong);
    outline-offset: 0.125rem;
}

.bookings-tab-active
{
    border-color: var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
}

.bookings-tab-count,
.bookings-count
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    min-height: 2rem;
    padding: 0 var(--space-xs);
    border-radius: var(--radius-pill);
    font-size: var(--font-size-small);
    font-weight: 700;
}

.bookings-tab-count
{
    border: var(--border-thin);
    background: var(--color-surface-subtle);
    color: var(--color-muted);
}

.bookings-tab-active .bookings-tab-count
{
    border-color: var(--color-accent-border);
    background: var(--color-accent-soft);
    color: var(--color-accent-text);
}

.bookings-count
{
    border: var(--border-thin);
    background: var(--color-surface);
    color: var(--color-muted);
}

.bookings-panel
{
    width: 100%;
}

.bookings-panel[hidden]
{
    display: none;
}

.bookings-panel-header
{
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.bookings-panel h2
{
    margin-bottom: var(--space-xs);
    font-size: var(--font-size-heading-small);
}

.bookings-list
{
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/*
 * Cards remain compact enough to scan quickly while keeping the action buttons
 * visually separate from the descriptive content. Status uses transparent
 * semantic surfaces so pending and accepted work can be identified at a glance.
 */
.booking-card
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
    width: 100%;
    padding: var(--padding-standard);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    cursor: pointer;
    transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}

.booking-card:hover,
.booking-card:focus-visible
{
    border-color: var(--color-border-strong);
    background: var(--color-surface-hover);
    outline: none;
}

.booking-card:active
{
    transform: translateY(0.0625rem);
}

.booking-card-content
{
    min-width: 0;
    flex: 1;
}

.booking-card-title-row
{
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
}

.booking-card h3
{
    margin: 0;
    font-size: 1rem;
}

.booking-card-user
{
    margin-bottom: var(--space-xs);
    color: var(--color-muted);
    font-size: var(--font-size-small);
}

.booking-card-meta
{
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    color: var(--color-muted);
    font-size: var(--font-size-small);
}

.booking-status
{
    display: inline-flex;
    align-items: center;
    padding: 0.25em 0.65em;
    border: var(--line-width) solid transparent;
    border-radius: var(--radius-pill);
    font-size: var(--font-size-tiny);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.booking-status-accepted
{
    border-color: var(--color-success);
    background: var(--color-success-transparent);
    color: var(--color-success);
}

.booking-status-pending
{
    border-color: var(--color-warning);
    background: var(--color-warning-transparent);
    color: var(--color-warning);
}

.booking-status-completed
{
    border-color: var(--color-border);
    background: var(--color-surface-subtle);
    color: var(--color-muted);
}

.booking-status-cancelled,
.booking-status-rejected
{
    border-color: var(--color-danger);
    background: var(--color-danger-transparent);
    color: var(--color-danger);
}

.booking-card-actions
{
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.bookings-empty,
.bookings-loading
{
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding: var(--padding-standard);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-muted);
}

.bookings-empty strong
{
    color: var(--color-text);
}

/*
 * Archive is intentionally quieter than the live booking views. Each direction
 * remains separately labelled so old incoming work cannot be confused with old
 * bookings the current user made with someone else.
 */
.bookings-archive
{
    padding: var(--space-md);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface-subtle);
}

.bookings-archive-section
{
    margin-top: var(--space-lg);
}

.bookings-archive-section[hidden]
{
    display: none;
}

.bookings-archive-header
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-sm);
    border-bottom: var(--border-thin);
}

.bookings-archive-section h3
{
    margin-bottom: 0;
    font-size: 1rem;
}

.bookings-archive .booking-card
{
    background: var(--color-surface);
}

.booking-modal-backdrop
{
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--padding-app);
    background: var(--color-overlay);
}

.booking-modal-backdrop[hidden]
{
    display: none;
}

.booking-modal
{
    width: min(100%, var(--content-narrow-width));
    max-height: calc(100dvh - var(--space-xl));
    overflow-y: auto;
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    box-shadow: var(--shadow-dialog);
}

.booking-modal-header
{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--padding-standard);
    border-bottom: var(--border-thin);
}

.booking-modal-eyebrow
{
    display: block;
    margin-bottom: var(--space-xs);
    color: var(--color-muted);
    font-size: var(--font-size-small);
}

.booking-modal h2
{
    margin-bottom: 0;
    font-size: var(--font-size-heading-small);
}





.booking-modal-body
{
    padding: var(--padding-standard);
}

.booking-detail-grid
{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-md);
}

.booking-detail
{
    min-width: 0;
}

.booking-detail span,
.booking-data-row span
{
    display: block;
    margin-bottom: var(--space-xs);
    color: var(--color-muted);
    font-size: var(--font-size-small);
}

.booking-detail strong,
.booking-data-row strong
{
    display: block;
    overflow-wrap: anywhere;
    color: var(--color-text);
    font-weight: 600;
}

.booking-actions-section,
.booking-data-section
{
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: var(--border-thin);
}

.booking-actions-section h3,
.booking-data-section h3
{
    margin-bottom: var(--space-md);
    font-size: 1rem;
}

.booking-modal-actions
{
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.booking-data-list
{
    display: flex;
    flex-direction: column;
}

.booking-data-row
{
    padding: var(--space-sm) 0;
    border-bottom: var(--border-thin);
}

.booking-data-row:last-child
{
    border-bottom: 0;
}

@media (max-width: 48rem)
{
    .bookings-app
    {
        padding: 0;
    }

    .bookings-header,
    .booking-card
    {
        align-items: stretch;
        flex-direction: column;
    }

    

    .bookings-tabs
    {
        margin-bottom: var(--space-md);
    }

    .bookings-tab
    {
        flex-basis: 8.5rem;
    }

    .booking-card-actions
    {
        justify-content: flex-start;
    }

    .bookings-archive
    {
        padding: var(--space-sm);
    }

    .booking-detail-grid
    {
        grid-template-columns: 1fr;
    }
}

/*
 * Current bookings are grouped by workflow state. Each group is completely
 * hidden when empty so the page only exposes sections that contain useful data.
 * The cancelled/rejected group is intentionally quieter because those records
 * are retained for reference rather than representing work that needs action.
 */
.bookings-status-section
{
    margin-top: var(--space-lg);
}

.bookings-status-section[hidden]
{
    display: none;
}

.bookings-status-header
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-sm);
    border-bottom: var(--border-thin);
}

.bookings-status-header h3
{
    margin: 0;
    color: var(--color-text);
    font-size: 1rem;
}

.bookings-status-section-muted
{
    padding-top: var(--space-sm);
    opacity: 0.82;
}

.bookings-status-section-muted .booking-card
{
    background: var(--color-surface-subtle);
}


/*
 * Booking attachments are stored as private MediaEngine references.
 * The booking modal shows only a compact launcher; the images themselves
 * are loaded by the global image viewer when requested.
 */
.booking-images-section
{
    display: flex;
    flex-direction: column;
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: var(--border-thin);
}

.booking-images-heading
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-xs);
}

.booking-images-heading h3
{
    margin: 0;
    font-size: 1rem;
}

.booking-images-count
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    min-height: 2rem;
    padding: 0 var(--space-xs);
    border: var(--border-thin);
    border-radius: var(--radius-pill);
    background: var(--color-surface-subtle);
    color: var(--color-muted);
    font-size: var(--font-size-small);
    font-weight: 700;
}

.booking-images-helper
{
    margin: 0 0 var(--space-md);
    color: var(--color-muted);
    font-size: var(--font-size-small);
}

.booking-images-button
{
    align-self: flex-start;
}

/* ==========================================================================
   apps/messages/style.css (consolidated)
   ========================================================================== */
/* =============================================================================
 * Daily Rate - Messages mini app
 *
 * The messages application is deliberately height-constrained to the router
 * viewport. The conversation list and active message chain scroll independently
 * rather than increasing the height of the whole page.
 * ============================================================================= */

.messages-app
{
    position: relative;
    display: grid;
    grid-template-columns: minmax(17rem, 22rem) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    background: var(--color-surface);
    border: var(--border-thin);
    border-radius: var(--radius-sm);
}

.messages-app *,
.messages-app *::before,
.messages-app *::after
{
    box-sizing: border-box;
}

/* =============================================================================
 * Conversation list
 * ============================================================================= */

.messages-sidebar
{
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    border-right: var(--border-thin);
    background: var(--color-surface);
}

.messages-sidebar-header
{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex: 0 0 auto;
    gap: var(--space-sm);
    padding: var(--padding-standard);
    border-bottom: var(--border-thin);
}

.messages-sidebar-header h1
{
    margin: 0;
    font-size: 1.45rem;
    line-height: 1.2;
}

.messages-sidebar-header p
{
    margin: 0.25rem 0 0;
    color: var(--color-muted);
    font-size: var(--font-size-small);
}





.messages-filters
{
    display: flex;
    flex: 0 0 auto;
    gap: 0.4rem;
    padding: 0.75rem var(--padding-standard);
    border-bottom: var(--border-thin);
}

.messages-filter
{
    min-height: 2rem;
    padding: 0.2rem 0.8rem;
    border: var(--border-thin);
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
    font-size: var(--font-size-small);
    cursor: pointer;
}

.messages-filter.active
{
    border-color: var(--color-accent-border);
    background: var(--color-accent-soft);
}

.messages-status
{
    flex: 0 0 auto;
    min-height: 0;
    padding: 0 var(--padding-standard);
    color: var(--color-muted);
    font-size: var(--font-size-small);
}

.messages-status:not(:empty)
{
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    border-bottom: var(--border-thin);
}

.messages-list
{
    flex: 1 1 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.messages-list-empty
{
    padding: var(--padding-double) var(--padding-standard);
    color: var(--color-muted);
    text-align: center;
}

.message-list-item
{
    display: grid;
    grid-template-columns: 2.75rem minmax(0, 1fr) auto;
    gap: 0.75rem;
    width: 100%;
    padding: 0.85rem var(--padding-standard);
    border: 0;
    border-bottom: var(--border-thin);
    border-radius: 0;
    background: var(--color-surface);
    color: var(--color-text);
    text-align: left;
    font: inherit;
    box-shadow: none;
    cursor: pointer;
}

.message-list-item:hover,
.message-list-item.active
{
    background: var(--color-bg);
    transform: none;
}

.message-list-item.unread
{
    font-weight: 600;
}

.messages-avatar
{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    flex: 0 0 2.75rem;
    border-radius: 50%;
    background: var(--color-button-bg);
    color: var(--color-text);
    font-weight: 700;
    text-transform: uppercase;
}

.messages-avatar-system
{
    background: var(--color-accent-soft);
}

.message-list-content
{
    min-width: 0;
}

.message-list-top
{
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}

.message-list-user
{
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-list-header
{
    display: block;
    margin-top: 0.1rem;
    overflow: hidden;
    color: var(--color-text);
    font-size: 0.9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-list-preview
{
    display: block;
    margin-top: 0.2rem;
    overflow: hidden;
    color: var(--color-muted);
    font-size: var(--font-size-small);
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-list-time
{
    color: var(--color-muted);
    font-size: 0.75rem;
    font-weight: 400;
    white-space: nowrap;
}

.message-list-meta
{
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.message-unread-count
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.45rem;
    height: 1.45rem;
    padding: 0 0.35rem;
    border-radius: var(--radius-pill);
    background: var(--color-accent);
    font-size: 0.75rem;
    font-weight: 700;
}

/* =============================================================================
 * Selected conversation
 *
 * IMPORTANT: every layer in this chain has min-height: 0 and overflow hidden.
 * That gives .messages-chat-body a fixed amount of remaining space, making it
 * the scroll container instead of allowing the entire mini app to grow.
 * ============================================================================= */

.messages-conversation
{
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    background: var(--color-bg);
}

.messages-empty
{
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    padding: var(--padding-double);
    text-align: center;
}

.messages-empty-icon
{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    margin-bottom: var(--space-sm);
    border-radius: 50%;
    background: var(--color-button-bg);
    font-size: 1.75rem;
}

.messages-empty h2
{
    margin: 0;
}

.messages-empty p
{
    margin: 0.35rem 0 0;
    color: var(--color-muted);
}

.messages-chat,
.messages-system
{
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.messages-chat[hidden],
.messages-system[hidden],
.messages-modal[hidden]
{
    display: none;
}

.messages-chat-header
{
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 0.75rem;
    min-height: 4.4rem;
    padding: 0.65rem var(--padding-standard);
    border-bottom: var(--border-thin);
    background: var(--color-surface);
}

.messages-back
{
    display: none;
    width: 2.5rem;
    height: 2.5rem;
    min-height: 2.5rem;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-size: 1.4rem;
    cursor: pointer;
}

.messages-chat-heading
{
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

.messages-chat-heading strong,
.messages-chat-heading span
{
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.messages-chat-heading span
{
    color: var(--color-muted);
    font-size: var(--font-size-small);
}

/* This is the ONLY scrolling element for a normal message chain. */
.messages-chat-body
{
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: var(--padding-standard);
}

.message-day
{
    display: flex;
    justify-content: center;
    margin: 0.5rem 0 1rem;
}

.message-day span
{
    padding: 0.2rem 0.65rem;
    border: var(--border-thin);
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    color: var(--color-muted);
    font-size: 0.75rem;
}

.message-row
{
    display: flex;
    margin: 0.35rem 0;
}

.message-row.mine
{
    justify-content: flex-end;
}

.message-row.theirs
{
    justify-content: flex-start;
}

.message-bubble
{
    position: relative;
    max-width: min(75%, 42rem);
    padding: 0.55rem 0.7rem 0.35rem;
    border: var(--border-thin);
    border-radius: 0.65rem;
    background: var(--color-surface);
}

.message-row.mine .message-bubble
{
    border-color: var(--color-accent-border);
    background: var(--color-accent-soft);
}

.message-bubble-text
{
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.message-bubble-footer
{
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.message-bubble-time
{
    color: var(--color-muted);
    font-size: 0.7rem;
    white-space: nowrap;
}

.message-read-state
{
    color: var(--color-muted);
    font-size: 0.75rem;
    letter-spacing: -0.12rem;
    white-space: nowrap;
}





/* =============================================================================
 * Reply composer
 * ============================================================================= */

.messages-compose
{
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    flex: 0 0 auto;
    gap: 0.65rem;
    padding: 0.75rem var(--padding-standard);
    border-top: var(--border-thin);
    background: var(--color-surface);
}

.messages-compose textarea,
.messages-modal input,
.messages-modal textarea
{
    width: 100%;
    min-width: 0;
    padding: 0.65rem 0.75rem;
    border: var(--border-thin);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
    font-size: 1rem;
}

.messages-compose textarea
{
    min-height: 2.5rem;
    max-height: 8rem;
    resize: vertical;
}



/* =============================================================================
 * System messages
 * ============================================================================= */

.messages-system-body
{
    flex: 1 1 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: var(--padding-double);
}

.messages-system-card
{
    max-width: 44rem;
    margin: 0 auto;
    padding: var(--padding-double);
    border: var(--border-thin);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
}

.messages-system-message
{
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.messages-system-card time
{
    display: block;
    margin-top: var(--space-md);
    color: var(--color-muted);
    font-size: var(--font-size-small);
}



/* =============================================================================
 * New message modal
 * ============================================================================= */

.messages-modal
{
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--padding-standard);
}

.messages-modal-backdrop
{
    position: absolute;
    inset: 0;
    background: var(--color-overlay);
}

.messages-modal-card
{
    position: relative;
    z-index: 1;
    width: min(34rem, 100%);
    max-height: 90%;
    overflow-y: auto;
    padding: var(--padding-standard);
    border: var(--border-thin);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    box-shadow: var(--shadow-dialog);
}

.messages-modal-header
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.messages-modal-header h2
{
    margin: 0;
}



.messages-modal form
{
    display: grid;
    gap: 0.55rem;
}

.messages-modal label
{
    margin-top: 0.35rem;
    font-weight: 600;
}

.messages-modal-message
{
    min-height: 1.5rem;
    color: var(--color-danger);
    font-size: var(--font-size-small);
}

.messages-modal-actions
{
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    margin-top: 0.5rem;
}





/* =============================================================================
 * Accessibility
 * ============================================================================= */

.visually-hidden
{
    position: absolute;
    width: var(--line-width);
    height: var(--line-width);
    padding: 0;
    margin: calc(var(--line-width) * -1);
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.messages-app button:focus-visible,
.messages-app input:focus-visible,
.messages-app textarea:focus-visible
{
    outline: 0.125rem solid var(--color-border-strong);
    outline-offset: 0.125rem;
}

/* =============================================================================
 * Mobile
 *
 * The entire mini app still remains the height of #viewport. When a chain is
 * opened, the list is swapped for the conversation without changing page
 * height. The message body remains independently scrollable.
 * ============================================================================= */

@media (max-width: 50rem)
{
    .messages-app
    {
        display: block;
        width: 100%;
        height: 100%;
        min-height: 0;
        max-height: 100%;
    }

    .messages-sidebar
    {
        width: 100%;
        height: 100%;
        min-height: 0;
        border-right: 0;
    }

    .messages-conversation
    {
        display: none;
        width: 100%;
        height: 100%;
        min-height: 0;
    }

    .messages-app.chat-open .messages-sidebar
    {
        display: none;
    }

    .messages-app.chat-open .messages-conversation
    {
        display: flex;
    }

    .messages-back
    {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .message-bubble
    {
        max-width: 88%;
    }

    .messages-system-body
    {
        padding: var(--padding-standard);
    }

    .messages-system-card
    {
        padding: var(--padding-standard);
    }
}

@media (max-width: 34rem)
{
    .messages-sidebar-header
    {
        align-items: stretch;
        flex-direction: column;
    }

    

    .messages-filters
    {
        overflow-x: auto;
    }

    .messages-compose
    {
        grid-template-columns: minmax(0, 1fr);
    }

    

    .messages-modal-actions
    {
        flex-direction: column-reverse;
    }

    
}

/* ==========================================================================
   apps/home/style.css (consolidated)
   ========================================================================== */
/* ========================================================================== */
/* Public home page                                                           */
/* ========================================================================== */

.home-public
{
    --home-accent-soft: color-mix(in srgb, var(--color-accent) 12%, transparent);
    --home-accent-medium: color-mix(in srgb, var(--color-accent) 24%, transparent);
    width: min(100%, var(--mini-app-max-width));
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: clamp(3rem, 7vw, 6rem);
}

.home-hero
{
    position: relative;
    isolation: isolate;
    min-height: clamp(34rem, 72vh, 46rem);
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(18rem, 0.95fr);
    align-items: center;
    gap: clamp(2rem, 5vw, 5rem);
    overflow: hidden;
    padding: clamp(2rem, 6vw, 5rem);
    background:
        linear-gradient(
            135deg,
            color-mix(in srgb, var(--color-surface) 94%, var(--color-accent)),
            var(--color-surface)
        );
    border: var(--line-width) solid var(--color-border);
    border-radius: clamp(1.25rem, 3vw, 2.25rem);
    box-shadow: 0 1.5rem 4rem color-mix(in srgb, var(--color-text) 10%, transparent);
}

.home-hero-grid
{
    position: absolute;
    inset: 0;
    z-index: -3;
    opacity: 0.35;
    background-image:
        linear-gradient(to right, var(--home-accent-soft) var(--line-width), transparent var(--line-width)),
        linear-gradient(to bottom, var(--home-accent-soft) var(--line-width), transparent var(--line-width));
    background-size: 2.5rem 2.5rem;
    mask-image: linear-gradient(to right, var(--color-black), transparent 78%);
}

.home-hero-glow
{
    position: absolute;
    z-index: -2;
    width: 22rem;
    aspect-ratio: 1;
    border-radius: 50%;
    filter: blur(1.5rem);
    opacity: 0.55;
}

.home-hero-glow-one
{
    top: -8rem;
    left: -7rem;
    background: var(--home-accent-medium);
}

.home-hero-glow-two
{
    right: -8rem;
    bottom: -10rem;
    background: color-mix(in srgb, var(--color-success) 20%, transparent);
}

.home-hero-copy
{
    position: relative;
    z-index: 2;
}

.home-kicker,
.home-eyebrow,
.home-panel-kicker
{
    margin: 0 0 var(--spacing-small);
    color: var(--color-accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.home-hero h1
{
    max-width: 43rem;
    margin: 0;
    color: var(--color-text);
    font-size: clamp(2.6rem, 6vw, 5.2rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.home-hero h1 span
{
    display: block;
    margin-top: 0.2em;
    color: var(--color-accent);
}

.home-hero-text
{
    max-width: 38rem;
    margin: clamp(1.4rem, 3vw, 2rem) 0 0;
    color: var(--color-muted);
    font-size: clamp(1rem, 1.7vw, 1.15rem);
    line-height: 1.75;
}

.home-hero-actions
{
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-medium);
    margin-top: clamp(1.6rem, 4vw, 2.5rem);
}















.home-hero-points
{
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem 1.2rem;
    margin-top: 2rem;
    color: var(--color-muted);
    font-size: 0.82rem;
    font-weight: 650;
}

.home-hero-points span
{
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
}

.home-hero-points strong
{
    color: var(--color-success);
}

.home-preview
{
    position: relative;
    z-index: 2;
    width: min(100%, 27rem);
    justify-self: end;
    padding: 1.35rem;
    color: var(--color-text);
    background: color-mix(in srgb, var(--color-surface) 92%, transparent);
    border: var(--line-width) solid color-mix(in srgb, var(--color-border) 78%, transparent);
    border-radius: 1.4rem;
    box-shadow: 0 2rem 5rem color-mix(in srgb, var(--color-text) 14%, transparent);
    backdrop-filter: blur(1rem);
    transform: rotate(1.5deg);
    animation: home-preview-float 6s ease-in-out infinite;
}

.home-preview::before
{
    content: "";
    position: absolute;
    inset: -0.8rem;
    z-index: -1;
    background: var(--home-accent-soft);
    border-radius: 1.8rem;
    transform: rotate(-3deg);
}

.home-preview-header,
.home-preview-title,
.home-preview-booking,
.home-preview-message
{
    display: flex;
    align-items: center;
}

.home-preview-header
{
    justify-content: space-between;
    gap: 1rem;
}

.home-preview-header p
{
    margin: 0;
    color: var(--color-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.home-preview-header div > strong
{
    display: block;
    margin-top: 0.15rem;
    font-size: 2rem;
    letter-spacing: -0.04em;
}

.home-preview-header > span
{
    padding: 0.4rem 0.65rem;
    color: var(--color-success);
    background: color-mix(in srgb, var(--color-success) 12%, transparent);
    border-radius: 99rem;
    font-size: 0.76rem;
    font-weight: 800;
}

.home-preview-chart
{
    height: 8rem;
    display: flex;
    align-items: end;
    gap: 0.45rem;
    margin: 1.4rem 0;
    padding: 0.8rem;
    background: color-mix(in srgb, var(--color-bg) 75%, transparent);
    border-radius: 0.9rem;
}

.home-preview-chart i
{
    flex: 1;
    height: var(--bar-height);
    min-height: 0.5rem;
    background:
        linear-gradient(
            to top,
            var(--color-accent),
            color-mix(in srgb, var(--color-accent) 68%, var(--color-white))
        );
    border-radius: 0.35rem 0.35rem 0.16rem 0.16rem;
}

.home-preview-title
{
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1rem;
    border-top: var(--line-width) solid var(--color-border);
    color: var(--color-muted);
    font-size: 0.78rem;
    font-weight: 750;
}

.home-preview-title strong
{
    min-width: 1.6rem;
    min-height: 1.6rem;
    display: grid;
    place-items: center;
    color: var(--color-accent);
    background: var(--home-accent-soft);
    border-radius: 50%;
}

.home-preview-booking
{
    gap: 0.7rem;
    margin-top: 0.8rem;
    padding: 0.75rem;
    background: color-mix(in srgb, var(--color-bg) 72%, transparent);
    border-radius: 0.8rem;
}

.home-preview-avatar
{
    width: 2.35rem;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: var(--color-button-text);
    background: var(--color-accent);
    border-radius: 0.65rem;
    font-size: 0.7rem;
    font-weight: 850;
}

.home-preview-booking > div:nth-child(2)
{
    min-width: 0;
    flex: 1;
}

.home-preview-booking strong,
.home-preview-booking span
{
    display: block;
}

.home-preview-booking strong
{
    overflow: hidden;
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-preview-booking span
{
    margin-top: 0.18rem;
    color: var(--color-muted);
    font-size: 0.68rem;
}

.home-preview-booking em
{
    flex: 0 0 auto;
    color: var(--color-success);
    font-size: 0.66rem;
    font-style: normal;
    font-weight: 800;
}

.home-preview-message
{
    gap: 0.65rem;
    margin-top: 0.8rem;
    padding: 0.75rem;
    border: var(--line-width) solid var(--color-border);
    border-radius: 0.8rem;
}

.home-preview-dot
{
    width: 0.55rem;
    aspect-ratio: 1;
    flex: 0 0 auto;
    background: var(--color-accent);
    border-radius: 50%;
    box-shadow: 0 0 0 0.3rem var(--home-accent-soft);
}

.home-preview-message div
{
    min-width: 0;
    flex: 1;
}

.home-preview-message strong,
.home-preview-message div span
{
    display: block;
}

.home-preview-message strong
{
    font-size: 0.74rem;
}

.home-preview-message div span,
.home-preview-message small
{
    margin-top: 0.15rem;
    color: var(--color-muted);
    font-size: 0.66rem;
}

.home-preview-message div span
{
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-public-content
{
    display: grid;
    grid-template-columns: minmax(14rem, 0.7fr) minmax(0, 1.3fr);
    gap: clamp(2rem, 6vw, 5rem);
    align-items: start;
}

.home-public-intro
{
    position: sticky;
    top: 2rem;
}

.home-public-intro h2,
.home-signup h2
{
    margin: 0;
    color: var(--color-text);
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.home-public-intro > p:last-child,
.home-signup p
{
    margin: 1rem 0 0;
    color: var(--color-muted);
    line-height: 1.7;
}

.home-features
{
    display: grid;
    gap: 1rem;
}

.home-feature
{
    position: relative;
    min-height: 12rem;
    padding: clamp(1.4rem, 3vw, 2rem);
    overflow: hidden;
    background: var(--color-surface);
    border: var(--line-width) solid var(--color-border);
    border-radius: var(--radius-large);
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease;
}

.home-feature:hover
{
    transform: translateY(-0.18rem);
    border-color: var(--home-accent-medium);
    box-shadow: 0 0.7rem 2rem color-mix(in srgb, var(--color-text) 7%, transparent);
}

.home-feature-number
{
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    color: color-mix(in srgb, var(--color-muted) 30%, transparent);
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: -0.06em;
}

.home-feature-icon
{
    width: 3rem;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    margin-bottom: 1.3rem;
    color: var(--color-accent);
    background: var(--home-accent-soft);
    border-radius: 0.8rem;
    font-size: 1.3rem;
    font-weight: 800;
}

.home-feature h3
{
    margin: 0;
    color: var(--color-text);
    font-size: 1.05rem;
}

.home-feature p
{
    max-width: 36rem;
    margin: 0.65rem 0 0;
    color: var(--color-muted);
    line-height: 1.65;
}

.home-signup
{
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    overflow: hidden;
    padding: clamp(2rem, 5vw, 3.5rem);
    background:
        linear-gradient(
            135deg,
            color-mix(in srgb, var(--color-accent) 10%, var(--color-surface)),
            var(--color-surface)
        );
    border: var(--line-width) solid var(--color-border);
    border-radius: clamp(1.2rem, 3vw, 2rem);
}

.home-signup::after
{
    content: "";
    position: absolute;
    right: -5rem;
    bottom: -8rem;
    width: 18rem;
    aspect-ratio: 1;
    background: var(--home-accent-soft);
    border-radius: 50%;
}

.home-signup > *
{
    position: relative;
    z-index: 1;
}

.home-signup > .dr-button
{
    flex: 0 0 auto;
}

@keyframes home-preview-float
{
    0%,
    100%
    {
        transform: translateY(0) rotate(1.5deg);
    }

    50%
    {
        transform: translateY(-0.7rem) rotate(0.4deg);
    }
}

/* ========================================================================== */
/* Responsive                                                                 */
/* ========================================================================== */

@media (max-width: 58rem)
{
    .home-hero
    {
        grid-template-columns: 1fr;
    }

    .home-preview
    {
        width: min(100%, 32rem);
        justify-self: center;
    }

    .home-public-content
    {
        grid-template-columns: 1fr;
    }

    .home-public-intro
    {
        position: static;
    }
}

@media (max-width: 52rem)
{
    .home-signup
    {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 36rem)
{
    .home-public
    {
        gap: 3rem;
    }

    .home-hero
    {
        min-height: auto;
        padding: 1.5rem;
        border-radius: 1.2rem;
    }

    .home-hero h1
    {
        font-size: clamp(2.35rem, 14vw, 3.4rem);
    }

    .home-hero-actions
    {
        align-items: stretch;
        flex-direction: column;
    }

    .home-hero-actions .dr-button
    {
        width: 100%;
    }

    .home-hero-points
    {
        align-items: flex-start;
        flex-direction: column;
    }

    .home-preview
    {
        padding: 1rem;
        transform: none;
        animation: none;
    }

    .home-preview::before,
    .home-preview-booking em
    {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce)
{
    .home-preview
    {
        animation: none;
    }

    .home-feature
    {
        transition: none;
    }
}

/* ==========================================================================
   apps/projects/style.css (consolidated)
   ========================================================================== */
/*
 * Projects use the shared Daily Rate dr-* component system in /frontend/style.css.
 * Keep this file for the router contract; add rules here only for truly unique
 * page behaviour that cannot be represented by a shared component.
 */

/* ==========================================================================
   apps/projects/project/style.css (consolidated)
   ========================================================================== */
/*
 * Projects use the shared Daily Rate dr-* component system in /frontend/style.css.
 * Keep this file for the router contract; add rules here only for truly unique
 * page behaviour that cannot be represented by a shared component.
 */


/* ==========================================================================\n   Daily Rate site-wide component standardisation\n   ========================================================================== */
:root
{
    /* Relative measurement primitives. */
    --line-width: 0.0625rem;
    --focus-width: 0.125rem;
    --focus-offset: 0.125rem;
    --control-height: 2.75rem;
    --control-height-large: 3rem;
    --control-padding-y: 0.625rem;
    --control-padding-x: 0.875rem;
    --control-gap: var(--space-xs);

    /* Canonical action button system. */
    --button-height: var(--control-height);
    --button-padding-block: var(--control-padding-y);
    --button-padding-inline: var(--control-padding-x);
    --button-gap: var(--control-gap);
    --button-radius: var(--radius-sm);
    --button-font-size: var(--font-size-small);
    --button-font-weight: 700;
    --button-icon-font-size: var(--font-size-heading-small);
    --button-border-width: var(--line-width);
    --button-border-color: var(--color-button-border);
    --button-background: var(--color-surface);
    --button-background-hover: var(--color-accent-soft);
    --button-text: var(--color-text);
    --button-shadow: var(--shadow-control);
    --button-shadow-hover: var(--shadow-control-hover);
    --button-hover-lift: -0.0625rem;
    --button-primary-background: var(--color-accent);
    --button-primary-background-hover: var(--color-accent-hover);
    --button-primary-border: var(--color-accent-border);
    --button-primary-text: var(--color-accent-text);
    --button-success-background: var(--color-success-surface);
    --button-success-border: var(--color-success);
    --button-success-text: var(--color-success);
    --button-danger-background: var(--color-danger-surface);
    --button-danger-border: var(--color-danger);
    --button-danger-text: var(--color-danger);
    --button-warning-background: var(--color-warning-transparent);
    --button-warning-border: var(--color-warning);
    --button-warning-text: var(--color-warning);
    --field-gap: var(--space-2xs);
    --form-gap: var(--space-md);
    --section-gap: var(--space-lg);
    --panel-padding: var(--space-md);
    --card-padding: var(--space-md);
    --textarea-min-height: 7rem;
    --checkbox-size: 1.125rem;
    --auth-card-width: 28rem;
    --auth-card-wide-width: 44rem;
    --table-cell-padding-y: 0.75rem;
    --table-cell-padding-x: var(--space-sm);
    --image-thumb-size: 3rem;
    --modal-gutter: var(--space-md);
    --modal-max-height: calc(100dvh - (2 * var(--modal-gutter)));
    --z-modal: 4000;
    --z-gallery: 5000;
    --color-control-disabled: color-mix(in srgb, var(--color-surface-subtle) 82%, var(--color-border));
    --color-focus-ring: color-mix(in srgb, var(--color-accent) 36%, transparent);
    --color-image-stage: #111111;
    --color-gallery-overlay: rgb(0 0 0 / 78%);
    --color-gallery-control: rgb(255 255 255 / 90%);
    --shadow-modal: 0 1rem 3rem rgb(0 0 0 / 28%);
}

/* One predictable vertical rhythm for headings and copy. */
h1,
h2,
h3,
p
{
    overflow-wrap: anywhere;
}

h1
{
    font-size: var(--font-size-heading-large);
}

h2
{
    font-size: var(--font-size-heading-medium);
}

h3
{
    font-size: var(--font-size-heading-small);
}

/* Shared form controls. */
label
{
    color: var(--color-text);
    line-height: var(--line-height-heading);
}

input,
select,
textarea
{
    min-height: var(--control-height);
    padding: var(--control-padding-y) var(--control-padding-x);
    border: var(--border-thin);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    line-height: var(--line-height-heading);
    box-shadow: none;
    transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

textarea
{
    min-height: var(--textarea-min-height);
    line-height: var(--line-height-body);
}

input:hover:not(:disabled),
select:hover:not(:disabled),
textarea:hover:not(:disabled)
{
    border-color: var(--color-border-strong);
}

input:focus,
select:focus,
textarea:focus
{
    border-color: var(--color-border-strong);
    outline: var(--focus-width) solid var(--color-focus-ring);
    outline-offset: var(--focus-offset);
}

input:disabled,
select:disabled,
textarea:disabled
{
    background: var(--color-control-disabled);
    color: var(--color-muted);
    cursor: not-allowed;
}

input::placeholder,
textarea::placeholder
{
    color: var(--color-muted);
    opacity: 0.82;
}

input[type="checkbox"],
input[type="radio"]
{
    width: var(--checkbox-size);
    height: var(--checkbox-size);
    min-height: 0;
    flex: 0 0 var(--checkbox-size);
    padding: 0;
    accent-color: var(--color-accent);
}

input[type="file"]
{
    min-height: 0;
    padding: var(--space-xs);
}

button
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--control-gap);
    min-height: var(--control-height);
    line-height: var(--line-height-heading);
}







/* Shared page and surface composition. */
.dr-page-shell
{
    display: flex;
    justify-content: center;
    width: 100%;
    min-height: 100%;
}

.dr-page
{
    width: 100%;
    max-width: var(--mini-app-max-width);
    min-width: 0;
    margin-inline: auto;
}

.dr-page-narrow
{
    max-width: var(--content-narrow-width);
}

.dr-header,
.dr-page-header
{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.dr-header > :first-child,
.dr-page-header > :first-child
{
    min-width: 0;
}

.dr-header h1,
.dr-page-header h1
{
    margin: 0;
}

.dr-header p,
.dr-page-header p
{
    max-width: 58rem;
    margin: var(--space-xs) 0 0;
    color: var(--color-muted);
}

.dr-surface,
.dr-panel,
.dr-card
{
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.dr-surface
{
    overflow: hidden;
}

.dr-surface-header,
.dr-surface-footer,
.dr-modal-header,
.dr-modal-body
{
    padding: var(--panel-padding);
}

.dr-surface-header
{
    border-bottom: var(--border-thin);
}

.dr-surface-footer
{
    border-top: var(--border-thin);
}

.dr-surface-header h1,
.dr-surface-header h2,
.dr-surface-header p,
.dr-surface-footer p
{
    margin-top: 0;
}

.dr-surface-header > :last-child,
.dr-surface-footer > :last-child
{
    margin-bottom: 0;
}

.dr-auth-shell
{
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    min-height: 100%;
    padding-block: var(--space-lg);
}

.dr-auth-card
{
    width: min(100%, var(--auth-card-width));
    box-shadow: var(--shadow-small);
}

.dr-auth-card-wide
{
    width: min(100%, var(--auth-card-wide-width));
}

/* Shared forms and field groups. */
.dr-form
{
    display: grid;
    gap: var(--form-gap);
    margin: 0;
}

.dr-surface > .dr-form
{
    padding: var(--panel-padding);
}

.dr-form-compact
{
    gap: var(--space-sm);
}

.dr-field,
.dr-form label:not(.dr-check):not(.dr-check-row),
.dr-filter-bar label
{
    display: grid;
    gap: var(--field-gap);
    min-width: 0;
    margin: 0;
    font-weight: 600;
}

.dr-field > label,
.dr-form label > span:first-child,
.dr-filter-bar label > span:first-child
{
    font-size: var(--font-size-small);
    font-weight: 700;
}

.dr-form-row
{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-sm);
}

.dr-help,
.dr-form small
{
    color: var(--color-muted);
    font-size: var(--font-size-small);
    font-weight: 400;
    line-height: var(--line-height-body);
}

.dr-actions,
.dr-inline-actions,
.dr-form-actions
{
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.dr-form-actions
{
    justify-content: flex-end;
}

.dr-status-message
{
    padding: var(--space-sm);
    border: var(--border-thin);
    border-radius: var(--radius-sm);
    background: var(--color-surface-subtle);
    color: var(--color-text);
}

.dr-status-message:empty
{
    display: none;
}

/* Search/tool bars align every control on the same baseline. */
.dr-filter-bar,
.dr-toolbar
{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
    gap: var(--space-sm);
    align-items: end;
    margin: 0 0 var(--space-lg);
    padding: var(--panel-padding);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.dr-filter-bar > button,
.dr-toolbar > button
{
    align-self: end;
}

/* Sections/cards/lists use one spacing model. */
.dr-section
{
    margin-top: var(--section-gap);
}

.dr-section:first-child
{
    margin-top: 0;
}

.dr-stack
{
    display: grid;
    gap: var(--space-sm);
}

.dr-grid
{
    gap: var(--space-sm);
}

.dr-panel,
.dr-card
{
    padding: var(--card-padding);
}

.dr-empty,
.dr-empty-state
{
    padding: var(--space-lg);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-muted);
    text-align: center;
}

/* Tabs are compact controls, not full-sized raised buttons. */
.dr-tabs
{
    display: flex;
    align-items: center;
    gap: var(--space-2xs);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-xs);
    overflow-x: auto;
    border-bottom: var(--border-thin);
}

.dr-tab
{
    flex: 0 0 auto;
    min-height: var(--control-height);
    box-shadow: none;
    white-space: nowrap;
}

.dr-tab[aria-pressed="true"],
.dr-tab[aria-selected="true"],
.dr-tab.active,
.dr-tab-active
{
    border-color: var(--color-accent-border);
    background: var(--color-accent-soft);
}

/* Reusable tables. */
.dr-table-wrap
{
    width: 100%;
    overflow-x: auto;
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.dr-table
{
    width: 100%;
    border-collapse: collapse;
}

.dr-table th,
.dr-table td
{
    padding: var(--table-cell-padding-y) var(--table-cell-padding-x);
    border-bottom: var(--border-thin);
    text-align: left;
    vertical-align: middle;
}

.dr-table th
{
    background: var(--color-surface-subtle);
    color: var(--color-muted);
    font-size: var(--font-size-tiny);
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dr-table tbody tr:last-child td
{
    border-bottom: 0;
}

/* Shared modal geometry. Page-specific modal content only controls internals. */
.dr-modal-layer,
.dr-modal-backdrop
{
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
}

.dr-modal-backdrop
{
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--modal-gutter);
    background: var(--color-overlay);
}

.dr-modal
{
    width: min(100%, var(--content-narrow-width));
    max-height: var(--modal-max-height);
    overflow: auto;
    border: var(--border-thin);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    box-shadow: var(--shadow-modal);
}

.dr-modal-header
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    border-bottom: var(--border-thin);
}

.dr-modal-header h2
{
    margin: 0;
}

/* Bring legacy pages onto the same rhythm without requiring JS rewrites. */
.login-field,
.registration-field,
.verification-field,
.profile-field,
.users-search-field
{
    gap: var(--field-gap);
    margin: 0;
}

#login-form,
.registration-form,
.verification-form,
#profile-form,
#profile-alert-form,
#messages-new-form
{
    gap: var(--form-gap);
}

.registration-header,
.registration-form,
.registration-footer,
.verification-header,
.verification-form,
.verification-footer
{
    padding: var(--panel-padding);
}

.registration-field input,
.verification-field input
{
    min-height: var(--control-height);
    padding: var(--control-padding-y) var(--control-padding-x);
}



.users-search,
.accounts-section-actions,
.bookings-panel-header,
.booking-card-actions,
.messages-modal-actions,
.profile-avatar-actions
{
    gap: var(--space-xs);
}

.accounts-filter
{
    min-width: 11rem;
}


/* Shared panel child rhythm keeps headings, forms and galleries separated. */
.dr-panel-heading + .dr-form,
.dr-panel-heading + .dr-inline-form,
.dr-panel-heading + .dr-stack,
.dr-panel-heading + .dr-gallery,
.dr-panel-heading + .dr-messages,
.dr-panel-heading + .dr-team
{
    margin-top: var(--space-md);
}

.dr-panel > .dr-description:first-of-type,
.dr-panel > .dr-meta + .dr-description
{
    margin-top: var(--space-sm);
}

/* Gallery viewer is always viewport-level. */
.dr-image-viewer-overlay
{
    z-index: var(--z-gallery);
}

@media (max-width: 48rem)
{
    .dr-auth-shell
    {
        padding-block: 0;
    }

    .dr-auth-card,
    .dr-auth-card-wide
    {
        width: 100%;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .dr-form-row
    {
        grid-template-columns: 1fr;
    }

    .dr-header,
    .dr-page-header,
    .dr-section-heading
    {
        align-items: stretch;
        flex-direction: column;
    }

    .dr-header > button,
    .dr-page-header > button
    {
        width: 100%;
    }
}

@media (max-width: 36rem)
{
    .dr-actions,
    .dr-form-actions
    {
        align-items: stretch;
        flex-direction: column;
    }

    .dr-actions > button,
    .dr-actions > a,
    .dr-form-actions > button,
    .dr-form-actions > a
    {
        width: 100%;
    }
}

/* Project team member cards. Team identity is rendered only for project participants. */
.dr-member-profile
{
    display: block;
    min-width: 0;
    padding: var(--space-2xs);
    border-radius: var(--radius-sm);
    color: inherit;
    text-decoration: none;
}

.dr-member-profile:hover
{
    background: var(--color-accent-soft);
}

.dr-member-profile:focus-visible
{
    outline: var(--focus-width) solid var(--color-focus-ring);
    outline-offset: var(--focus-offset);
}

.dr-member-actions
{
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.dr-member-actions > button
{
    flex: 1 1 auto;
}

.dr-layout-sidebar.dr-layout-single
{
    grid-template-columns: minmax(0, 1fr);
}



@media (max-width: 48rem)
{
    .dr-section-heading > .dr-button
    {
        width: 100%;
    }
}

/* ==========================================================================
   Canonical Daily Rate action buttons
   ==========================================================================
   Conventional actions use exactly one geometry/interaction system. Mini-app
   classes may position a button, but must not redefine its visual treatment.
   Tabs, gallery thumbnails, message-list rows and similar selection controls
   are separate components rather than action buttons.
 */
button.dr-button,
a.dr-button
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--button-gap);
    width: auto;
    min-width: 0;
    min-height: var(--button-height);
    padding: var(--button-padding-block) var(--button-padding-inline);
    border: var(--button-border-width) solid var(--button-border-color);
    border-radius: var(--button-radius);
    background: var(--button-background);
    color: var(--button-text);
    font-family: var(--font-family-base);
    font-size: var(--button-font-size);
    font-weight: var(--button-font-weight);
    line-height: var(--line-height-heading);
    text-align: center;
    text-decoration: none;
    box-shadow: var(--button-shadow);
    cursor: pointer;
    transition:
        background var(--transition-fast),
        border-color var(--transition-fast),
        color var(--transition-fast),
        box-shadow var(--transition-fast),
        transform var(--transition-fast);
}

button.dr-button:hover:not(:disabled),
a.dr-button:hover
{
    border-color: var(--color-accent-border);
    background: var(--button-background-hover);
    color: var(--button-text);
    box-shadow: var(--button-shadow-hover);
    transform: translateY(var(--button-hover-lift));
}

button.dr-button:active:not(:disabled),
a.dr-button:active
{
    box-shadow: var(--button-shadow);
    transform: translateY(0);
}

button.dr-button:disabled,
.dr-button[aria-disabled="true"]
{
    cursor: default;
    opacity: 0.55;
    transform: none;
}

button.dr-button.dr-button-primary,
a.dr-button.dr-button-primary
{
    border-color: var(--button-primary-border);
    background: var(--button-primary-background);
    color: var(--button-primary-text);
}

button.dr-button.dr-button-primary:hover:not(:disabled),
a.dr-button.dr-button-primary:hover
{
    border-color: var(--button-primary-border);
    background: var(--button-primary-background-hover);
    color: var(--button-primary-text);
}

button.dr-button.dr-button-secondary,
a.dr-button.dr-button-secondary
{
    border-color: var(--button-border-color);
    background: var(--button-background);
    color: var(--button-text);
}

button.dr-button.dr-button-success,
a.dr-button.dr-button-success
{
    border-color: var(--button-success-border);
    background: var(--button-success-background);
    color: var(--button-success-text);
}

button.dr-button.dr-button-danger,
a.dr-button.dr-button-danger
{
    border-color: var(--button-danger-border);
    background: var(--button-danger-background);
    color: var(--button-danger-text);
}

button.dr-button.dr-button-warning,
a.dr-button.dr-button-warning
{
    border-color: var(--button-warning-border);
    background: var(--button-warning-background);
    color: var(--button-warning-text);
}

button.dr-button.dr-button-success:hover:not(:disabled),
a.dr-button.dr-button-success:hover
{
    border-color: var(--button-success-border);
    background: color-mix(in srgb, var(--button-success-background) 78%, var(--button-success-border));
    color: var(--button-success-text);
}

button.dr-button.dr-button-danger:hover:not(:disabled),
a.dr-button.dr-button-danger:hover
{
    border-color: var(--button-danger-border);
    background: color-mix(in srgb, var(--button-danger-background) 78%, var(--button-danger-border));
    color: var(--button-danger-text);
}

button.dr-button.dr-button-warning:hover:not(:disabled),
a.dr-button.dr-button-warning:hover
{
    border-color: var(--button-warning-border);
    background: color-mix(in srgb, var(--button-warning-background) 78%, var(--button-warning-border));
    color: var(--button-warning-text);
}

button.dr-button.dr-button-icon,
a.dr-button.dr-button-icon
{
    width: var(--button-height);
    min-width: var(--button-height);
    height: var(--button-height);
    min-height: var(--button-height);
    flex: 0 0 var(--button-height);
    padding: 0;
    font-size: var(--button-icon-font-size);
}

button.dr-button.dr-button-block,
a.dr-button.dr-button-block
{
    width: 100%;
}

button.dr-button.dr-button-selected,
a.dr-button.dr-button-selected
{
    box-shadow:
        var(--button-shadow),
        inset 0 0 0 var(--focus-width) var(--color-border-strong);
}


/* Image-viewer arrows use the standard button visuals while retaining stage positioning. */
button.dr-button.dr-image-viewer-nav,
button.dr-button.dr-image-viewer-nav:hover:not(:disabled),
button.dr-button.dr-image-viewer-nav:active:not(:disabled)
{
    transform: translateY(-50%);
}

/* ==========================================================================
   Unified page heading system
   ========================================================================== */
:root
{
    --page-header-padding-block: var(--space-md);
    --page-header-padding-inline: var(--space-lg);
    --page-header-accent-width: 0.3125rem;
    --page-header-title-size: var(--font-size-heading-large);
    --page-header-copy-width: 58rem;
    --page-header-avatar-size: 6rem;
    --page-header-action-gap: var(--space-xs);
    --page-header-background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-surface-subtle) 100%);
    /* Use the viewport's actual gutter: desktop is 1.5rem, mobile 1rem.
       The old desktop-only formula added 16px of horizontal overflow on phones. */
    --page-header-viewport-width: calc(100cqw + 2 * var(--viewport-padding-inline));
    --page-header-breakout-margin: calc((100% - var(--page-header-viewport-width)) / 2);
}

.dr-page-header
{
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
    width: var(--page-header-viewport-width);
    min-width: 0;
    max-width: none;
    margin-block: calc(-1 * var(--space-md)) var(--space-lg);
    margin-inline: var(--page-header-breakout-margin);
    padding: var(--page-header-padding-block) var(--page-header-padding-inline);
    overflow: hidden;
    border: 0;
    border-bottom: var(--border-thin);
    border-radius: 0;
    background: var(--page-header-background);
    box-shadow: none;
}

.dr-page-header::before
{
    content: none;
}

.dr-page-header > :first-child
{
    min-width: 0;
}

.dr-page-header h1
{
    margin: 0;
    color: var(--color-text);
    font-size: var(--page-header-title-size);
    line-height: var(--line-height-heading);
    overflow-wrap: anywhere;
}

.dr-page-header p
{
    max-width: var(--page-header-copy-width);
    margin: var(--space-xs) 0 0;
    color: var(--color-muted);
}

.dr-page-header .dr-kicker
{
    margin: 0 0 var(--space-2xs) !important;
    color: var(--color-warning);
}

.dr-page-header .dr-badges
{
    margin: var(--space-xs) 0;
}

.dr-page-header-actions,
.dr-page-header > .dr-actions
{
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: var(--page-header-action-gap);
}

.dr-page-header-identity
{
    display: flex;
    align-items: center;
    min-width: 0;
    gap: var(--space-md);
}

/* Public user profiles use the same heading sector without turning the avatar
 * into a second independent page layout. */
.user-header.dr-page-header
{
    align-items: center;
}

.user-header.dr-page-header .user-avatar
{
    width: var(--page-header-avatar-size);
    max-width: none;
    flex: 0 0 var(--page-header-avatar-size);
    margin: 0;
}

.user-header.dr-page-header .user-location
{
    margin: var(--space-xs) 0 0;
}

/* Dashboard keeps its date as the page-level action/meta area. */
.home-header.dr-page-header
{
    align-items: center;
    margin-bottom: 0;
}

.home-header.dr-page-header h1
{
    font-size: var(--page-header-title-size);
    line-height: var(--line-height-heading);
}

.home-header.dr-page-header .home-date
{
    max-width: 18rem;
}

.home-header.dr-page-header .home-eyebrow
{
    color: var(--color-warning);
}

/* Messages remains height-constrained, but its heading is now a normal
 * full-width page heading above the two-pane message workspace. */
.messages-app
{
    grid-template-rows: auto minmax(0, 1fr);
    row-gap: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.messages-page-header
{
    grid-column: 1 / -1;
    grid-row: 1;
}

.messages-sidebar
{
    grid-column: 1;
    grid-row: 2;
    border: var(--border-thin);
    border-right: 0;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.messages-conversation
{
    grid-column: 2;
    grid-row: 2;
    border: var(--border-thin);
    border-left: 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* Auth pages use the same title/kicker/copy hierarchy, adapted to the smaller
 * authentication card rather than nesting a full page panel inside a panel. */
.dr-auth-page-header
{
    position: relative;
    background: var(--color-surface-subtle);
    border-left: var(--page-header-accent-width) solid var(--color-accent);
}

.dr-auth-page-header h1
{
    margin: 0;
    font-size: var(--font-size-heading-medium);
    line-height: var(--line-height-heading);
}

.dr-auth-page-header p
{
    margin: var(--space-xs) 0 0;
    color: var(--color-muted);
}

.login-header.dr-auth-page-header
{
    margin: calc(var(--padding-double) * -1) calc(var(--padding-double) * -1) var(--space-md);
    padding: var(--panel-padding);
    border-bottom: var(--border-thin);
}

/* Legacy page-specific header rules must not reintroduce different title
 * sizing or spacing once a page has joined the shared heading system. */
.accounts-header.dr-page-header,
.alerts-header.dr-page-header,
.bookings-header.dr-page-header,
.users-header.dr-page-header,
.profile-page-header.dr-page-header
{
    align-items: center;
    margin-bottom: var(--space-lg);
}

.accounts-header.dr-page-header h1,
.alerts-header.dr-page-header h1,
.bookings-header.dr-page-header h1,
.users-header.dr-page-header h1
{
    margin: 0;
    font-size: var(--page-header-title-size);
    line-height: var(--line-height-heading);
}

.accounts-header.dr-page-header p,
.alerts-header.dr-page-header p,
.bookings-header.dr-page-header p,
.users-header.dr-page-header p
{
    margin-top: var(--space-xs);
}

@media (max-width: 50rem)
{
    .messages-app
    {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
        row-gap: 0;
        width: 100%;
        height: 100%;
        min-height: 0;
        max-height: 100%;
    }

    .messages-page-header,
    .messages-sidebar,
    .messages-conversation
    {
        grid-column: 1;
    }

    .messages-page-header
    {
        grid-row: 1;
    }

    .messages-sidebar,
    .messages-conversation
    {
        grid-row: 2;
        width: 100%;
        height: 100%;
        min-height: 0;
        border: var(--border-thin);
        border-radius: var(--radius-md);
    }

    .messages-conversation
    {
        display: none;
    }

    .messages-app.chat-open .messages-sidebar
    {
        display: none;
    }

    .messages-app.chat-open .messages-conversation
    {
        display: flex;
    }
}

@media (max-width: 48rem)
{
    .dr-page-header
    {
        align-items: stretch;
        flex-direction: column;
        gap: var(--space-sm);
        padding: var(--space-md);
    }

    .dr-page-header-actions,
    .dr-page-header > .dr-actions
    {
        justify-content: flex-start;
        width: 100%;
    }

    .dr-page-header-actions > .dr-button,
    .dr-page-header > .dr-actions > .dr-button,
    .dr-page-header > .dr-button
    {
        width: 100%;
    }

    .home-header.dr-page-header .home-date
    {
        max-width: none;
        text-align: left;
    }
}

@media (max-width: 36rem)
{
    .dr-page-header-identity
    {
        align-items: flex-start;
    }

    .user-header.dr-page-header .user-avatar
    {
        width: calc(var(--page-header-avatar-size) * 0.8);
        flex-basis: calc(var(--page-header-avatar-size) * 0.8);
    }
}

/* ==========================================================================
   Stripe registration mini-app
   ========================================================================== */
.stripe-registration-app
{
    display: grid;
    gap: var(--space-lg);
}

.stripe-registration-header.dr-page-header
{
    margin-bottom: 0;
}

.stripe-registration-intro
{
    display: grid;
    gap: var(--space-sm);
}

.stripe-registration-intro h2,
.stripe-registration-intro p
{
    margin: 0;
}

.stripe-registration-steps
{
    display: grid;
    gap: var(--space-sm);
}

.stripe-registration-step
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
}

.stripe-registration-step-copy
{
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
    gap: var(--space-sm);
}

.stripe-registration-step-heading
{
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
}

.stripe-registration-step-heading h2,
.stripe-registration-step-heading p,
.stripe-registration-status,
.stripe-registration-detail
{
    margin: 0;
}

.stripe-registration-step-heading p,
.stripe-registration-detail
{
    margin-top: var(--space-2xs);
    color: var(--color-muted);
}

.stripe-registration-step-number
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    min-width: 2.25rem;
    height: 2.25rem;
    border: var(--border-thin);
    border-radius: 50%;
    background: var(--color-accent-soft);
    font-weight: 800;
}

.stripe-registration-status
{
    font-weight: 700;
}

.stripe-registration-complete
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
    border-color: var(--color-accent-border);
    background: var(--color-accent-soft);
}

.stripe-registration-complete h2,
.stripe-registration-complete p
{
    margin: 0;
}

.stripe-registration-complete p + h2,
.stripe-registration-complete h2 + p
{
    margin-top: var(--space-xs);
}

.stripe-registration-footer-actions
{
    display: flex;
    justify-content: flex-end;
}

.stripe-registration-message-error
{
    border-color: var(--button-danger-border);
}

@media (max-width: 48rem)
{
    .stripe-registration-step,
    .stripe-registration-complete
    {
        align-items: stretch;
        flex-direction: column;
    }

    .stripe-registration-step > .dr-button,
    .stripe-registration-complete > .dr-button,
    .stripe-registration-footer-actions > .dr-button
    {
        width: 100%;
    }

    .stripe-registration-footer-actions
    {
        justify-content: stretch;
    }
}

/* V1.0 - worker availability editor */
.home-availability-toolbar {
    padding: var(--space-md);
    border-bottom: var(--border-thin);
    background: var(--color-surface-subtle);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}
.home-availability-weekends, .home-availability-modes {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}
.home-availability-weekends button[aria-pressed="true"] {
    border-color: var(--color-accent-border);
}
.home-availability-hint, .home-availability-feedback {
    margin: 0;
    font-size: var(--font-size-small);
    color: var(--color-muted);
}
.home-availability-feedback-error { color: var(--color-danger); }
.home-calendar-day-unavailable,
.calendar[data-mode="public"] .calendar-day-unavailable {
    background: var(--color-danger-surface);
}
.home-calendar-day-chip-unavailable,
.calendar-day-status-unavailable {
    background: var(--color-danger-surface);
    color: var(--color-danger);
}
.home-calendar-dot-unavailable, .calendar-dot-unavailable {
    background: var(--color-danger);
}
.home-calendar-day-selected,
.home-calendar-day-selected:hover {
    outline: 2px solid var(--color-accent-border);
    outline-offset: -3px;
    background: var(--color-accent-soft);
    z-index: 1;
}
/* Past dates cannot be edited or opened, even in the Details mode.
   Override busy/blocked colours so historical cells always read as grey. */
.home-calendar-day-past:not(.home-calendar-day-outside),
.home-calendar-day-past:not(.home-calendar-day-outside):hover,
.home-calendar-day-past:not(.home-calendar-day-outside):focus-visible {
    background: var(--color-surface-subtle);
    color: var(--color-muted);
    opacity: 0.7;
    cursor: not-allowed;
    box-shadow: none;
    outline: none;
}
.home-calendar-day-past .home-calendar-day-chip {
    filter: grayscale(1);
    opacity: 0.75;
}
.home-calendar-grid { user-select: none; }
.calendar[data-mode="public"] .calendar-day-unavailable { cursor: not-allowed; }

/* Public navigation and free-launch notice */
.public-header-links { display:flex; align-items:center; gap:clamp(.3rem,1.5vw,1.3rem); margin-left:auto; }
.public-header-links a { font-size:.83rem; color:var(--color-text); text-decoration:none; padding:.45rem .65rem; font-weight:750; white-space:nowrap; border-radius:var(--radius-sm); }
.public-header-links a:hover,.public-header-links a[aria-current="page"] { background:var(--color-accent-soft); }
#footer { justify-content:space-between; }
#footer a { color:inherit; text-decoration:none; font-weight:700; }
.home-launch-offer { font-weight:800; font-size:.87rem; padding:.7rem 1rem; border-radius:.7rem; background:var(--color-accent-soft); border:1px solid var(--color-accent-border); }
@media(max-width:30rem) { .public-header-links { gap:0; } .public-header-links a { font-size:.72rem; padding:.35rem .45rem; } }


/* --------------------------------------------------------------------------
 * Unified mobile navigation. The desktop top links and sidebar are unchanged;
 * under 50rem they are replaced by this accessible single-button menu.
 * -------------------------------------------------------------------------- */
#mobile-menu-toggle,
#mobile-menu,
#mobile-menu-backdrop {
    display: none;
}

@media (max-width: 50rem) {
    #header {
        position: relative;
        z-index: 103;
    }

    #mobile-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 var(--touch-target);
        width: var(--touch-target);
        height: var(--touch-target);
        margin-left: auto;
        padding: 0;
        border: var(--border-button);
        border-radius: var(--radius-sm);
        background: var(--color-surface);
        color: var(--color-text);
        cursor: pointer;
    }

    #mobile-menu-toggle:hover,
    #mobile-menu-toggle[aria-expanded="true"] {
        background: var(--color-accent-soft);
        border-color: var(--color-accent-border);
    }

    #mobile-menu-toggle:focus-visible,
    #mobile-menu a:focus-visible,
    #mobile-auth-button:focus-visible {
        outline: 3px solid var(--color-accent-border);
        outline-offset: 2px;
    }

    #mobile-menu-toggle svg {
        width: 1.5rem;
        height: 1.5rem;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
    }

    .public-header-links,
    #header-account,
    #navigation {
        display: none !important;
    }

    #mobile-menu-backdrop:not([hidden]) {
        display: block;
        position: fixed;
        inset: var(--topbar-height) 0 0;
        z-index: 101;
        background: var(--color-overlay);
    }

    #mobile-menu:not([hidden]) {
        display: flex;
        flex-direction: column;
        gap: var(--space-xs);
        position: fixed;
        top: calc(var(--topbar-height) + var(--space-xs));
        right: var(--space-xs);
        width: min(22rem, calc(100vw - 2 * var(--space-xs)));
        max-height: calc(100dvh - var(--topbar-height) - 2 * var(--space-xs));
        z-index: 102;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: var(--space-xs);
        border: var(--border-thin);
        border-radius: var(--radius-md);
        background: var(--color-surface);
        box-shadow: var(--shadow-dialog);
    }

    #mobile-menu [hidden] {
        display: none !important;
    }

    #mobile-public-links,
    #mobile-private-links {
        display: flex;
        flex-direction: column;
        gap: var(--space-2xs);
    }

    #mobile-public-links::before,
    #mobile-private-links::before {
        display: block;
        padding: var(--space-xs) var(--space-sm) 0;
        color: var(--color-muted);
        font-size: var(--font-size-tiny);
        font-weight: 800;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    #mobile-public-links::before { content: "Explore"; }
    #mobile-private-links::before { content: "Workspace"; }

    #mobile-private-links {
        padding-top: var(--space-xs);
        border-top: var(--border-thin);
    }

    #mobile-menu nav a {
        display: flex;
        align-items: center;
        gap: var(--space-sm);
        min-height: var(--touch-target);
        padding: var(--space-xs) var(--space-sm);
        border-radius: var(--radius-sm);
        color: var(--color-text);
        text-decoration: none;
        font-weight: 650;
    }

    #mobile-menu nav a:hover,
    #mobile-menu nav a[aria-current="page"] {
        background: var(--color-accent-soft);
    }

    #mobile-menu .navigation-icon {
        width: var(--navigation-icon-size);
        height: var(--navigation-icon-size);
        flex: 0 0 var(--navigation-icon-size);
    }

    #mobile-menu .navigation-label {
        position: static;
        width: auto;
        height: auto;
        margin: 0;
        overflow: visible;
        clip: auto;
        white-space: normal;
    }

    .mobile-menu-count {
        display: inline-flex;
        min-width: 1.4rem;
        justify-content: center;
        margin-left: auto;
        padding: 0 var(--space-2xs);
        border-radius: var(--radius-pill);
        background: var(--color-accent);
        color: var(--color-text);
        font-size: var(--font-size-tiny);
        font-weight: 800;
    }

    .mobile-menu-account {
        border-top: var(--border-thin);
        padding: var(--space-xs);
    }

    #mobile-auth-button {
        width: 100%;
        min-height: var(--touch-target);
    }
}


/* --------------------------------------------------------------------------
   Responsive calendars — both the private dashboard and public profile.
   Show seven genuinely fluid columns instead of forcing a 38rem-wide strip.
   The status legend remains legible; on narrow phones the day cells use small
   coloured status indicators rather than overflowing text labels.
   -------------------------------------------------------------------------- */
.calendar-scroll,
.home-calendar {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

@media (max-width: 50rem) {
    .calendar-weekdays,
    .calendar-grid,
    .home-calendar-weekdays,
    .home-calendar-grid {
        width: 100%;
        min-width: 0;
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }

    .calendar-weekday,
    .home-calendar-weekday {
        padding: 0.4rem 0;
        font-size: clamp(0.6rem, 2.1vw, 0.75rem);
    }

    .calendar-day,
    .home-calendar-day {
        min-height: clamp(3.3rem, 9vw, 5rem);
        padding: clamp(0.1rem, 0.7vw, 0.45rem);
    }

    .calendar-day-number,
    .home-calendar-day-number {
        font-size: clamp(0.67rem, 2.2vw, 0.85rem);
        margin-bottom: 0.25rem;
    }

    .calendar-legend,
    .home-calendar-legend {
        gap: 0.35rem 0.7rem;
    }

    .calendar-header,
    .home-calendar-header {
        min-width: 0;
    }

    .home-calendar-navigation {
        width: 100%;
        min-width: 0;
    }

    .home-calendar-month {
        flex: 1 1 auto;
        min-width: 0;
    }
}

@media (max-width: 37.5rem) {
    .calendar-day,
    .home-calendar-day {
        min-height: 3.4rem;
    }

    .calendar-day-number,
    .home-calendar-day-number {
        margin-bottom: 0.2rem;
        text-align: center;
    }

    .home-calendar-day-summary,
    .calendar-bookings {
        display: flex;
        flex-flow: row wrap;
        justify-content: center;
        gap: 0.12rem;
        min-width: 0;
    }

    /* The full labels are retained in the DOM for accessibility and desktop.
       On phones, the legend explains these compact indicators. */
    .calendar-day-status,
    .home-calendar-day-chip {
        display: block;
        width: 0.48rem;
        height: 0.48rem;
        max-width: 100%;
        margin: 0.1rem auto;
        padding: 0;
        border-radius: 50%;
        font-size: 0;
        line-height: 0;
        overflow: hidden;
        color: transparent;
        text-indent: -999px;
    }

    .calendar-day-status-free { background: var(--color-success); }
    .calendar-day-status-pending,
    .home-calendar-day-chip-pending { background: var(--color-warning); }
    .calendar-day-status-booked,
    .home-calendar-day-chip-accepted { background: var(--color-accent-border); }
    .calendar-day-status-unavailable,
    .home-calendar-day-chip-unavailable { background: var(--color-danger); }
    .home-calendar-day-chip-completed { background: var(--color-success); }

    /* Private booking details are still present (truncated inside the cell)
       rather than disappearing completely on smaller screens. */
    .calendar-booking {
        max-width: 100%;
        padding: 0.1rem;
    }
    .calendar-booking-title,
    .calendar-booking-skill,
    .calendar-booking-rate,
    .calendar-booking-time {
        font-size: 0.58rem;
        line-height: 1.2;
    }
}

/* Password management: uses the same form styling as other account settings. */
.dr-auth-footer
{
    margin: var(--space-md) 0 0;
    text-align: center;
}

.dr-password-message
{
    margin-top: var(--space-md);
    padding: var(--space-md);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    overflow-wrap: anywhere;
}

.profile-password-settings
{
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: var(--border-thin);
}

.profile-password-settings > p
{
    color: var(--color-muted);
}

#profile-password-form
{
    width: min(100%, 32rem);
}

/* Password reveal controls shared by the registration, login, recovery and
 * profile mini-apps. Use a wrapper so password strength/field layouts remain
 * consistent on desktop and small-screen devices. */
.dr-password-input
{
    position: relative;
    min-width: 0;
}
.dr-password-input > input
{
    width: 100%;
    padding-right: 5.2rem;
}
.dr-password-toggle
{
    position: absolute;
    top: 50%;
    right: 0.35rem;
    transform: translateY(-50%);
    min-height: 2rem;
    padding: 0 0.65rem;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-accent);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
/* Global button hover/active styles otherwise replace translateY(-50%),
 * making password reveal controls jump down instead of staying centred. */
button.dr-password-toggle,
button.dr-password-toggle:hover:not(:disabled),
button.dr-password-toggle:active:not(:disabled),
button.dr-password-toggle:focus-visible
{
    transform: translateY(-50%);
    box-shadow: none;
}
button.dr-password-toggle:hover:not(:disabled),
button.dr-password-toggle:focus-visible
{
    background: var(--color-surface-subtle);
    color: var(--color-text);
}

.verification-recovery
{
    display: grid;
    gap: var(--space-sm);
    padding: var(--panel-padding);
    border-top: var(--border-thin);
}
.verification-recovery h2
{
    font-size: 1.05rem;
    margin: 0;
}
.verification-recovery p
{
    margin: 0;
    color: var(--color-muted);
}
.verification-recovery > button
{
    justify-self: start;
}
.verification-recovery form
{
    padding-top: var(--space-sm);
}
.verification-recovery form[hidden]
{
    display: none;
}

/* Swapping between verification and email correction keeps only one form visible. */
.verification-panel .dr-form[hidden]
{
    display: none;
}


/* ==========================================================================
   Width audit: keep every routed mini-app within its available viewport
   ========================================================================== */
/* The viewport is the only outer scrolling surface. Full-bleed page headers
   are sized using --viewport-padding-inline, rather than an assumed desktop
   gutter, and all other mini-app contents can shrink inside grid/flex cells. */
#viewport > :not(.router-loader) { min-width: 0; max-width: 100%; }
#viewport > :not(.router-loader) :is(img, video, canvas, svg) { max-width: 100%; }
#viewport > :not(.router-loader) :is(.dr-panel, .dr-card, .dr-surface, .dr-section, .dr-page-shell,
    .dr-page, .dr-layout-sidebar, .dr-filter-bar, .dr-toolbar) { min-width: 0; }

/* Tabs need to remain visible, rather than disappearing offscreen behind a
   second horizontal scrollbar when the app column becomes narrow. */
.dr-tabs, .bookings-tabs, .messages-filters {
    flex-wrap: wrap;
    max-width: 100%;
    overflow-x: visible;
}
.dr-tab, .bookings-tab, .messages-filter {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}
.bookings-tab { flex: 1 1 10rem; }

/* Accounts already renders a full mobile/card alternative for every row.
   Switch based on the *app column* width (not window width): at 1280px wide,
   the 200px sidebar means the 72rem table would otherwise scroll. */
@container dr-mini-app-viewport (max-width: 72.25rem) {
    .accounts-table-container { display: none; }
    .accounts-mobile-list { display: block; }
}

/* Long IDs, user-generated titles, and large monetary amounts may be wider
   than their grid track; allow them to wrap instead of expanding the page. */
#viewport :is(.dr-panel, .dr-card, .accounts-summary-card, .accounts-balance-card,
    .booking-card-content, .team-collector-card, .stripe-registration-step-copy,
    .messages-chat-heading, .project-card) {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Complex long-label action rows can contract and wrap on small screens. */
#viewport :is(.dr-actions, .dr-inline-actions, .dr-form-actions) {
    min-width: 0;
    max-width: 100%;
}

/* Grid children with full-bleed headings must not enlarge their implicit grid
   track at very narrow widths (notably the Stripe setup page at 320px). */
.stripe-registration-app { grid-template-columns: minmax(0, 1fr); }


/* ===========================================================================
 * Responsive overflow follow-up (11 November 2026)
 *
 * The shell width tests missed nested horizontal scroll surfaces and content
 * populated after the page opens. Keep the app vertical, but fix components
 * rather than simply allowing the container to cut them off.
 * =========================================================================== */

/* The seven-day grids are genuinely fluid, not horizontal carousels. */
#viewport .calendar-scroll,
#viewport .home-calendar {
    overflow-x: hidden;
}

/* Project names and other user-entered text must not force wider grid tracks. */
#viewport :is(.home-grid, .home-panel, .home-panel-header,
    .accounts-mobile-card, .accounts-mobile-card-header,
    .accounts-mobile-meta, .home-attendance-projects,
    .home-attendance-project-list, .home-attendance-project,
    .home-booking, .home-message, .dr-panel-heading, .dr-section-heading) {
    min-width: 0;
}
#viewport :is(.home-attendance-project, .home-attendance-project strong,
    .home-attendance-project span, .home-panel-header,
    .accounts-mobile-card-header, .accounts-mobile-card-value,
    .home-booking, .home-message) {
    overflow-wrap: anywhere;
}

/* Project attendance is in a dialog. Previously its auto-fit minimum was
 * 16rem regardless of available width, forcing a horizontal scrollbar on
 * narrow phones once real project names were rendered. */
.home-attendance-project-list {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--attendance-project-column-width)), 1fr));
}
.home-attendance-project {
    min-width: 0;
    max-width: 100%;
}

/* The account transaction table has a full-detail card alternative when the
 * app column is too narrow. At larger widths, stay inside the table frame. */
.accounts-table {
    table-layout: fixed;
}
.accounts-table th,
.accounts-table td {
    overflow-wrap: anywhere;
}
/* Preserve the full monetary amount rather than clipping long figures. */
.accounts-table td.accounts-money-column {
    white-space: normal;
}
.accounts-table-container {
    overflow-x: hidden;
}

/* App-column responsive rules apply even if the outer browser window is
 * comparatively wide because the persistent desktop sidebar takes space. */
@container dr-mini-app-viewport (max-width: 52rem) {
    .home-grid,
    .home-attendance-workspace {
        grid-template-columns: minmax(0, 1fr);
    }
    .home-calendar-header,
    .home-panel-header {
        align-items: stretch;
        flex-wrap: wrap;
    }
    .home-calendar-header {
        flex-direction: column;
    }
    .home-calendar-navigation {
        width: 100%;
        min-width: 0;
    }
    .home-attendance-projects {
        border-right: 0;
        border-bottom: var(--border-thin);
    }
    .accounts-payment-method-list {
        grid-template-columns: minmax(0, 1fr);
    }
    .accounts-payment-method-card {
        align-items: stretch;
        flex-wrap: wrap;
    }
}
@container dr-mini-app-viewport (max-width: 34rem) {
    .accounts-mobile-card-header {
        flex-direction: column;
        gap: var(--space-xs);
    }
    .accounts-mobile-card-value {
        max-width: 100%;
        white-space: normal;
    }
    .accounts-mobile-meta {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Geographical search: keep new controls and result distances responsive. */
.user-tile-distance {
    display: block;
    color: var(--color-muted);
    font-size: var(--font-size-small);
    margin: 0 0 var(--space-xs);
}
#projects-search-form > label,
#projects-search-form > label > input,
#projects-search-form > label > select,
.users-search-field,
.users-search-field > input,
.users-search-field > select {
    min-width: 0;
    max-width: 100%;
}
#projects-create-form .dr-form-row,
#project-edit-form .dr-form-row {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}
.dr-location-help {
    color: var(--color-muted);
    font-weight: 400;
}

/* Admin-only links remain genuinely hidden in desktop and mobile navigation. */
[data-admin-only][hidden] { display: none !important; }
