/* The supplier's active conversation is the scope for every alignment view. */
#supplier-state-workspace:has(.supplier-alignment-shell) {
    min-width: 0;
    container-type: inline-size;
}

#supplier-state-workspace .supplier-alignment-shell {
    --alignment-ink: #182e29;
    --alignment-soft: #596c66;
    --alignment-line: #dde5e1;
    background: #fff;
    color: var(--alignment-ink);
}

.supplier-alignment-header,
.supplier-alignment-identity,
.supplier-alignment-actions,
.supplier-alignment-tabs {
    display: flex;
    align-items: center;
}

.supplier-alignment-header {
    flex: 0 0 auto;
    gap: 16px;
    justify-content: space-between;
    padding: 14px clamp(12px, 3%, 30px);
    border-bottom: 1px solid var(--alignment-line);
    background: #fff;
}

.supplier-alignment-identity { gap: 10px; min-width: 0; }
.supplier-alignment-identity > div { min-width: 0; }
.supplier-alignment-identity small { display: block; font-size: .72rem; color: var(--alignment-soft); }
.supplier-alignment-identity h1 { display: block; overflow: hidden; margin: 2px 0 0; font-size: 1.02rem; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.supplier-alignment-identity small .supplier-reference { margin-inline-start: .35em; font: inherit; }
.supplier-alignment-avatar {
    display: grid;
    place-items: center;
    border-radius: 50%;
    flex: none;
}
.supplier-alignment-avatar { width: 38px; height: 38px; background: #e6f4ed; color: #247451; }
.supplier-alignment-actions { flex: none; gap: 6px; }
.supplier-alignment-header button,
.supplier-alignment-menu summary,
.supplier-alignment-inspector-bar button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 36px;
    padding: 5px 11px;
    border: 1px solid var(--alignment-line);
    border-radius: 8px;
    font: inherit;
    font-size: .81rem;
    cursor: pointer;
    background: #fff;
    color: var(--alignment-ink);
}
.supplier-alignment-header .supplier-alignment-discuss { background: #164d3a; border-color: #164d3a; color: #fff; }
.supplier-alignment-menu { position: relative; }
.supplier-alignment-menu summary { list-style: none; width: 36px; padding: 0; }
.supplier-alignment-menu summary::-webkit-details-marker { display: none; }
.supplier-alignment-menu > div {
    position: absolute;
    inset: calc(100% + 5px) 0 auto auto;
    z-index: 8;
    display: grid;
    min-width: 200px;
    max-height: min(65vh, 440px);
    overflow-y: auto;
    padding: 5px;
    border: 1px solid var(--alignment-line);
    border-radius: 10px;
    background: white;
    box-shadow: 0 12px 30px #18372a22;
}
.supplier-alignment-menu:not([open]) > div { display: none; }
.supplier-alignment-menu button { justify-content: flex-start; border: 0; text-align: start; }
.supplier-alignment-menu button:disabled { color: #70817a; cursor: default; }
.supplier-alignment-menu button:enabled:hover { background: #f1f6f3; }
.supplier-alignment-shell :is(button,summary):focus-visible { outline: 2px solid #2975b8; outline-offset: 2px; }

#supplier-state-workspace .supplier-alignment-main { grid-template-columns: minmax(0,1fr); }
#supplier-state-workspace .supplier-alignment-main.has-inspector { grid-template-columns: minmax(0,1fr) minmax(320px,46%); }
#supplier-state-workspace .supplier-alignment-main > .supplier-state-requirements { padding: 0 clamp(12px,3%,30px) 14px; gap: 0; }
#supplier-state-workspace .supplier-alignment-tabs { flex-direction: row; justify-content: flex-start; gap: 4px; margin: 0; overflow: auto; max-width: 100%; border-bottom: 1px solid var(--alignment-line); }
.supplier-alignment-tabs button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    flex: 0 0 auto;
    padding: 14px 9px 12px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    font: inherit;
    font-size: .81rem;
    color: var(--alignment-soft);
    cursor: pointer;
}
#supplier-state-workspace .supplier-alignment-tabs button { position: relative; border: 0; }
#supplier-state-workspace .supplier-alignment-tabs button[aria-selected="true"] { color: #174e38; font-weight: 650; }
.supplier-alignment-tabs button[aria-selected="true"]::after { content: ""; position: absolute; bottom: 0; inset-inline: 8px; height: 2px; background: #28764f; }
.supplier-alignment-tabs button span:empty { display: none; }
.supplier-brief-panel {
    min-width: 0; min-height: 0; overflow: auto;
    scrollbar-color: #b9c7bf transparent; container: supplier-brief-layout / inline-size;
}
.supplier-brief, .supplier-brief-message { width: min(100%, 49rem); margin: clamp(22px, 4cqw, 62px) auto; }
.supplier-brief-summary { padding: clamp(20px, 3cqw, 36px); border-radius: 14px; background: #f2f1f9; color: #302c46; }
.supplier-brief-summary h3, .supplier-brief-next h3 {
    margin: 0; font: inherit; font-size: 1rem; font-weight: 650; letter-spacing: -.02em;
}
.supplier-brief-summary h3 { display: flex; align-items: center; gap: 9px; }
.supplier-brief-summary h3 .audit-icon { width: 20px; height: 20px; color: #6b55ad; }
.supplier-brief-summary p { margin: 14px 0 0; max-width: 67ch; font-size: clamp(1rem, 1.45cqw, 1.17rem); line-height: 1.6; overflow-wrap: anywhere; }
.supplier-brief-next { margin-top: clamp(22px, 3cqw, 32px); }
.supplier-brief-next h3 { margin-bottom: 8px; }
.supplier-brief-next button {
    width: 100%; display: flex; align-items: center; gap: 12px; padding: 13px 12px;
    border: 0; background: transparent; color: var(--alignment-ink); font: inherit; text-align: start; cursor: pointer;
}
.supplier-brief-next button { min-height: 56px; padding-inline: 16px; border: 1px solid var(--alignment-line); border-radius: 10px; background: white; font-weight: 550; line-height: 1.45; overflow-wrap: anywhere; }
.supplier-brief-next button .audit-icon { color: #34664f; flex: none; }
.supplier-brief-next button .audit-icon:last-child { margin-inline-start: auto; width: 16px; }
.supplier-brief-message { color: var(--alignment-soft); }
.supplier-brief-message button {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 6px 11px;
    border: 1px solid var(--alignment-line); border-radius: 8px; background: white; color: #27513e; font: inherit; font-size: .84rem; cursor: pointer;
}
.supplier-brief-next button:hover, .supplier-brief-message button:hover { background: #eef5f0; }
.supplier-brief:has(.has-brief) {
    width: min(100%, 84rem);
    margin-block: clamp(18px, 2.3cqw, 36px);
}
#supplier-state-workspace .supplier-brief .brief-heading h2 {
    font-size: clamp(1.35rem, 2.1cqw, 1.8rem); letter-spacing: -.035em;
}
.supplier-brief .brief-latest {
    margin-top: 16px; padding: 16px clamp(16px, 2cqw, 26px);
    border-inline-start: 3px solid #56806a; border-radius: 0 8px 8px 0;
}
#supplier-state-workspace .supplier-brief .brief-latest p {
    max-width: 78ch; font-size: clamp(1.06rem, 1.6cqw, 1.28rem); line-height: 1.4;
}
.brief-sections {
    display: grid; grid-template-columns: minmax(0, 1fr); align-items: start;
    gap: 24px clamp(24px, 3.5cqw, 48px); margin-top: clamp(22px, 2.4cqw, 36px);
}
.brief-sections > .brief-section { min-width: 0; margin: 0; padding: 0; border: 0; }
#supplier-state-workspace .brief-sections h3 {
    align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid #bfcec5;
    font-size: clamp(1.06rem, 1.4cqw, 1.2rem); font-weight: 650; letter-spacing: -.025em;
}
#supplier-state-workspace .brief-sections h3 .audit-icon {
    flex: none; box-sizing: content-box; width: 18px; height: 18px; padding: 6px;
    border-radius: 8px; color: #32664e; background: #e7f1ea;
}
#supplier-state-workspace .brief-sections > section + section h3 .audit-icon {
    color: #835919; background: #f8eedb;
}
.brief-sections .brief-count {
    flex: none; padding: 3px 8px; border-radius: 20px;
    color: #405a4b; background: #eaf0ec;
}
.brief-sections .brief-items { list-style: none; margin: 0; padding: 0; }
.brief-sections .brief-items > li {
    min-width: 0; padding: 9px 0 12px; border-bottom: 1px solid var(--brief-rule);
}
.brief-sections h4 { margin: 0; }
#supplier-state-workspace .brief-sections .brief-topic {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px; width: 100%;
    min-height: 36px; padding: 5px 2px; font-size: 1rem; font-weight: 650; line-height: 1.45;
}
.brief-sections .brief-topic .audit-icon { flex: none; align-self: center; width: 15px; height: 15px; }
.brief-sections :is(.brief-question-detail, .brief-guidance) { max-width: 65ch; padding-inline: 2px; }
.brief-sections .brief-question-detail { margin-bottom: 3px; }
#supplier-state-workspace .brief-sections .brief-empty { padding-block: 8px 12px; }
@container supplier-brief-layout (min-width: 52rem) {
    .supplier-brief .brief-latest {
        display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 18px;
    }
    .supplier-brief .brief-latest > :is(p, blockquote) { grid-column: 1 / -1; }
    .supplier-brief .brief-latest time { grid-column: 2; grid-row: 1; align-self: center; margin: 0; }
    .brief-sections { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    /* A single active list can use both columns while the empty state keeps its place in reading order. */
    .brief-sections:has(h3 + .brief-empty):has(.brief-items) { grid-template-columns: minmax(0, 1fr); }
    .brief-sections:has(h3 + .brief-empty) .brief-items {
        display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(24px, 3.5cqw, 48px);
    }
}
@media (pointer: coarse) {
    #supplier-state-workspace .brief-sections .brief-topic { min-height: 44px; }
}

/* The two answer columns keep their role-specific editing cues, including on narrow screens. */
#supplier-workspace-panel-checklist .supplier-state-requirement-toolbar {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px;
}
#spec-alignment-view #supplier-workspace-panel-checklist .supplier-state-filter-tabs {
    flex: 0 1 auto; max-width: 100%; gap: 2px; padding: 3px; overflow-x: auto;
    border-radius: 8px; background: #edf2ef !important; scrollbar-width: thin;
}
#spec-alignment-view #supplier-workspace-panel-checklist .supplier-state-filter-tabs button {
    flex: none; min-height: 32px; padding-inline: 10px; border-radius: 6px !important;
    color: #43564a !important; font-size: 12px; font-variant-numeric: tabular-nums;
}
#spec-alignment-view #supplier-workspace-panel-checklist .supplier-state-filter-tabs button.active {
    background: #fff !important; color: #174e38 !important; box-shadow: inset 0 0 0 1px #b4c9bc !important;
}
#supplier-workspace-panel-checklist .supplier-state-filter-tabs button span { color: inherit; }
#supplier-workspace-panel-checklist .supplier-state-toolbar-actions { margin-inline-start: auto; }
#supplier-workspace-panel-checklist .supplier-state-table-scroll {
    border-color: #d6dfd9; border-radius: 9px; scrollbar-color: #aabbb1 #f5f7f5;
}
#spec-alignment-view #supplier-workspace-panel-checklist table {
    min-width: 720px; font-size: 13px !important; color: #273a30;
}
#spec-alignment-view #supplier-workspace-panel-checklist thead th {
    height: 42px; background: #eff3f0 !important; color: #344c3d !important; font-size: 12px !important;
}
#supplier-workspace-panel-checklist thead th:nth-child(1) { width: 42px; }
#supplier-workspace-panel-checklist thead th:nth-child(3) { width: 15%; min-width: 110px; }
#supplier-workspace-panel-checklist thead th:nth-child(n+4) { width: auto; }
#spec-alignment-view #supplier-workspace-panel-checklist tr[data-criterion-id] td {
    height: 42px; padding-block: 6px; border-color: #e1e7e2 !important;
}
#supplier-workspace-panel-checklist tr[data-criterion-id] td:first-child { color: #526459; font-variant-numeric: tabular-nums; }
#supplier-workspace-panel-checklist td strong { color: #243a2c; font-weight: 600; }
#spec-alignment-view #supplier-workspace-panel-checklist .workspace-checklist-section-row th {
    background: #e5eee8 !important; color: #31583e !important; font-weight: 600 !important;
}
#spec-alignment-view #supplier-workspace-panel-checklist .workspace-checklist-subsection-row th {
    background: #f2f6f3 !important; color: #405c49 !important;
}
#spec-alignment-view #supplier-state-workspace #supplier-workspace-panel-checklist .checklist-answer-editable {
    background: #fff9e8 !important;
}
#supplier-workspace-panel-checklist td.checklist-answer-editable:focus-within {
    outline: 2px solid #417555; outline-offset: -2px;
}
#spec-alignment-view #supplier-workspace-panel-checklist tr[data-criterion-id]:focus-visible {
    outline: 2px solid #417555; outline-offset: -2px;
}
#spec-alignment-view #supplier-workspace-panel-checklist tr[data-criterion-id].is-selected td:nth-child(-n+3) {
    background: #e8f1ea !important;
}
#spec-alignment-view #supplier-workspace-panel-checklist .supplier-state-status {
    font-size: 11px !important; line-height: 1.35; padding: 3px 7px;
}
@container (max-width: 790px) {
    #supplier-workspace-panel-checklist thead th:nth-child(2),
    #supplier-workspace-panel-checklist tr[data-criterion-id] td:nth-child(2) {
        position: sticky; inset-inline-start: 0; z-index: 1; background: #fff;
        box-shadow: inset -1px 0 #d6dfd9;
    }
    #supplier-workspace-panel-checklist .supplier-state-filter-tabs { flex: 1 1 190px; }
}
.supplier-alignment-inspector-bar { flex: none; padding: 10px 12px 4px; }
.supplier-alignment-inspector-bar button { min-height: 30px; border: 0; background: transparent; }
.supplier-alignment-inspector-bar button:hover { background: #eef5f0; }
#supplier-state-workspace .supplier-alignment-inspector { display: flex; flex-direction: column; min-width: 0; }
#supplier-state-workspace .supplier-alignment-inspector .supplier-state-sidebar-panel { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
#supplier-state-workspace .supplier-alignment-shell .supplier-state-center-panel { padding-top: 12px; }
.supplier-thread-context { margin: 4px 0 0; font-size: .76rem; }
.supplier-thread-context summary,
#supplier-chat-thread-dialog .supplier-chat-thread-pinned-files > summary { cursor: pointer; color: #3b6053; }
#supplier-chat-thread-dialog .supplier-chat-thread-pinned-files > summary {
    padding-block: 3px; font-size: .8rem;
}
#supplier-chat-thread-dialog .supplier-chat-thread-pinned-files > summary > i { margin-inline: 4px 6px; }
#supplier-chat-thread-dialog .supplier-chat-thread-pinned-files > summary > span { margin-inline-start: 5px; }
#supplier-chat-thread-dialog .supplier-chat-thread-dialog { border-radius: 14px; }
#supplier-chat-thread-dialog .supplier-chat-thread-header { align-items: flex-start; }
#supplier-chat-thread-dialog .supplier-chat-thread-header h2 { line-height: 1.35; }
#supplier-chat-thread-dialog .supplier-question-resolution-state { flex-wrap: wrap; }
#supplier-state-workspace .supplier-alignment-inspector .ai-sync-workspace > header > p:first-of-type { font-size: .8rem; line-height: 1.45; }

