/* Order code readout - shared by the sales documents that resolve an order code from pasted
   text (offer, order confirmation). Kept in one stylesheet rather than in each component's own
   <style> block: those blocks are global once rendered anyway, so a second copy would only add a
   way for the two readouts to start looking different from each other. */

/* Price list options -------------------------------------------------
   The popover is anchored to a cell barely wider than the number itself,
   so it needs its own width. Rates share one right-aligned column: a
   price list is read by comparing figures down the edge, not by reading
   each option as a sentence. */
.ooc-price-popover {
    min-width: 380px;
    max-width: 560px;
}
.ooc-price-option {
    display: flex;
    align-items: baseline;
    gap: 10px;
    width: 100%;
    min-width: 0;
    padding: 2px 0;
}
.ooc-price-option__rate {
    flex: 0 0 auto;
    min-width: 78px;
    white-space: nowrap;
    text-align: right;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums lining-nums;
    color: var(--mud-palette-text-primary);
}
.ooc-price-option__currency {
    flex: 0 0 30px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--mud-palette-text-secondary);
}
.ooc-price-option__name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.8125rem;
    line-height: 1.35;
    color: var(--mud-palette-text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ooc-price-option.is-selected .ooc-price-option__name {
    color: var(--mud-palette-text-primary);
    font-weight: 500;
}
.ooc-price-option__flag {
    flex: 0 0 auto;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--mud-palette-warning);
}

/* Order code readout --------------------------------------------------
   One plate, one row per subject. The left rail carries each row's own
   severity, so code and price can disagree without two framed banners. */
.ooc-lookup {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--mud-default-borderradius);
    background: var(--mud-palette-surface);
    overflow: hidden;
    animation: ooc-lookup-in 140ms ease-out both;
}
@keyframes ooc-lookup-in {
    from { opacity: 0; transform: translateY(2px); }
    to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .ooc-lookup { animation: none; }
}
.ooc-lookup__row {
    --ooc-accent: var(--mud-palette-info);
    /* The status hues are chosen to sit on a surface as a fill, not to be read as text.
       Pulled toward the body text colour they stay identifiable and stay legible - and the
       mix follows the theme, since the text colour it leans on is dark or light already. */
    --ooc-accent-text: color-mix(in srgb, var(--ooc-accent) 55%, var(--mud-palette-text-primary));
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 8px 14px;
    border-left: 3px solid var(--ooc-accent);
    background: color-mix(in srgb, var(--ooc-accent) 6%, transparent);
}
.ooc-lookup__row + .ooc-lookup__row {
    border-top: 1px solid var(--mud-palette-lines-default);
}
.ooc-lookup__row.is-success { --ooc-accent: var(--mud-palette-success); }
.ooc-lookup__row.is-warning { --ooc-accent: var(--mud-palette-warning); }
.ooc-lookup__row.is-error { --ooc-accent: var(--mud-palette-error); }
.ooc-lookup__row.is-info { --ooc-accent: var(--mud-palette-info); }
.ooc-lookup__body {
    flex: 1 1 260px;
    min-width: 0;
}
.ooc-lookup__actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.ooc-lookup__eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}
.ooc-lookup__label {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ooc-accent-text);
}
.ooc-lookup__code {
    min-width: 0;
    font-family: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    color: var(--mud-palette-text-primary);
    background: var(--mud-palette-background-gray);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 3px;
    padding: 0 5px;
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
}
.ooc-lookup__msg {
    font-size: 0.8125rem;
    line-height: 1.45;
    max-width: 82ch;
    color: var(--mud-palette-text-primary);
}
.ooc-lookup__note {
    font-size: 0.75rem;
    line-height: 1.4;
    max-width: 82ch;
    color: var(--mud-palette-text-secondary);
}
.ooc-lookup__item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 4px;
    min-width: 0;
}
.ooc-lookup__key {
    flex: 0 0 auto;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}
.ooc-lookup__value {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--mud-palette-text-primary);
    min-width: 0;
}
/* Sits directly under the description it asks about, indented past the field's own frame so
   it reads as an action on that field rather than a control of the row. */
.ooc-textcheck {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0 0 -8px;
}
.ooc-lookup__count {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--mud-palette-text-secondary);
}
/* Each finding puts both claims on one line, label first. What the text promises and what the
   code specifies line up in their own columns, so a list of findings is read down the claim
   column rather than sentence by sentence. */
.ooc-textdiff {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}
.ooc-textdiff__row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 18px;
}
.ooc-textdiff__label {
    flex: 0 0 auto;
    min-width: 132px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--mud-palette-text-primary);
}
.ooc-textdiff__claim {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}
.ooc-textdiff__side {
    flex: 0 0 auto;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
}
.ooc-textdiff__found,
.ooc-textdiff__expected {
    font-size: 0.75rem;
    line-height: 1.4;
    min-width: 0;
    color: var(--mud-palette-text-primary);
}
.ooc-textdiff__found {
    text-decoration: line-through;
    text-decoration-color: var(--ooc-accent);
    text-decoration-thickness: 1px;
}
.ooc-textdiff__expected {
    font-weight: 500;
}
/* The two rates side by side: the disagreement is the decision, so it is
   shown as figures to compare rather than a sentence to parse. */
.ooc-figures {
    display: flex;
    align-items: stretch;
    margin: 6px 0 4px;
}
.ooc-figure {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.ooc-figure + .ooc-figure {
    margin-left: 14px;
    padding-left: 14px;
    border-left: 1px solid var(--mud-palette-lines-default);
}
.ooc-figure__label {
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}
.ooc-figure__value {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums lining-nums;
    color: var(--mud-palette-text-primary);
}

/* Sits under the findings as a quiet way in, not a call to action - the specs it reveals are
   usually the expected difference between a sales document and a full configuration. */
.ooc-textdiff__toggle {
    margin-left: -8px;
    margin-top: 2px;
    font-size: 0.6875rem;
    text-transform: none;
    letter-spacing: 0;
    color: var(--mud-palette-text-secondary);
}

/* The corrected text, shown in the confirmation exactly as it will land in the field. Monospace
   and unwrapped where it fits: the differences a user is checking for are single characters in a
   value, and a proportional font hides them. */
.ooc-textdiff__preview {
    margin: 0;
    padding: 10px 12px;
    max-height: 40vh;
    overflow: auto;
    border-radius: 6px;
    border: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-background-grey);
    font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Consolas", monospace;
    font-size: 0.8125rem;
    line-height: 1.5;
    white-space: pre-wrap;
    color: var(--mud-palette-text-primary);
}
