/* Epic 15449, story 15461 (S12). The Online Ordering Assistant pages (Pages/OOACP/AssistantXai.razor and
   Pages/OOACP/Assistant.razor, which both render Shared/Components/OOAssistant/OOAssistantPageBody.razor) and their
   components (Shared/Components/OOAssistant). Every class starts with "ooa-", so no rule here styles another page. */

.ooa-workbench {
    display: grid;
    grid-template-columns: minmax(320px, 5fr) minmax(360px, 7fr);
    gap: 1rem;
    align-items: start;
}

@media (max-width: 991.98px) {
    .ooa-workbench {
        grid-template-columns: 1fr;
    }
}

.ooa-left,
.ooa-right {
    min-width: 0;
}

/* Conversation */
.ooa-chat {
    position: relative;
    background: var(--oc-card-bg);
    border: 1px solid var(--oc-form-border);
    border-radius: 6px;
    padding: 0.75rem;
}

.ooa-messages {
    max-height: 60vh;
    min-height: 240px;
    overflow-y: auto;
    padding: 0.25rem;
    margin-bottom: 0.75rem;
}

.ooa-welcome {
    background: var(--oc-card-header-bg);
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.ooa-msg {
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

.ooa-msg-user {
    background: var(--oc-card-header-bg);
    margin-left: 2rem;
}

.ooa-msg-assistant {
    border: 1px solid var(--oc-form-border);
    margin-right: 2rem;
}

.ooa-plain {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.ooa-md {
    overflow-wrap: anywhere;
}

.ooa-md p:last-child,
.ooa-md ul:last-child,
.ooa-md ol:last-child {
    margin-bottom: 0;
}

.ooa-md code {
    color: var(--oc-text-color);
    background: var(--oc-card-header-bg);
    padding: 0 0.2rem;
    border-radius: 3px;
}

.ooa-working-box,
.ooa-jobs {
    background: var(--oc-card-header-bg);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
}

.ooa-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.ooa-chip {
    white-space: normal;
    text-align: left;
}

/* The input stays in the page for the drop handler and the label, but it does not show. */
.ooa-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

/* The label shows the focus of the input that it opens, for a keyboard user. */
.ooa-attach:has(+ .ooa-file-input:focus-visible) {
    outline: 2px solid var(--oc-primary);
    outline-offset: 2px;
}

.ooa-drop-hint {
    display: none;
}

html.ooa-dragging .ooa-drop-hint {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

html.ooa-dragging .ooa-drop-hint span {
    background: var(--oc-card-bg);
    color: var(--oc-text-color);
    border: 2px dashed var(--oc-primary);
    border-radius: 8px;
    padding: 1.5rem 2rem;
    font-size: 1.1rem;
}

/* Tabs */
/* The tab row joins the panel below it (.ooa-tab-body has no top border on purpose). reports.css styles every
   ".nav-tabs" with no page scope, in each of its three screen-width blocks (lines 471-489, 951-969 and 1469-1487): white
   tab names, no borders (!important) and a gap under the row. These rules put the tab look back on the tab rows of the
   assistant, Shared/Components/OOAssistant/OOAssistantPageBody.razor and Pages/OOAssistantAdmin.razor. Two classes outrank the reports.css selectors, so
   the !important ones win whatever the file order. OCEnterpriseTests/Styles/TabTextColourTests.cs fails on a tab row
   that has no colour rule of its own. */
.nav-tabs.ooa-tabs {
    border-bottom: 1px solid var(--oc-form-border) !important;
    margin-bottom: 0;
    gap: 2px;
}

.nav-tabs.ooa-tabs .nav-link {
    margin-bottom: -1px;
    color: var(--oc-text-color);
    background-color: var(--oc-card-header-bg);
    border: 1px solid var(--oc-form-border) !important;
}

.nav-tabs.ooa-tabs .nav-link:hover {
    color: var(--oc-primary-text) !important;
    background-color: var(--oc-card-bg);
    border: 1px solid var(--oc-form-border) !important;
}

/* The open tab takes the panel's white and drops its bottom border, so it reads as part of the panel. The orange line
   on top keeps the brand colour; the text uses the dark orange because white on the brand orange is about 3.3:1. */
.nav-tabs.ooa-tabs .nav-link.active {
    color: var(--oc-primary-text) !important;
    background-color: var(--oc-card-bg) !important;
    border: 1px solid var(--oc-form-border) !important;
    border-bottom-color: var(--oc-card-bg) !important;
    box-shadow: inset 0 3px 0 var(--oc-primary);
    font-weight: 600;
}

.nav-tabs.ooa-tabs .nav-link:focus-visible {
    outline: 2px solid var(--oc-primary);
    outline-offset: -2px;
}

.ooa-tab-body {
    background: var(--oc-card-bg);
    border: 1px solid var(--oc-form-border);
    border-top: none;
    padding: 0.75rem;
    min-height: 240px;
}

.ooa-facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.35rem 1rem;
    margin-bottom: 0;
}

.ooa-facts dt {
    font-weight: 600;
}

.ooa-facts dd {
    margin-bottom: 0;
}

.ooa-swatch {
    display: inline-block;
    width: 1.1rem;
    height: 1.1rem;
    border: 1px solid var(--oc-form-border);
    border-radius: 3px;
    margin-right: 0.2rem;
    vertical-align: middle;
}

.ooa-swatch-sm {
    width: 0.8rem;
    height: 0.8rem;
}

/* The colour strip of a theme on the theme line of a change set. */
.ooa-theme-colours {
    display: inline-flex;
    gap: 2px;
    margin: 0 0.35rem;
    vertical-align: middle;
}

.ooa-theme-colours .ooa-swatch {
    margin-right: 0;
}

/* The logo on the logo line of a change set, at half the box of the top bar of the ordering site: 56 px high, at most
   202 px wide (OCEnterpriseAPI OOAssistant/Knowledge/appearance/logo-and-images.md, "Logo on the page"). The grey shows
   a transparent background. */
.ooa-logo-thumb {
    height: 28px;
    max-width: 101px;
    object-fit: contain;
    margin-right: 0.35rem;
    vertical-align: middle;
    background: var(--oc-card-header-bg);
    border: 1px solid var(--oc-form-border);
    border-radius: 3px;
}

.ooa-logo-name {
    word-break: break-all;
}

/* Changes */
.ooa-lines .ooa-col-tick {
    width: 4.5rem;
}

.ooa-line-off td {
    color: var(--oc-text-muted);
}

.ooa-line-off .ooa-after .ooa-value {
    text-decoration: line-through;
}

.ooa-value,
.ooa-source-quote {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.ooa-line-note-row td {
    border-top: none;
    padding-top: 0;
}

/* A group row: one change on many records, with the records behind a toggle. The left line in the brand colour sets it
   apart from a record block. */
.ooa-group {
    border: 1px solid var(--oc-form-border);
    border-left: 3px solid var(--oc-primary);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    background: var(--oc-card-bg);
}

.ooa-group-change,
.ooa-group-note,
.ooa-group-record {
    overflow-wrap: anywhere;
}

.ooa-group-lines {
    border-top: 1px solid var(--oc-form-border);
}

/* Guest preview */
.ooa-preview {
    border: 1px solid;
    border-radius: 6px;
    overflow: hidden;
    max-width: 520px;
}

.ooa-preview-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
}

.ooa-preview-logo {
    border: 1px dashed;
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    font-size: 0.75rem;
}

.ooa-preview-store {
    font-weight: 600;
    flex: 1;
}

.ooa-preview-cart,
.ooa-preview-button {
    display: inline-block;
    border-radius: 4px;
    padding: 0.2rem 0.6rem;
    font-size: 0.85rem;
}

.ooa-preview-body {
    padding: 0.75rem;
    display: grid;
    gap: 0.5rem;
}

.ooa-preview-card {
    border: 1px solid;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
}

.ooa-preview-type {
    font-size: 0.75rem;
}

.ooa-preview-name {
    font-weight: 600;
}

.ooa-preview-desc {
    font-size: 0.875rem;
    margin-bottom: 0.35rem;
}

.ooa-preview-hidden {
    opacity: 0.55;
    border-style: dashed;
}

.ooa-preview-note {
    font-size: 0.8rem;
    font-style: italic;
}

/* Go-live */
.ooa-handoff {
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--oc-form-border);
}

.ooa-handoff-done .form-check-label {
    text-decoration: line-through;
    color: var(--oc-text-muted);
}

/* Menu match (Files tab) */
.ooa-match-name,
.ooa-match-description,
.ooa-match-then-text,
.ooa-match-record {
    overflow-wrap: anywhere;
}

.ooa-match-line[data-match="choose"] {
    border-left: 3px solid var(--oc-primary);
}

.ooa-match-candidate {
    border-bottom: 1px solid var(--oc-form-border);
}

/* The suggested matches and the conflicts stand above the lines. The left line in the brand colour marks a section that
   waits for a person, as on a line that waits for a pick. */
.ooa-match-suggestions,
.ooa-match-conflicts {
    border-left: 3px solid var(--oc-primary);
}

.ooa-match-suggestion,
.ooa-match-conflict {
    border-top: 1px solid var(--oc-form-border);
}

.ooa-match-suggestion-description,
.ooa-match-suggestion-reason,
.ooa-match-choice-more,
.ooa-match-conflict-line,
.ooa-match-search-result,
.ooa-match-copy {
    overflow-wrap: anywhere;
}

/* The copies of a ticked record, indented under it. */
.ooa-match-copies {
    margin: 0.25rem 0 0 1.5rem;
    padding-left: 0.5rem;
    border-left: 2px solid var(--oc-form-border);
}

.ooa-match-added {
    background: var(--oc-card-header-bg);
}

.ooa-match-search-input {
    max-width: 18rem;
}

/* Review of a menu change set */
.ooa-review-text {
    overflow-wrap: anywhere;
}
