/* Dapple Grey Organiser — brand slots and layout chrome on top of MudBlazor. */

html, body {
    font-family: "Varela Round", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

.validation-message {
    color: var(--mud-palette-error);
}

.blazor-error-boundary {
    background: var(--mud-palette-error);
    padding: 1rem 1rem 1rem 1.25rem;
    color: var(--mud-palette-error-contrast-text);
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

/* App bar: pale paper, thin bottom rule. Height matches the 72×208 lockup. */
.dg-appbar {
    border-bottom: 1px solid var(--mud-palette-divider);
    min-height: 72px;
    height: 72px;
}

.dg-appbar .mud-toolbar {
    min-height: 72px;
    height: 72px;
    padding-top: 0;
    padding-bottom: 0;
}

.dg-appbar-brand {
    display: flex;
    align-items: center;
    min-width: 0;
    color: inherit;
}

.dg-appbar-lockup {
    display: inline-block;
    flex: 0 0 auto;
    height: 72px;
    width: 208px;
    background-color: currentColor;
    -webkit-mask: url("/brand/drawer-organiser-currentColor.svg") center / contain no-repeat;
    mask: url("/brand/drawer-organiser-currentColor.svg") center / contain no-repeat;
}

.dg-account-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 50%;
    line-height: 0;
}

.dg-account-avatar {
    font-size: 0.875rem;
}

.dg-drawer {
    border-right: 1px solid var(--mud-palette-divider);
}

.dg-mark {
    display: inline-block;
    width: 24px;
    height: 24px;
    background-color: currentColor;
    -webkit-mask: url("/brand/dg-mark-currentColor.svg") center / contain no-repeat;
    mask: url("/brand/dg-mark-currentColor.svg") center / contain no-repeat;
}

.dg-org-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.75rem;
    padding: 0.2rem 1.5rem;
    min-height: 2rem;
    line-height: 1.2;
    background: var(--mud-palette-appbar-background);
    border-bottom: 1px solid var(--mud-palette-divider);
    color: var(--mud-palette-text-primary);
}

.dg-org-bar-label {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
    line-height: 1.2;
}

.dg-org-bar-name {
    font-weight: 400;
    line-height: 1.2;
    color: var(--mud-palette-secondary);
}

.dg-org-bar-muted {
    color: var(--mud-palette-text-secondary);
    line-height: 1.2;
}

.dg-org-bar-switch.mud-button-root {
    min-height: unset;
    padding-top: 0.15rem;
    padding-bottom: 0.15rem;
    line-height: 1.2;
}

.dg-page {
    padding: 1.5rem;
    max-width: 1200px;
}

.dg-dashboard-event-head {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 1rem;
}

.dg-dashboard-event-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.dg-dashboard-stat {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-self: stretch;
}

.dg-dashboard-stat .mud-table-container {
    flex: 1 1 auto;
    display: flex;
}

.dg-dashboard-stat table {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
}

.dg-dashboard-stat tbody,
.dg-dashboard-stat tr,
.dg-dashboard-stat td {
    height: 100%;
}

.dg-dashboard-stat td {
    padding: 0;
}

.dg-dashboard-stat-inner {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    min-width: 5.5rem;
    padding: 0.5rem 0.75rem;
    text-align: center;
    white-space: nowrap;
}

.dg-unstyled-link,
.dg-unstyled-link:hover,
.dg-unstyled-link:visited,
.dg-unstyled-link:focus {
    color: inherit;
    text-decoration: none;
}

.dg-dashboard-stat-value {
    font-size: 1.75rem;
    line-height: 1.1;
    justify-content: center;
    text-align: center;
}

.dg-dashboard-stat-label {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

.dg-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.dg-page-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.dg-status-chip {
    text-transform: none;
}

.dg-map-host {
    height: 280px;
    width: 100%;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--mud-default-borderradius);
    margin-top: 0.75rem;
}

img.dg-static-map {
    height: 280px;
    width: 100%;
    object-fit: cover;
    display: block;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--mud-default-borderradius);
    margin-top: 0.75rem;
}

.dg-clickable-row {
    cursor: pointer;
}

.dg-schedule-day-heading.mud-typography-h5 {
    font-size: 1.65rem;
    font-weight: 600;
    line-height: 1.3;
}