@container (max-width: 790px) {
    #supplier-state-workspace .supplier-alignment-main.has-inspector { grid-template-columns: minmax(0,1fr); }
    .supplier-alignment-main.has-inspector > .supplier-state-requirements { display: none; }
}
@container (max-width: 500px) {
    .supplier-alignment-header { gap: 6px; padding: 8px; }
    .supplier-alignment-avatar { display: none; }
    .supplier-alignment-identity { gap: 5px; }
    #supplier-state-workspace .supplier-alignment-tabs { gap: 0; align-items: stretch; }
    .supplier-alignment-tabs button { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 4px; padding: 9px 3px; font-size: .75rem; overflow-wrap: anywhere; }
    .supplier-alignment-actions .supplier-alignment-discuss span { display: none; }
    .supplier-alignment-header :is(button,summary) { min-width: 44px; min-height: 44px; }
    .supplier-brief-message button { min-height: 44px; }
    #supplier-state-workspace .supplier-alignment-main > .supplier-state-requirements { padding-inline: 8px; }
    #supplier-state-workspace .supplier-state-file-row { grid-template-columns: minmax(100px,1fr) minmax(44px,.45fr) auto; gap: 6px; }
    #supplier-state-workspace .supplier-state-file-row > :is(:nth-child(2),:nth-child(4)) { display: none; }
    #supplier-state-workspace .supplier-state-requirement-toolbar { display: flex; flex-wrap: wrap; }
    #supplier-state-workspace .supplier-state-filter-tabs { max-width: 100%; overflow-x: auto; }
}

