/* Shared PartnerHub dialog styles; source: PartnerHub.Web/wwwroot/app.css. */
.confirm-dialog {
    /* PartnerHub architectnow-tokens.css supplements not present in canonical brand.css.
       Declare at the dialog itself: landing/reconnect token scopes are not ancestors. */
    --an-header-gradient: radial-gradient(120% 135% at 94% 22%, var(--an-red-deep) 0%, var(--an-ink) 46%, var(--an-dark) 100%);
    --an-space-2: 8px;
    --an-radius-sm: 8px;
}

/* Blur the page only when a true modal dialog is open. DO NOT blur the generic
   `.mud-overlay` — MudBlazor uses transparent full-viewport overlays behind
   autocompletes, menus, selects and date pickers to capture outside-clicks, and
   blurring those makes the page look broken while the picker is focused. */
.mud-overlay.mud-overlay-dialog {
    backdrop-filter: blur(3px);
}

/* Standard dialog header — AN Red bar with white text */
.confirm-dialog .mud-dialog-title {
    padding: 0 !important;
}

/* MudBlazor's own content padding stacks with .confirm-dialog-body's, doubling the
   whitespace — the body wrapper is the single source of dialog spacing. */
.confirm-dialog .mud-dialog-content {
    padding: 0;
}

.confirm-dialog-header {
    background: var(--an-header-gradient);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--an-space-2);
    width: 100%;
    /* The header is dark. Its contents are white BECAUSE they sit on it — which makes that the
       header's rule to state, not each of twenty-seven call sites'. Most of them do set it and are
       now simply redundant; the three that forgot were rendering dark ink on a dark band, so
       "Map an account" and "New update" have been opening with no title at all. */
    color: var(--an-white);
}

.confirm-dialog-header,
.confirm-dialog-header .mud-typography,
.confirm-dialog-header .mud-icon-root,
.confirm-dialog-header .mud-button-root {
    color: var(--an-white);
}

/* The title is the one thing in the header that must survive a long name: it truncates, and the
   close button keeps its place rather than being pushed off the edge. The ellipsis has to sit on
   the TEXT element, not on this flex container — text-overflow only applies to a block's own
   inline content, so on the flex box it did nothing and every long title was cut mid-glyph
   ("Book an Appointment w") at phone width. */
.confirm-dialog-header > :first-child {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: var(--an-space-2);
    font-weight: 600;
    font-size: 1.1rem;
}

.confirm-dialog-header > :first-child .mud-typography {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Dialog body — `pre-line` so callers that build multi-line messages with \n keep their
   line breaks instead of collapsing into one run-on paragraph. */
.confirm-dialog-body {
    padding: 20px 24px 4px;
}

.confirm-dialog-text {
    color: var(--an-gray-1);
    white-space: pre-line;
}

/* Label/value summary rows */
.confirm-detail-list {
    margin: 0;
}

.confirm-dialog-text + .confirm-detail-list {
    margin-top: 16px;
}

.confirm-detail-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 24px;
    padding: 9px 0;
    border-bottom: 1px solid var(--an-border);
}

.confirm-detail-row:last-child {
    border-bottom: none;
}

.confirm-detail-row dt {
    margin: 0;
    flex: 0 0 auto;
    font-size: 0.8125rem;
    color: var(--an-gray-4);
}

.confirm-detail-row dd {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--an-gray-1);
    text-align: right;
    overflow-wrap: anywhere;
}

/* Totals card — set apart from the plain detail rows */
.confirm-total-card {
    margin-top: 16px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--an-paper);
    border: 1px solid var(--an-border-2);
    border-left: 3px solid var(--an-red);
    border-radius: var(--an-radius-sm);
}

.confirm-total-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 0.875rem;
    color: var(--an-gray-1);
}

.confirm-total-row span:last-child {
    font-weight: 600;
    white-space: nowrap;
}

/* Dialog action buttons — side padding matches .confirm-dialog-body so the
   buttons align with the content above. */
.confirm-dialog .mud-dialog-actions {
    padding: 8px 24px 16px;
}

/* Canonical guide accessibility floors and viewport containment. These apply to
   every shared dialog, including feedback, rather than individual feature copies. */
.mud-dialog.confirm-dialog {
    margin: 16px;
    width: calc(100% - 32px);
    max-height: calc(100dvh - 32px);
    overflow: hidden;
}
.confirm-dialog .mud-dialog-content {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.confirm-dialog .mud-dialog-title,
.confirm-dialog .mud-dialog-actions { flex-shrink: 0; }
.confirm-dialog .mud-dialog-actions { gap: 8px; flex-wrap: wrap; }
.confirm-dialog .mud-button-root { min-height: 44px; min-width: 44px; }
.confirm-dialog-header > .mud-icon-button { flex: 0 0 44px; width: 44px; height: 44px; }
.confirm-dialog-header .mud-icon-root { flex-shrink: 0; }
.confirm-dialog-text,
.confirm-detail-row dt,
.confirm-detail-row dd,
.confirm-total-row,
.confirm-dialog .mud-button { font-size: 15px; }
.confirm-dialog .mud-input-slot { font-size: 16px; }
.confirm-dialog-header .mud-icon-button:focus-visible { outline-color: var(--an-red-light); }
@media (max-width: 600px) {
    .confirm-dialog-body { padding: 20px 16px 4px; }
    .confirm-dialog .mud-dialog-actions { padding-inline: 16px; }
    .confirm-detail-row { gap: 16px; }
}

/* ProposalHub model chooser, with native keyboard radio semantics and brand tokens. */
.ai-model-options { border: 0; padding: 0; margin: 24px 0 0; min-width: 0; }
.ai-model-option { display: flex; align-items: center; gap: 16px; padding: 16px; margin-bottom: 12px; border: 2px solid var(--an-gray-7); border-radius: 12px; cursor: pointer; min-height: 44px; }
.ai-model-option.is-selected { border-color: var(--an-red); background: var(--an-paper); }
.ai-model-option input { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--an-red); }
.ai-model-option:has(input:focus-visible) { outline: 2px solid var(--an-red); outline-offset: 3px; }
.ai-model-name { font-weight: 600; }
.ai-model-description { display: block; margin-top: 8px; overflow-wrap: anywhere; }
.ai-model-default { display: inline-block; padding: 4px 8px; border: 1px solid var(--an-red); border-radius: 4px; color: var(--an-red); }
.ai-price-import summary, .ai-invocation summary { cursor: pointer; min-height: 44px; padding-block: 12px; }
.ai-invocation { margin: 16px 0; border-top: 1px solid var(--an-gray-7); }
.ai-invocation pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; }

.ai-model-option input:focus { outline: none; }
.ai-model-copy { min-width: 0; }
.ai-model-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ai-model-publisher { color: var(--an-gray-4); }
.ai-settings-tabs .mud-tab { text-transform: none; }