.dg-schedule-arena-heading {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.dg-schedule-class-heading {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0.85rem 0 0.35rem;
}

.dg-section-heading {
    font-size: 1.35rem !important;
    font-weight: 600;
    line-height: 1.3;
}

/* Read-only panel titles (Event details, Contact, Event summary, Dressage test).
   Action sections keep .dg-section-heading. */
.info-panel-title {
    font-weight: 500;
}

.dg-schedule-judges {
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--mud-palette-text-secondary);
}

.dg-strikethrough {
    text-decoration: line-through;
}

.dg-field-action {
    display: flex !important;
    align-items: center;
    align-self: stretch;
}

.mud-table-hover .dg-clickable-row:hover {
    background-color: var(--mud-palette-table-hover);
}

/* v6.1.2 — Ask Dapple Grey drawer. Paper chrome + leather secondary; not Competitor success green. */
.dg-chat-drawer.mud-drawer {
    width: min(100%, 440px);
    max-width: 440px;
    background-color: #F4F2EE !important;
    background-image: none !important;
    color: #1C1E22;
    z-index: 1400;
}

.dg-chat-drawer .mud-drawer-content,
.dg-chat-drawer .mud-drawer-content > .mud-paper,
.dg-chat-panel {
    background-color: #F4F2EE !important;
    background-image: none !important;
    color: #1C1E22;
}

.dg-chat-drawer .mud-drawer-content,
.dg-chat-drawer .mud-drawer-content > .mud-paper {
    height: 100%;
}

@media (max-width: 959.98px) {
    /* Full width only when open. Closed offset uses --mud-drawer-width (~440px);
       a 100% width while closed leaves a visible strip over the main layout. */
    .dg-chat-drawer.mud-drawer.mud-drawer--open {
        width: 100% !important;
        max-width: 100%;
        --mud-drawer-width: 100%;
    }
}

.dg-chat-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.dg-chat-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.35rem 0.65rem 1rem;
    border-bottom: 1px solid var(--mud-palette-divider);
    flex: 0 0 auto;
}

.dg-chat-header-title {
    min-width: 0;
    white-space: nowrap;
}

.dg-chat-credits-chip {
    flex: 0 0 auto;
}

.dg-chat-progress {
    flex: 0 0 auto;
}

.dg-chat-transcript {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dg-chat-empty {
    margin: auto;
    text-align: center;
    max-width: 20rem;
    color: var(--mud-palette-text-secondary);
}

.dg-chat-empty-copy {
    margin-bottom: 0.5rem;
}

.dg-chat-empty-warn {
    display: block;
    margin-bottom: 0.75rem;
}

.dg-chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
}

.dg-chat-row {
    display: flex;
}

.dg-chat-row-user {
    justify-content: flex-end;
}

.dg-chat-row-assistant,
.dg-chat-row-error {
    justify-content: flex-start;
}

.dg-chat-bubble {
    max-width: 92%;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
}

.dg-chat-row-user .dg-chat-bubble {
    background: #8C5A3C;
    color: #FFFFFF;
}

.dg-chat-row-assistant .dg-chat-bubble {
    background: #FFFFFF;
    color: #1C1E22;
    border: 1px solid var(--mud-palette-lines-default);
}

.dg-chat-bubble-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.dg-chat-tools {
    display: block;
    margin-top: 0.35rem;
    opacity: 0.85;
}

.dg-chat-banner {
    margin: 0 0.75rem 0.5rem;
    flex: 0 0 auto;
}

.dg-chat-confirm {
    margin: 0 0.75rem 0.5rem;
    padding: 0.75rem;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 0.5rem;
    background: var(--mud-palette-background-gray);
    flex: 0 0 auto;
}

.dg-chat-confirm-title {
    margin-bottom: 0.35rem;
}

.dg-chat-confirm-list {
    margin: 0 0 0.75rem;
    padding-left: 1.15rem;
    font-size: 0.875rem;
}

.dg-chat-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.dg-chat-composer {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0.75rem;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--mud-palette-divider);
    flex: 0 0 auto;
}

.dg-chat-input {
    flex: 1 1 auto;
}