@media (max-width: 900px) {
    body.workspace-shell-active #spec-alignment-view #spec-three-pane-layout.supplier-state-workspace-active {
        flex-flow: row nowrap; align-items: stretch; flex: none;
        height: calc(100dvh - var(--dashboard-mobile-top-offset, 56px));
    }
}
@media (max-width: 720px) {
    body.workspace-shell-active #spec-alignment-view #spec-three-pane-layout.supplier-state-workspace-active > #spec-supplier-sidebar { display: none !important; }
    body.workspace-shell-active #spec-alignment-view #spec-three-pane-layout.supplier-state-workspace-active { min-width: 0 !important; width: 100% !important; }
    body.workspace-shell-active #spec-alignment-view #spec-three-pane-layout.supplier-state-workspace-active > #supplier-state-workspace { flex: 1 1 100%; min-width: 0 !important; width: 100% !important; }
}

/* Questions are a reading list. The title opens the row and the menu is an independent target. */
#supplier-workspace-panel-questions .supplier-state-questions-card {
    width: min(100%, 64rem); margin-inline: auto; container: question-list / inline-size;
}
#supplier-workspace-panel-questions .supplier-state-questions-card > header {
    gap: 12px; padding: 14px 6px; border-bottom: 1px solid var(--alignment-line);
}
#supplier-workspace-panel-questions .supplier-state-summary-add {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    width: auto; flex: none; height: auto; min-height: 36px; padding: 6px 12px;
    border-radius: 7px; background: #1c513d; color: white;
    font: 550 .82rem/1.25 var(--font-main); white-space: normal;
}
#supplier-workspace-panel-questions .supplier-state-summary-add:hover:enabled { background: #103f2d; color: white; }
#supplier-workspace-panel-questions .supplier-state-question-list { padding: 0; }
#supplier-workspace-panel-questions .supplier-state-question-row {
    position: relative; grid-template-columns: 2.35rem minmax(0, 1fr) auto auto;
    gap: 6px 14px; padding: 12px 6px; border-color: var(--alignment-line);
}
#supplier-workspace-panel-questions .supplier-state-question-row:is(:hover, :focus-within) { background: #f4f7f5; }
#supplier-workspace-panel-questions .supplier-state-question-number {
    color: #54665d; font: 550 .76rem/1.4 var(--font-main); font-variant-numeric: tabular-nums; text-align: center;
}
#supplier-workspace-panel-questions .supplier-state-question-title {
    color: var(--alignment-ink); font: 600 .95rem/1.4 var(--font-main); white-space: normal;
    overflow: visible; overflow-wrap: anywhere; text-align: start; text-decoration: none;
}
#supplier-workspace-panel-questions .supplier-state-question-title::after { content: ""; position: absolute; inset: 0; }
#supplier-workspace-panel-questions .supplier-state-question-title:focus-visible::after { outline: 2px solid #237457; outline-offset: -2px; }
#supplier-workspace-panel-questions .supplier-state-question-meta {
    display: block; margin-top: 3px; text-align: start; font-size: .75rem; color: var(--alignment-soft);
}
#supplier-workspace-panel-questions .supplier-state-question-replies,
.supplier-question-reply-count { display: inline-flex; align-items: center; gap: 6px; color: #53685c; font-variant-numeric: tabular-nums; }
.supplier-question-reply-count .audit-icon { width: 16px; height: 16px; }
#supplier-workspace-panel-questions .supplier-question-row-menu { position: relative; width: 34px; height: 34px; }
#supplier-workspace-panel-questions .supplier-state-resolved-questions {
    position: static; margin: 12px 0 0; max-height: none; overflow: visible; background: transparent;
}
#supplier-workspace-panel-questions .supplier-state-resolved-questions-toggle {
    min-height: 44px; padding: 6px 12px; color: #405d4c; background: #f1f5f1; border-radius: 6px;
}
#supplier-workspace-panel-questions .supplier-state-resolved-questions-toggle[aria-expanded="true"] > .audit-icon { transform: rotate(90deg); }
#supplier-workspace-panel-questions .supplier-state-resolved-question-list { overflow: visible; max-height: none; }
#supplier-workspace-panel-questions .is-resolved { opacity: 1; }
@container question-list (max-width: 34rem) {
    #supplier-workspace-panel-questions .supplier-state-question-row { grid-template-columns: 1.8rem minmax(0,1fr) auto; gap: 5px 7px; }
    #supplier-workspace-panel-questions .supplier-state-question-number { grid-column: 1; align-self: start; padding-top: 3px; }
    #supplier-workspace-panel-questions .supplier-state-question-copy { grid-column: 2 / -1; }
    #supplier-workspace-panel-questions .supplier-state-question-row > .supplier-state-status { grid-column: 2; grid-row: 2; justify-self: start; }
    #supplier-workspace-panel-questions .supplier-state-question-replies { grid-column: 3; grid-row: 2; }
    #supplier-workspace-panel-questions .supplier-question-row-menu,
    #supplier-workspace-panel-questions .supplier-state-summary-add { min-height: 44px; }
}

/* The item and its two answers anchor the inspector, with provenance below its actions. */
#supplier-sidebar-panel .supplier-state-item-workspace { container: item-inspector / inline-size; }
#supplier-sidebar-panel .supplier-state-inspector-head {
    flex-wrap: wrap; gap: 5px 10px; min-height: 0; padding: 8px 18px 12px;
}
#supplier-sidebar-panel .supplier-state-inspector-head h2 {
    flex: 1 0 100%; margin: 4px 0 0; white-space: normal; overflow-wrap: anywhere; line-height: 1.2;
}
#supplier-sidebar-panel .supplier-state-inspector-nav button { width: 34px; height: 34px; }
#supplier-sidebar-panel .supplier-state-inspector-tabs {
    position: static; width: auto; height: auto; flex-flow: row nowrap; align-items: stretch;
    margin: 0; padding: 0 16px; gap: 4px; background: transparent;
}
#supplier-sidebar-panel .supplier-state-inspector-tabs button { min-height: 38px; font-size: .8rem; }
#supplier-sidebar-panel .supplier-state-inspector-body { padding: 16px 18px; }
#supplier-sidebar-panel .supplier-item-answers { display: grid; gap: 8px; }
#supplier-sidebar-panel .supplier-item-answers > .supplier-state-answer-row {
    grid-template-columns: minmax(0, 1fr); gap: 6px; align-content: start;
    margin: 0; padding: 12px 14px; border-width: 1px;
}
#supplier-sidebar-panel .supplier-item-answers dt { color: #394e43; }
#supplier-sidebar-panel .supplier-item-answers dt .audit-icon { width: 15px; height: 15px; }
#supplier-sidebar-panel .supplier-item-answers dd { white-space: pre-line; overflow-wrap: anywhere; }
#supplier-sidebar-panel .supplier-item-answers .is-editable dd { white-space: normal; }
#supplier-sidebar-panel textarea.supplier-state-answer-input {
    display: block; field-sizing: content; resize: vertical; min-height: 3.2em; max-height: 10rem; overflow: auto;
}
.supplier-item-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
#supplier-sidebar-panel .supplier-item-actions button {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px;
    padding: 6px 11px; border: 1px solid #d2dcd5; border-radius: 6px;
    background: #fff; color: #284938; font: 550 .8rem/1.3 var(--font-main); cursor: pointer;
}
#supplier-sidebar-panel .supplier-item-actions :is(.is-edit, .is-accept) { background: #1c513d; border-color: #1c513d; color: white; }
#supplier-sidebar-panel .supplier-item-actions .is-delete { margin-inline-start: auto; background: transparent; border-color: transparent; color: #86483c; }
#supplier-sidebar-panel .supplier-item-actions button:hover:enabled { box-shadow: inset 0 0 0 1px currentColor; }
#supplier-sidebar-panel .supplier-item-actions button:disabled { opacity: .5; cursor: default; }
.supplier-item-context {
    display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px 28px;
    margin: 20px 0 0; padding: 18px 0 0; border-top: 1px solid #dce4de;
}
.supplier-item-context dt { margin-bottom: 3px; color: #596a60; font-size: .75rem; }
.supplier-item-context dd { margin: 0; color: #293c31; font-size: .86rem; line-height: 1.55; overflow-wrap: anywhere; }
.supplier-item-description { grid-column: 1 / -1; max-width: 66ch; }
@container item-inspector (min-width: 34rem) {
    #supplier-sidebar-panel .supplier-item-answers { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@container item-inspector (max-width: 28rem) {
    #supplier-sidebar-panel .supplier-state-inspector-body { padding-inline: 12px; }
    #supplier-sidebar-panel .supplier-state-inspector-tabs { padding-inline: 6px; }
    #supplier-sidebar-panel :is(.supplier-item-actions, .supplier-state-inspector-tabs, .supplier-state-inspector-nav) button { min-height: 44px; }
}

/* Keep the conversation readable while the resolution decision stays together. */
#supplier-chat-thread-dialog .supplier-chat-thread-dialog {
    width: min(48rem, 96vw); background: #fff; border-color: #ced9d1; border-radius: 14px;
}
#supplier-chat-thread-dialog .supplier-chat-thread-header {
    display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px;
    padding: 16px 20px 14px; background: #fff; border-bottom: 0;
}
#supplier-chat-thread-dialog #supplier-chat-thread-title {
    margin: 4px 0 0; white-space: normal; overflow-wrap: anywhere;
    max-height: 18dvh; overflow-y: auto; line-height: 1.2; outline: none;
}
.supplier-thread-byline { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
#supplier-chat-thread-dialog .supplier-chat-thread-count {
    display: inline; margin: 0; padding: 0; background: transparent; font: 400 .75rem/1.4 var(--font-main); color: #55695e;
}
#supplier-chat-thread-dialog .supplier-chat-thread-header-actions { gap: 4px; }
#supplier-chat-thread-dialog .supplier-chat-thread-header-actions button {
    display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
}
#supplier-chat-thread-dialog .supplier-thread-context p {
    white-space: pre-line; overflow: auto; max-height: 15dvh; color: #44584b; font-size: .83rem; line-height: 1.5;
}
.supplier-thread-resolution {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 20px; border-block: 1px solid #dce5dd; background: #f5f8f5;
}
#supplier-chat-thread-dialog .supplier-question-resolution-state {
    flex: 1; min-width: 0; gap: 3px 14px; padding: 0; border: 0; color: #465b4d; font-weight: 550;
}
#supplier-chat-thread-dialog .supplier-question-resolution-state small { flex-basis: 100%; font-weight: 400; line-height: 1.4; }
.supplier-question-resolution-state .audit-icon { width: 14px; height: 14px; }
#supplier-chat-thread-dialog .supplier-thread-resolution .supplier-chat-thread-resolve {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 36px; padding: 6px 10px; border: 1px solid #a4bcad; border-radius: 6px;
    background: #fff; color: #285a3e; font: 600 .8rem/1.3 var(--font-main); cursor: pointer;
}
#supplier-chat-thread-dialog .supplier-chat-thread-resolve > span { display: inline; }
#supplier-chat-thread-dialog .supplier-chat-thread-resolve:hover:enabled { background: #e9f1eb; }
#supplier-chat-thread-dialog .supplier-chat-thread-messages {
    padding: 18px 20px; gap: 12px; overscroll-behavior: contain; background: #f7f8f5;
}
#supplier-chat-thread-dialog .supplier-chat-thread-bubble {
    border: 1px solid #dae2da; background: #fff; box-shadow: none; border-radius: 10px 10px 10px 3px;
    padding: 9px 12px; gap: 5px;
}
#supplier-chat-thread-dialog .is-sent .supplier-chat-thread-bubble { background: #e5f1e8; border-color: #cbded1; border-radius: 10px 10px 3px 10px; }
#supplier-chat-thread-dialog .supplier-chat-thread-sender { gap: 6px; font-size: .76rem; }
#supplier-chat-thread-dialog .supplier-chat-thread-message-actions .telegram-more-btn {
    display: grid; place-items: center; border: 0; background: transparent; color: #4d6555; box-shadow: none;
}
@media (hover: hover) and (pointer: fine) {
    #supplier-chat-thread-dialog .supplier-chat-thread-message:not(:hover, :focus-within) .telegram-more-btn { opacity: 0; }
}
#supplier-chat-thread-dialog .supplier-chat-thread-role {
    background: transparent; padding: 0; border: 0; color: #53665b; font-size: .7rem; font-weight: 450;
}
#supplier-chat-thread-dialog .supplier-chat-thread-bubble :is(.message-original-text, .message-translated-text) { font-size: .9rem; line-height: 1.5; }
#supplier-chat-thread-dialog .supplier-chat-thread-bubble > small { color: #52675a; font-size: .67rem; }
#supplier-chat-thread-dialog .supplier-chat-thread-composer {
    padding: 12px 16px max(10px, env(safe-area-inset-bottom)); gap: 8px; background: #fff; border-color: #d4dfd6;
}
#supplier-chat-thread-dialog .supplier-chat-thread-composer > button { width: 40px; height: 40px; }
#supplier-chat-thread-dialog .supplier-chat-thread-composer > .is-send { background: #194e39; color: #fff; border-color: #194e39; }
#supplier-chat-thread-dialog .supplier-chat-thread-composer textarea { display: block; font-size: .9rem; line-height: 1.45; }
#supplier-chat-thread-dialog :is(button, summary, textarea):focus-visible { outline: 2px solid #387450; outline-offset: 2px; }
@media (max-width: 700px) {
    #supplier-chat-thread-dialog .supplier-chat-thread-dialog { width: 100%; height: 100dvh; border: 0; border-radius: 0; }
    #supplier-chat-thread-dialog .supplier-chat-thread-header { padding: max(10px, env(safe-area-inset-top)) 12px 10px; gap: 6px; }
    #supplier-chat-thread-dialog .supplier-chat-thread-header > div:first-child { display: contents; }
    #supplier-chat-thread-dialog .supplier-thread-byline { grid-area: 1 / 1; align-self: center; }
    #supplier-chat-thread-dialog .supplier-chat-thread-header-actions { grid-area: 1 / 2; }
    #supplier-chat-thread-dialog :is(#supplier-chat-thread-title, .supplier-thread-context) { grid-column: 1 / -1; margin-block: 0; }
    #supplier-chat-thread-dialog .supplier-thread-resolution { padding: 8px 12px; gap: 8px; }
    #supplier-chat-thread-dialog .supplier-chat-thread-messages { padding: 12px; }
    #supplier-chat-thread-dialog .supplier-chat-thread-header-actions button,
    #supplier-chat-thread-dialog .supplier-chat-thread-composer > button { width: 44px; height: 44px; }
    #supplier-chat-thread-dialog .supplier-thread-resolution .supplier-chat-thread-resolve { min-height: 44px; }
    #supplier-chat-thread-dialog .supplier-chat-thread-composer { padding-inline: 10px; }
    #supplier-chat-thread-dialog .supplier-chat-thread-composer textarea { font-size: 16px; }
}
