/* Blue uses the original paint values. All other themes replace paint roles at the root. */
[data-quote-theme] {
  --theme-page:#0b141b;
  --theme-surface:#121c24;
  --theme-card:#121f29;
  --theme-inner:#163c55;
  --theme-text:#fafdff;
  --theme-muted:#b8cbd8;
  --theme-accent:#55b3f7;
  --theme-accent-soft:#14374f;
  --theme-primary:#176392;
  --theme-on-primary:#ffffff;
  --theme-secondary:#22d3ee;
  --theme-border:#304b60;
  --theme-success:#8de1b9;
  --theme-success-soft:#174936;
  --theme-danger:#ffb3bf;
  --theme-danger-soft:#4c2635;
  --theme-warning:#f2d28d;
  --theme-warning-soft:#483d26;
  --theme-shadow:0 10px 30px #03111c26;
  --theme-overlay:#02101bb3;
  --theme-scheme:dark;
}

[data-quote-theme='white'] {
  --theme-page:#f4f6f8;
  --theme-surface:#ffffff;
  --theme-card:#ffffff;
  --theme-inner:#f1f5f9;
  --theme-text:#243446;
  --theme-muted:#536579;
  --theme-accent:#28638b;
  --theme-accent-soft:#e6eff6;
  --theme-primary:#28638b;
  --theme-secondary:#267c85;
  --theme-border:#d3dde5;
  --theme-success:#1a704b;
  --theme-success-soft:#e8f5ed;
  --theme-danger:#ac3450;
  --theme-danger-soft:#fbeaf0;
  --theme-warning:#866000;
  --theme-warning-soft:#faf1dc;
  --theme-shadow:0 6px 24px #2434460c;
  --theme-overlay:#263c5a66;
  --theme-scheme:light;
}

[data-quote-theme='rose'] {
  --theme-page:#fcf8fb;
  --theme-surface:#fff6fa;
  --theme-card:#fffafb;
  --theme-inner:#f8e8f0;
  --theme-text:#493346;
  --theme-muted:#705268;
  --theme-accent:#993865;
  --theme-accent-soft:#f3dce7;
  --theme-primary:#a94677;
  --theme-secondary:#387b78;
  --theme-border:#e7ccd9;
  --theme-success:#256e4c;
  --theme-success-soft:#e7f3eb;
  --theme-danger:#ad3450;
  --theme-danger-soft:#fbe5ea;
  --theme-warning:#8c6317;
  --theme-warning-soft:#fbf0db;
  --theme-shadow:0 6px 24px #7038540c;
  --theme-overlay:#4d293c66;
  --theme-scheme:light;
}

[data-quote-theme='dark'] {
  --theme-page:#11161d;
  --theme-surface:#1b222c;
  --theme-card:#222d3a;
  --theme-inner:#17202b;
  --theme-text:#e6edf5;
  --theme-muted:#a6b6c7;
  --theme-accent:#a4bfd5;
  --theme-accent-soft:#293d4e;
  --theme-primary:#3f637e;
  --theme-secondary:#99cec5;
  --theme-border:#3e4c5e;
  --theme-success:#9ed9b7;
  --theme-success-soft:#263e33;
  --theme-danger:#f3b6c0;
  --theme-danger-soft:#453039;
  --theme-warning:#e4c98c;
  --theme-warning-soft:#423c2e;
  --theme-shadow:0 10px 30px #00000026;
  --theme-overlay:#070c13bf;
  --theme-scheme:dark;
}

[data-quote-theme='teal'] {
  --theme-page:#202020;
  --theme-surface:#333333;
  --theme-card:#444444;
  --theme-inner:#292929;
  --theme-text:#f7f7f2;
  --theme-muted:#c5c5bd;
  --theme-accent:#ffcc00;
  --theme-accent-soft:#49401b;
  --theme-primary:#ffcc00;
  --theme-on-primary:#202020;
  --theme-secondary:#b8b8af;
  --theme-border:#626258;
  --theme-success:#9cdda7;
  --theme-success-soft:#273e2e;
  --theme-danger:#ff9ca6;
  --theme-danger-soft:#502b30;
  --theme-warning:#ffdb58;
  --theme-warning-soft:#493f1d;
  --theme-shadow:0 6px 24px #00000026;
  --theme-overlay:#00000099;
  --theme-scheme:dark;
}

[data-quote-theme='black'] {
  --theme-page:#060606;
  --theme-surface:#101010;
  --theme-card:#141414;
  --theme-inner:#1c1c1c;
  --theme-text:#f7f9fc;
  --theme-muted:#b4bdc8;
  --theme-accent:#62c7ff;
  --theme-accent-soft:#112635;
  --theme-primary:#146798;
  --theme-on-primary:#ffffff;
  --theme-secondary:#dce4ef;
  --theme-border:#35414c;
  --theme-success:#a5d9bf;
  --theme-success-soft:#1a2a23;
  --theme-danger:#efb8c2;
  --theme-danger-soft:#2d1e24;
  --theme-warning:#e0d0a4;
  --theme-warning-soft:#29251c;
  --theme-shadow:0 10px 30px #00000066;
  --theme-overlay:#000000cc;
  --theme-scheme:dark;
}


[data-quote-theme]{color:var(--theme-text)!important;background:var(--theme-page)!important;color-scheme:var(--theme-scheme)}
[data-quote-theme] :where(section,article,fieldset,.margin-step,.quote-kanban-shell,.quote-kanban-column,.quote-kanban-group,.margin-identification,.margin-workbench-body,.quote-chat-shell,.quote-chat-messages,.margin-wizard-review,.quote-kanban-summary){background:var(--theme-card)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important}
[data-quote-theme] :where(header,.quote-card-header,.quote-kanban-column>header,.quote-kanban-group>header,.margin-workbench-head,.quote-chat-shell>header){background:var(--theme-inner)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important}
[data-quote-theme] :where(h1,h2,h3,h4,strong,b,label,p,span,legend){color:inherit}
[data-quote-theme] :where(small,em,.margin-wizard-hint){color:var(--theme-muted)!important}
[data-quote-theme] :where(input,textarea,select){background:var(--theme-surface)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important}
[data-quote-theme] :where(button,.quote-buyer-private,.quote-card-meta>span,.quote-card-progress,.quote-chat-participants){background:var(--theme-accent-soft)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important}
[data-quote-theme] :where(button.primary,.primary-buyer-send,.quote-chat-send,.quote-answer-action,button.active){background:var(--theme-primary)!important;color:var(--theme-on-primary)!important}
[data-quote-theme] :where(.quote-kanban-card,.quote-card-meta,.margin-product-suggestions,.quote-chat-messages article,.quote-chat-emoji-panel){background:var(--theme-surface)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important}
[data-quote-theme] .quote-chat-messages article.mine{background:var(--theme-accent-soft)!important}
[data-quote-theme] .quote-kanban-column{border-top-color:var(--theme-accent)!important}
[data-quote-theme] :where(th,td,footer,nav){color:var(--theme-text)!important;border-color:var(--theme-border)!important}
.quote-theme-choice{display:flex;align-items:center;gap:6px;font-size:11px;margin-left:auto}.quote-theme-choice select{width:150px;padding:7px;border-radius:8px}

/* Strongly scoped paint roles override older fixed colors without changing layout. */
:is(#margin-view,#margin-workbench-dialog,#margin-record-details,.quote-chat-dock,.margin-confirm-dialog)[data-quote-theme] :is(h1,h2,h3,h4,p,label,legend,strong,b,span,a,td,th,summary,li){color:var(--theme-text)!important}
:is(#margin-view,#margin-workbench-dialog,#margin-record-details,.quote-chat-dock,.margin-confirm-dialog)[data-quote-theme] :is(small,em,time){color:var(--theme-muted)!important}
:is(#margin-view,#margin-workbench-dialog,#margin-record-details,.quote-chat-dock,.margin-confirm-dialog)[data-quote-theme] :is(.margin-heading,.margin-readonly-note,.margin-readonly-banner,.margin-admin-preview,.margin-step,.margin-panel,.quote-kanban-shell,.quote-kanban-group,.quote-kanban-column,.quote-kanban-card,.quote-card-meta,.margin-form-grid,.margin-identification,.margin-workbench-body,.quote-chat-shell,.quote-chat-messages,.margin-wizard-review,#margin-wizard-review){background:var(--theme-card)!important;background-image:none!important;border-color:var(--theme-border)!important;color:var(--theme-text)!important}
#margin-view[data-quote-theme] #margin-quote-overview,#margin-view[data-quote-theme] #margin-quote-overview :is(.quote-overview-counts>span,.quote-kanban-filters,.quote-overview-filters){background:var(--theme-surface)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important}
#margin-view[data-quote-theme] #margin-quote-overview :is(strong,small,span,label){color:var(--theme-text)!important}
:is(#margin-view,#margin-workbench-dialog,#margin-record-details,.quote-chat-dock,.margin-confirm-dialog)[data-quote-theme] :is(header,.quote-kanban-column>header,.quote-kanban-group>header){background:var(--theme-inner)!important;background-image:none!important;border-color:var(--theme-border)!important}
:is(#margin-view,#margin-workbench-dialog,#margin-record-details,.quote-chat-dock,.margin-confirm-dialog)[data-quote-theme] :is(input,textarea,select,button){background:var(--theme-surface)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important}
:is(#margin-view,#margin-workbench-dialog,#margin-record-details,.quote-chat-dock,.margin-confirm-dialog)[data-quote-theme] :is(button.active,button.primary,.primary-buyer-send,.quote-chat-send,.quote-answer-action){background:var(--theme-primary)!important;color:var(--theme-on-primary)!important}
.margin-heading{flex-wrap:wrap}.quote-theme-choice{flex:0 0 auto}.buyer-team-portraits{flex:0 0 auto}
/* Blue uses the original paint values. All other themes replace paint roles at the root. */
[data-quote-canvas] {
  --theme-page:#0b141b;
  --theme-surface:#121c24;
  --theme-card:#121f29;
  --theme-inner:#163c55;
  --theme-text:#fafdff;
  --theme-muted:#b8cbd8;
  --theme-accent:#55b3f7;
  --theme-accent-soft:#14374f;
  --theme-primary:#176392;
  --theme-on-primary:#ffffff;
  --theme-secondary:#22d3ee;
  --theme-border:#304b60;
  --theme-success:#8de1b9;
  --theme-success-soft:#174936;
  --theme-danger:#ffb3bf;
  --theme-danger-soft:#4c2635;
  --theme-warning:#f2d28d;
  --theme-warning-soft:#483d26;
  --theme-shadow:0 10px 30px #03111c26;
  --theme-overlay:#02101bb3;
  --theme-scheme:dark;
}

[data-quote-canvas='white'] {
  --theme-page:#f4f6f8;
  --theme-surface:#ffffff;
  --theme-card:#ffffff;
  --theme-inner:#f1f5f9;
  --theme-text:#243446;
  --theme-muted:#536579;
  --theme-accent:#28638b;
  --theme-accent-soft:#e6eff6;
  --theme-primary:#28638b;
  --theme-secondary:#267c85;
  --theme-border:#d3dde5;
  --theme-success:#1a704b;
  --theme-success-soft:#e8f5ed;
  --theme-danger:#ac3450;
  --theme-danger-soft:#fbeaf0;
  --theme-warning:#866000;
  --theme-warning-soft:#faf1dc;
  --theme-shadow:0 6px 24px #2434460c;
  --theme-overlay:#263c5a66;
  --theme-scheme:light;
}

[data-quote-canvas='rose'] {
  --theme-page:#fcf8fb;
  --theme-surface:#fff6fa;
  --theme-card:#fffafb;
  --theme-inner:#f8e8f0;
  --theme-text:#493346;
  --theme-muted:#705268;
  --theme-accent:#993865;
  --theme-accent-soft:#f3dce7;
  --theme-primary:#a94677;
  --theme-secondary:#387b78;
  --theme-border:#e7ccd9;
  --theme-success:#256e4c;
  --theme-success-soft:#e7f3eb;
  --theme-danger:#ad3450;
  --theme-danger-soft:#fbe5ea;
  --theme-warning:#8c6317;
  --theme-warning-soft:#fbf0db;
  --theme-shadow:0 6px 24px #7038540c;
  --theme-overlay:#4d293c66;
  --theme-scheme:light;
}

[data-quote-canvas='dark'] {
  --theme-page:#11161d;
  --theme-surface:#1b222c;
  --theme-card:#222d3a;
  --theme-inner:#17202b;
  --theme-text:#e6edf5;
  --theme-muted:#a6b6c7;
  --theme-accent:#a4bfd5;
  --theme-accent-soft:#293d4e;
  --theme-primary:#3f637e;
  --theme-secondary:#99cec5;
  --theme-border:#3e4c5e;
  --theme-success:#9ed9b7;
  --theme-success-soft:#263e33;
  --theme-danger:#f3b6c0;
  --theme-danger-soft:#453039;
  --theme-warning:#e4c98c;
  --theme-warning-soft:#423c2e;
  --theme-shadow:0 10px 30px #00000026;
  --theme-overlay:#070c13bf;
  --theme-scheme:dark;
}

[data-quote-canvas='teal'] {
  --theme-page:#202020;
  --theme-surface:#333333;
  --theme-card:#444444;
  --theme-inner:#292929;
  --theme-text:#f7f7f2;
  --theme-muted:#c5c5bd;
  --theme-accent:#ffcc00;
  --theme-accent-soft:#49401b;
  --theme-primary:#ffcc00;
  --theme-on-primary:#202020;
  --theme-secondary:#b8b8af;
  --theme-border:#626258;
  --theme-success:#9cdda7;
  --theme-success-soft:#273e2e;
  --theme-danger:#ff9ca6;
  --theme-danger-soft:#502b30;
  --theme-warning:#ffdb58;
  --theme-warning-soft:#493f1d;
  --theme-shadow:0 6px 24px #00000026;
  --theme-overlay:#00000099;
  --theme-scheme:dark;
}

[data-quote-canvas='black'] {
  --theme-page:#060606;
  --theme-surface:#101010;
  --theme-card:#141414;
  --theme-inner:#1c1c1c;
  --theme-text:#f7f9fc;
  --theme-muted:#b4bdc8;
  --theme-accent:#62c7ff;
  --theme-accent-soft:#112635;
  --theme-primary:#146798;
  --theme-on-primary:#ffffff;
  --theme-secondary:#dce4ef;
  --theme-border:#35414c;
  --theme-success:#a5d9bf;
  --theme-success-soft:#1a2a23;
  --theme-danger:#efb8c2;
  --theme-danger-soft:#2d1e24;
  --theme-warning:#e0d0a4;
  --theme-warning-soft:#29251c;
  --theme-shadow:0 10px 30px #00000066;
  --theme-overlay:#000000cc;
  --theme-scheme:dark;
}



body[data-quote-canvas],body[data-quote-canvas] #dashboard,body[data-quote-canvas] #dashboard>main{background:var(--theme-page)!important;color:var(--theme-text)!important;min-height:100vh}
body[data-quote-canvas] .topbar{background:var(--theme-surface)!important;border-color:var(--theme-border)!important;color:var(--theme-text)!important}
body[data-quote-canvas] .topbar :is(h1,span,small,div){color:var(--theme-text)!important}
body[data-quote-canvas] .topbar button{background:var(--theme-accent-soft)!important;border-color:var(--theme-border)!important;color:var(--theme-text)!important}
body[data-quote-canvas] .topbar button.active{background:var(--theme-primary)!important;color:var(--theme-on-primary)!important}
#margin-view[data-quote-theme]{padding:18px;border:0!important;border-radius:12px;box-shadow:none!important}
#margin-view[data-quote-theme] :is(.margin-heading,.quote-kanban-shell,.quote-kanban-group,.margin-identification,.margin-step){border:0!important;box-shadow:none!important}
#margin-view[data-quote-theme] .margin-heading{background:transparent!important;gap:14px;padding-bottom:16px}
#margin-view[data-quote-theme] .margin-heading>div:first-child{flex:1 1 250px}
#margin-view[data-quote-theme] .margin-readonly-note{background:var(--theme-inner)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important}

#margin-view[data-quote-theme] :is(.margin-queue-tabs,.quote-kanban-tabs,#margin-quote-overview) button b{background:var(--theme-inner)!important;color:var(--theme-text)!important}
#margin-view[data-quote-theme] :is(.quote-card-badge,.quote-status-badge,.quote-card-status,.quote-card-meta>span){background:var(--theme-accent-soft)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important}

#quote-stock-stamp{display:block;margin-top:6px;font-size:11px;font-weight:500;color:var(--theme-muted,#55738a)}body[data-quote-canvas] #source-update-stamp{display:none}

/* Component surfaces: no legacy gradients or dark counters on light palettes. */
#margin-view[data-quote-theme] :is(.panel,.margin-history-panel,.margin-workspace,.margin-request-card-compact){background:var(--theme-card)!important;background-image:none!important;border-color:var(--theme-border)!important;box-shadow:0 4px 16px color-mix(in srgb,var(--theme-border) 20%,transparent)!important}
#margin-view[data-quote-theme] :is(.panel-head,.margin-history-panel>.panel-head,.quote-kanban-group>header,.quote-kanban-column>header,.quote-kanban-card>header){background:var(--theme-inner)!important;background-image:none!important;border-color:var(--theme-border)!important;color:var(--theme-text)!important}
#margin-view[data-quote-theme] :is(.panel-head,.quote-kanban-group>header,.quote-kanban-column>header) :is(h2,h3,strong,b,span){color:var(--theme-text)!important}
#margin-view[data-quote-theme] :is(.panel-head,.quote-kanban-group>header,.quote-kanban-column>header) :is(.kicker,small){color:var(--theme-accent)!important}
#margin-view[data-quote-theme] :is(.quote-kanban-column>header>b,.quote-kanban-group>header>b,.quote-kanban-card>header>b,.quote-queue-number,.margin-queue-tabs button>b,#margin-queue-tabs button>b){background:var(--theme-accent-soft)!important;background-image:none!important;color:var(--theme-accent)!important;border-color:var(--theme-border)!important}
#margin-view[data-quote-theme] :is(.quote-card-meta>span,.quote-buyer-private>span,.quote-card-progress,.quote-card-timing,.quote-live-timing,.quote-card-update,.quote-requester-update){background:var(--theme-inner)!important;background-image:none!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important}
#margin-view[data-quote-theme] :is(.quote-card-meta,.quote-buyer-private) :is(strong,b){color:var(--theme-text)!important}
#margin-view[data-quote-theme] :is(.quote-card-meta,.quote-buyer-private) :is(small,em){color:var(--theme-muted)!important}
#margin-view[data-quote-theme] .quote-kanban-column.column-pending{border-top-color:var(--theme-warning)!important}
#margin-view[data-quote-theme] .quote-kanban-column.column-negotiation{border-top-color:var(--theme-accent)!important}
#margin-view[data-quote-theme] .quote-kanban-column.column-done{border-top-color:var(--theme-success)!important}
#margin-view[data-quote-theme] .quote-kanban-column.column-lost{border-top-color:var(--theme-danger)!important}
#margin-view[data-quote-theme] :is(button.active,button.primary,.quote-answer-action,.primary-buyer-send){background:var(--theme-primary)!important;background-image:none!important;color:var(--theme-on-primary)!important}
#margin-view[data-quote-theme] :is(button.active,button.primary,.quote-answer-action,.primary-buyer-send) :is(span,strong,small){color:var(--theme-on-primary)!important}
#margin-view[data-quote-theme] :is(.panel-head,.quote-kanban-column>header,.quote-kanban-group>header) button{background:var(--theme-surface)!important;color:var(--theme-accent)!important;border-color:var(--theme-border)!important}
/* Fill the quotation workspace rather than centering it in a narrow container. */
body[data-quote-canvas] #dashboard>main{width:100%;max-width:none!important;margin:0!important;padding:12px clamp(8px,1vw,18px) 32px!important}
body[data-quote-canvas] #margin-view{width:100%;max-width:none!important;margin:0!important;padding:8px!important;background:var(--theme-page)!important}
body[data-quote-canvas] .margin-history-panel{width:100%;max-width:none!important;margin-left:0!important;margin-right:0!important}
body[data-quote-canvas] .topbar{padding-left:clamp(16px,2vw,28px);padding-right:clamp(16px,2vw,28px)}
#margin-view[data-quote-theme] .margin-history-panel>.panel-head{display:flex!important;flex-wrap:wrap!important;align-items:center!important;gap:12px!important;padding:16px!important}
#margin-view[data-quote-theme] .margin-history-panel>.panel-head>div:first-child{flex:1 1 230px;min-width:180px}
#margin-view[data-quote-theme] .margin-history-panel>.panel-head .margin-admin-preview{flex:0 1 175px!important;width:175px!important;min-width:145px!important;margin:0!important;background:transparent!important}
#margin-view[data-quote-theme] .margin-history-panel>.panel-head .margin-admin-preview :is(select,label){width:100%!important;min-width:0!important}
#margin-view[data-quote-theme] .margin-history-panel>.panel-head .margin-admin-preview label{background:transparent!important}
#margin-view #margin-quote-overview{padding:12px!important;gap:10px!important;grid-template-columns:minmax(0,1fr) auto!important}
#margin-view #margin-quote-overview .quote-overview-counts{grid-column:2!important;grid-row:1!important;align-self:center;justify-content:flex-end}
#margin-view #margin-quote-overview .quote-overview-counts>span{padding:0!important;background:transparent!important;border:0!important}
#margin-view #margin-quote-overview .quote-overview-filters{gap:10px!important;border-top:1px solid var(--theme-border,#dce5ed);padding-top:9px!important}
#margin-view #margin-quote-overview :is(input,select,button){min-height:32px;height:32px}
#margin-view #margin-quote-overview .quote-overview-filters label{font-size:9px!important}
#margin-view #margin-quote-overview .quote-times-disclosure{grid-column:1/-1;font-size:10px;color:var(--theme-muted,#657386)}
#margin-view #margin-quote-overview .quote-times-disclosure summary{cursor:pointer;width:fit-content;font-size:10px;color:var(--theme-muted,#657386)!important}
#margin-view #margin-quote-overview .quote-times-disclosure .quote-overview-times{justify-content:flex-start!important;margin-top:8px!important;gap:16px!important}
@media(max-width:700px){#margin-view #margin-quote-overview{grid-template-columns:1fr!important}#margin-view #margin-quote-overview .quote-overview-counts{grid-column:1!important;grid-row:auto!important;justify-content:flex-start}}
#margin-view #margin-quote-overview .quote-times-disclosure:not([open]) .quote-overview-times{display:none!important}
/* The scrollable column body must use the same palette as its frame. */
#margin-view[data-quote-theme] #margin-history .quote-kanban-board{align-items:stretch!important;background:transparent!important}
#margin-view[data-quote-theme] #margin-history .quote-kanban-column{background:var(--theme-inner)!important;background-image:none!important;overflow:hidden;border:1px solid var(--theme-border)!important;border-top:3px solid var(--theme-accent)!important;border-radius:10px}
#margin-view[data-quote-theme] #margin-history .quote-kanban-column>div{background:var(--theme-inner)!important;background-image:none!important;flex:1 1 auto;min-height:220px;gap:12px!important;padding:10px!important;scrollbar-color:var(--theme-border) var(--theme-inner)}
#margin-view[data-quote-theme] #margin-history .quote-kanban-column>header{background:var(--theme-inner)!important;border-bottom:1px solid var(--theme-border)!important}
#margin-view[data-quote-theme] #margin-history .quote-kanban-column .quote-kanban-empty{color:var(--theme-muted)!important;background:transparent!important;margin:22px 8px!important;text-align:center;font-size:11px}
#margin-view[data-quote-theme] #margin-history .quote-kanban-card{background:var(--theme-card)!important;background-image:none!important;border:1px solid var(--theme-border)!important;border-radius:10px!important;box-shadow:0 2px 5px color-mix(in srgb,var(--theme-border) 25%,transparent)!important}
#margin-view[data-quote-theme] #margin-history .quote-kanban-card>header{background:transparent!important;padding:0!important}
#margin-view[data-quote-theme] #margin-history .quote-kanban-card>footer{border-color:var(--theme-border)!important}
#margin-view[data-quote-theme] #margin-history .quote-kanban-column.column-pending{border-top-color:var(--theme-warning)!important}
#margin-view[data-quote-theme] #margin-history .quote-kanban-column.column-done{border-top-color:var(--theme-success)!important}
#margin-view[data-quote-theme] #margin-history .quote-kanban-column.column-lost{border-top-color:var(--theme-danger)!important}
/* Quiet, compact profile controls with one consistent field surface. */
#margin-view[data-quote-theme] .margin-admin-preview{display:flex!important;flex-direction:column!important;gap:5px!important;padding:0!important;margin:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;background:transparent!important;color:var(--theme-muted)!important;font-size:10px!important;font-weight:600!important;letter-spacing:.02em!important;text-transform:none!important;line-height:1.2!important}
#margin-view[data-quote-theme] .margin-admin-preview>span{display:block!important;background:transparent!important;color:var(--theme-muted)!important;padding:0!important;font-size:10px!important;font-weight:600!important;letter-spacing:.02em!important;text-transform:none!important}
#margin-view[data-quote-theme] .margin-admin-preview select{height:36px!important;min-height:36px!important;max-width:190px!important;min-width:140px!important;padding:0 30px 0 11px!important;border:1px solid var(--theme-border)!important;border-radius:9px!important;background:var(--theme-surface)!important;box-shadow:0 1px 2px color-mix(in srgb,var(--theme-border) 18%,transparent)!important;color:var(--theme-text)!important;font-size:12px!important;font-weight:600!important;line-height:1.3!important;cursor:pointer}
#margin-view[data-quote-theme] .margin-admin-preview select:hover{border-color:var(--theme-accent)!important}
#margin-view[data-quote-theme] .margin-admin-preview select:focus-visible{outline:2px solid var(--theme-accent)!important;outline-offset:2px!important}
.topbar .quote-theme-choice{margin-left:8px!important;gap:6px;align-self:center;font-size:10px;font-weight:600}
.topbar .quote-theme-choice select{height:34px!important;width:155px!important;padding:0 10px!important;border-radius:9px!important;background:var(--theme-surface)!important;color:var(--theme-text)!important;border:1px solid var(--theme-border)!important}
body:not([data-quote-canvas]) .topbar .quote-theme-choice{display:none!important}
@media(max-width:700px){.topbar .quote-theme-choice{margin-left:0!important}.topbar .quote-theme-choice select{width:135px!important}}
.topbar .quote-theme-choice:has(.quote-theme-modern){position:relative;display:block;z-index:95}
.topbar .quote-theme-choice>select[hidden],.topbar .quote-theme-choice>span[hidden]{display:none!important}
.quote-theme-modern{position:relative;font-size:12px;letter-spacing:0;line-height:1.3}
.topbar .quote-theme-modern .quote-theme-trigger{display:flex!important;align-items:center;gap:8px;height:36px!important;padding:0 11px!important;border:1px solid var(--theme-border)!important;border-radius:11px!important;background:var(--theme-surface)!important;color:var(--theme-text)!important;font-size:12px!important;font-weight:600!important;box-shadow:0 2px 6px #0000000a!important;cursor:pointer}
.quote-theme-trigger [data-theme-preview]{display:block;width:18px;height:18px;border-radius:50%;border:1px solid var(--theme-border)}
.quote-theme-menu{position:absolute;right:0;top:calc(100% + 8px);width:240px;padding:12px;border:1px solid var(--theme-border);border-radius:14px;background:var(--theme-surface);color:var(--theme-text);box-shadow:0 12px 32px #00000024;z-index:100}
.quote-theme-menu[hidden]{display:none!important}.quote-theme-menu>strong{display:block;padding:0 5px;font-size:13px}.quote-theme-menu>small{display:block;padding:3px 5px 10px;color:var(--theme-muted)!important;font-size:10px}
.topbar .quote-theme-modern .quote-theme-option{display:flex!important;align-items:center;gap:9px;width:100%;min-height:38px;height:auto!important;padding:7px!important;border:0!important;border-radius:8px!important;background:transparent!important;color:var(--theme-text)!important;font-size:11px!important;text-align:left;cursor:pointer}
.topbar .quote-theme-modern .quote-theme-option:hover,.topbar .quote-theme-modern .quote-theme-option[aria-checked='true']{background:var(--theme-accent-soft)!important}
.quote-theme-option>b{margin-left:auto;opacity:0;color:var(--theme-accent)!important}.quote-theme-option[aria-checked='true']>b{opacity:1}
.quote-theme-swatches{display:inline-flex;gap:0;border:1px solid var(--theme-border);border-radius:5px;overflow:hidden;flex-shrink:0}.quote-theme-swatches>i{width:12px;height:19px;display:block}
.quote-buyer-profile-block{display:flex;flex-direction:column;align-items:flex-end;gap:10px;flex:0 1 340px;margin-left:auto}
.quote-profile-originals[hidden]{display:none!important}
.quote-buyer-profile-block .buyer-team-portraits{margin:0!important;gap:16px;align-self:flex-end}
.buyer-team-portraits .chat-person-avatar{width:34px;height:34px;flex-basis:34px;border:2px solid var(--theme-surface,#fff);box-shadow:0 0 0 1px var(--theme-border,#c7d9e5)}
.buyer-team-portraits .chat-person-avatar img{transform:scale(1.65);transform-origin:50% 32%;image-rendering:auto}
.quote-profile-panel{width:100%;display:grid;gap:6px}.quote-profile-panel>small{font-size:10px!important;font-weight:600;letter-spacing:.02em}
.quote-profile-segments{display:flex;gap:3px;padding:3px;border:1px solid var(--theme-border);border-radius:10px;background:var(--theme-inner)}
#margin-view[data-quote-theme] .quote-profile-segments>button{flex:1;min-width:0;padding:7px 9px!important;min-height:30px;border:0!important;border-radius:7px!important;background:transparent!important;color:var(--theme-muted)!important;font-size:11px!important;font-weight:600;box-shadow:none!important}
#margin-view[data-quote-theme] .quote-profile-segments>button[aria-pressed='true']{background:var(--theme-surface)!important;color:var(--theme-accent)!important;box-shadow:0 1px 4px #00000010!important}
.quote-profile-people{display:flex;justify-content:flex-end;gap:6px}
#margin-view[data-quote-theme] .quote-profile-people>button{display:flex;align-items:center;gap:6px;padding:4px 9px!important;border:1px solid transparent!important;border-radius:18px!important;background:transparent!important;color:var(--theme-muted)!important;font-size:11px!important}
#margin-view[data-quote-theme] .quote-profile-people>button[aria-pressed='true']{background:var(--theme-accent-soft)!important;border-color:var(--theme-border)!important;color:var(--theme-accent)!important}
.quote-profile-people .chat-person-avatar{width:24px;height:24px;flex-basis:24px}.quote-profile-people .chat-person-avatar img{transform:scale(1.65);transform-origin:50% 32%}
@media(max-width:700px){.quote-buyer-profile-block{flex-basis:100%;align-items:flex-start;margin-left:0}.quote-buyer-profile-block .buyer-team-portraits{align-self:flex-start}.quote-profile-people{justify-content:flex-start}}

/* Compact buyer header: one team row and one aligned control row. */
#margin-view[data-quote-theme] .margin-heading{align-items:center!important;padding:8px 0 12px!important;min-height:0!important}
.quote-buyer-profile-block{flex:0 1 330px!important;gap:8px!important}
.quote-profile-panel{display:grid!important;grid-template-columns:1fr 1fr;gap:10px!important}
#margin-view[data-quote-theme] .quote-profile-panel>label{display:flex!important;flex-direction:column;gap:3px;padding:0!important;margin:0!important;background:transparent!important;font-size:10px!important;color:var(--theme-muted)!important;text-transform:none!important;font-weight:500!important}
#margin-view[data-quote-theme] .quote-profile-panel>label>span{color:var(--theme-muted)!important;font-size:10px!important}
#margin-view[data-quote-theme] .quote-profile-panel select{width:100%!important;min-width:0!important;height:32px!important;min-height:32px!important;padding:0 25px 0 9px!important;border:1px solid var(--theme-border)!important;border-radius:8px!important;background:var(--theme-card)!important;color:var(--theme-text)!important;font:500 12px system-ui,sans-serif!important;box-shadow:none!important}
.quote-buyer-profile-block .buyer-team-portraits{gap:14px!important}
.buyer-team-portraits .chat-person-avatar{width:36px!important;height:36px!important;flex-basis:36px!important;overflow:hidden!important}
.buyer-team-portraits .chat-person-avatar img{transform:none!important;object-fit:cover!important;object-position:50% 22%!important;filter:none!important;opacity:1!important}
#margin-view[data-quote-theme] .quote-overdue-tag{display:inline-flex!important;width:fit-content!important;align-self:flex-start!important;background:var(--theme-danger-soft)!important;color:var(--theme-danger)!important;border:1px solid var(--theme-danger)!important;border-radius:5px!important;padding:3px 6px!important;font:600 10px/1.2 system-ui,sans-serif!important;letter-spacing:0!important;text-transform:none!important}
@media(max-width:700px){.quote-buyer-profile-block{flex-basis:100%!important;width:100%;max-width:350px;margin-left:0!important}}



[data-quote-theme='teal'] :is(input,select,button):focus-visible{outline:2px solid #ffcc00!important;outline-offset:2px;box-shadow:0 0 0 4px #c99b321a!important}
[data-quote-theme='teal'] .quote-kanban-card:hover{border-color:#ffcc00!important;box-shadow:0 3px 12px #a37e1714!important}
/* Chat surfaces and small controls inherit the active palette consistently. */
.quote-chat-dock[data-quote-theme] .quote-chat-shell{border-color:var(--theme-border)!important;overflow:hidden}
.quote-chat-dock[data-quote-theme] :is(form[data-chat-form],.quote-chat-participants,.chat-participant-photos){background:var(--theme-inner)!important;background-image:none!important;border-color:var(--theme-border)!important;color:var(--theme-text)!important}
.quote-chat-dock[data-quote-theme] form[data-chat-form]{padding:8px!important;border-top:1px solid var(--theme-border)!important}
.quote-chat-dock[data-quote-theme] form[data-chat-form] textarea{background:var(--theme-card)!important;color:var(--theme-text)!important;border:1px solid var(--theme-border)!important;border-radius:8px!important;padding:9px!important}
.quote-chat-dock[data-quote-theme] form[data-chat-form] textarea::placeholder{color:var(--theme-muted)!important;opacity:1}
.quote-chat-dock[data-quote-theme] form[data-chat-form] :is(.quote-chat-file,.quote-chat-record,.quote-chat-emoji-button){background:var(--theme-surface)!important;color:var(--theme-text)!important;border:1px solid var(--theme-border)!important;border-radius:8px!important;opacity:1!important}
.quote-chat-dock[data-quote-theme] .chat-reaction-picker summary{background:var(--theme-surface)!important;color:var(--theme-accent)!important;-webkit-text-fill-color:var(--theme-accent)!important;border:1px solid var(--theme-border)!important;opacity:1!important;font:16px/1 system-ui,sans-serif!important;text-indent:0!important;visibility:visible!important}
.quote-chat-dock[data-quote-theme] .chat-reaction-picker>div{background:var(--theme-card)!important;border-color:var(--theme-border)!important}
.quote-chat-dock[data-quote-theme] .chat-message-reactions>button{background:var(--theme-accent-soft)!important;border-color:var(--theme-border)!important;color:var(--theme-text)!important}
.quote-chat-dock[data-quote-theme] .quote-chat-shell form[data-chat-form]{max-height:55%!important;overflow:auto!important}
.quote-chat-dock[data-quote-theme] .quote-chat-shell form[data-chat-form] .quote-chat-emoji-panel{position:static!important;inset:auto!important;grid-column:1/-1!important;grid-row:3!important;width:auto!important;max-width:100%!important;max-height:144px!important;margin:4px 0 0!important;z-index:auto!important;background:var(--theme-card)!important;border-color:var(--theme-border)!important;box-shadow:none!important}
.quote-chat-dock[data-quote-theme] .quote-chat-emoji-panel button{background:transparent!important;border:0!important;box-shadow:none!important}
/* Form component surfaces must be paired with the same palette as their text. */
:is(#margin-workbench-dialog,#margin-record-details,.margin-confirm-dialog)[data-quote-theme]{background:var(--theme-page)!important;color:var(--theme-text)!important;color-scheme:var(--theme-scheme)!important}
:is(#margin-workbench-dialog,#margin-record-details,.margin-confirm-dialog)[data-quote-theme] :is(form,fieldset,.margin-product-snapshot,.margin-quotes,.margin-quote-row,.margin-price-history,.margin-price-history-grid,.margin-buyer-request-context,.margin-record-details-grid,.margin-wizard-review,#margin-wizard-review){background:var(--theme-surface)!important;background-image:none!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important}
:is(#margin-workbench-dialog,#margin-record-details,.margin-confirm-dialog)[data-quote-theme] :is(#margin-product-snapshot>div,.margin-product-snapshot>div,#margin-buyer-request-context>div>span,.margin-record-details-grid>div,#margin-wizard-review>div,.margin-price-history-grid>section,.margin-price-list>div,.margin-supplier-ranking>div,.quote-last-purchase){background:var(--theme-card)!important;background-image:none!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important}
:is(#margin-workbench-dialog,#margin-record-details,.margin-confirm-dialog)[data-quote-theme] :is(.margin-buyer-shortcut,.margin-price-history>summary,.margin-buyer-request-context>header,.margin-review-items,thead,th){background:var(--theme-inner)!important;background-image:none!important;border-color:var(--theme-border)!important;color:var(--theme-text)!important}
:is(#margin-workbench-dialog,#margin-record-details,.margin-confirm-dialog)[data-quote-theme] :is(.margin-purchase-gap.has-gap,.margin-negative){background:var(--theme-danger-soft)!important;border-color:var(--theme-danger)!important;color:var(--theme-danger)!important}
#margin-workbench-dialog[data-quote-theme] .margin-purchase-gap.has-gap :is(span,strong,small){color:var(--theme-danger)!important}
#margin-workbench-dialog[data-quote-theme] .margin-buyer-request-context>header>b.local{background:var(--theme-warning-soft)!important;color:var(--theme-warning)!important}
#margin-workbench-dialog[data-quote-theme] .margin-buyer-request-context>header>b:is(.industry,.unknown){background:var(--theme-accent-soft)!important;color:var(--theme-accent)!important}
:is(#margin-workbench-dialog,#margin-record-details,.margin-confirm-dialog)[data-quote-theme] :is(input,textarea,select){background:var(--theme-card)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important;opacity:1!important}
:is(#margin-workbench-dialog,#margin-record-details,.margin-confirm-dialog)[data-quote-theme] :is(input,textarea)::placeholder{color:var(--theme-muted)!important;opacity:1}
/* Complete form palette, including auxiliary choices and locked field values. */
#margin-workbench-dialog[data-quote-theme]{--paint-card:var(--theme-card);--paint-inner:var(--theme-inner);--paint-text:var(--theme-text);--paint-muted:var(--theme-muted);--paint-border:var(--theme-border);--paint-accent:var(--theme-accent);--ink:var(--theme-text);--muted:var(--theme-muted);--navy:var(--theme-text)}
#margin-workbench-dialog[data-quote-theme] :is(.margin-flow,.margin-brand-preference,.margin-consumer-choice>span,.margin-request-stock-hole,.margin-request-stock-hole label,.margin-draft-list,.margin-draft-list>header,.margin-draft-list>div,.margin-customer-fields,.margin-item-actions,.margin-workbench-shell>footer,.margin-identification>nav){background:var(--theme-inner)!important;background-image:none!important;border-color:var(--theme-border)!important;color:var(--theme-text)!important}
#margin-workbench-dialog[data-quote-theme] :is(.margin-flow,.margin-brand-preference,.margin-consumer-choice,.margin-request-stock-hole,.margin-draft-list) :is(span,strong,b,p,label){color:var(--theme-text)!important;-webkit-text-fill-color:var(--theme-text)!important}
#margin-workbench-dialog[data-quote-theme] :is(.margin-flow,.margin-brand-preference,.margin-consumer-choice,.margin-request-stock-hole) small{color:var(--theme-muted)!important;-webkit-text-fill-color:var(--theme-muted)!important}
#margin-workbench-dialog[data-quote-theme] .margin-flow b{background:var(--theme-primary)!important;color:var(--theme-on-primary)!important;-webkit-text-fill-color:var(--theme-on-primary)!important;box-shadow:none!important}
#margin-workbench-dialog[data-quote-theme] :is(input,textarea,select):is(:disabled,[readonly]){color:var(--theme-text)!important;-webkit-text-fill-color:var(--theme-text)!important;background:var(--theme-inner)!important;border-color:var(--theme-border)!important;opacity:1!important}
#margin-workbench-dialog[data-quote-theme] :is(input[type=checkbox],input[type=radio]){accent-color:var(--theme-primary)}
/* Explicit roles for remaining form surfaces: no legacy white panels. */
:is(#margin-workbench-dialog,#margin-record-details,.margin-confirm-dialog)[data-quote-theme] :is(.margin-actions,.margin-buyer-request-context>p,.margin-requester-note-card,.margin-customer-price-reference,.margin-customer-last-price,.margin-result-grid>div,.margin-reading,.margin-quote-winner,.margin-compact-check>span,.margin-price-history-grid section>header,.margin-review-items>header,.margin-product-search .suggestions,.margin-customer-suggestions,.margin-customer-search-results){background:var(--theme-inner)!important;background-image:none!important;border-color:var(--theme-border)!important;color:var(--theme-text)!important;box-shadow:none!important}
#margin-workbench-dialog[data-quote-theme] .margin-actions{background:var(--theme-surface)!important;backdrop-filter:none!important;border-top:1px solid var(--theme-border)!important}
#margin-workbench-dialog[data-quote-theme] :is(.margin-owner-badge,.margin-step>header>em,.margin-response-time,.margin-progress-status,.margin-queue-position,.margin-priority-note){background:var(--theme-accent-soft)!important;color:var(--theme-accent)!important;-webkit-text-fill-color:var(--theme-accent)!important;border-color:var(--theme-border)!important}
#margin-workbench-dialog[data-quote-theme] :is(.margin-buyer-request-context>p,.margin-result-grid>div,.margin-reading,.margin-requester-note-card) :is(b,strong,span,p){color:var(--theme-text)!important;-webkit-text-fill-color:var(--theme-text)!important}
#margin-workbench-dialog[data-quote-theme] :is(.margin-customer-suggestions,.margin-customer-search-results,.margin-product-search .suggestions) button{background:var(--theme-card)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important}
#margin-workbench-dialog[data-quote-theme] :is(.margin-customer-suggestions,.margin-customer-search-results,.margin-product-search .suggestions) button:hover{background:var(--theme-accent-soft)!important}
#margin-workbench-dialog[data-quote-theme] :is(.margin-remove-quote,.margin-delete-request){background:var(--theme-danger-soft)!important;color:var(--theme-danger)!important;border-color:var(--theme-danger)!important}
#margin-workbench-dialog[data-quote-theme] :is(.primary-buyer-send,#margin-wizard-next,#margin-wizard-submit){background:var(--theme-primary)!important;color:var(--theme-on-primary)!important;-webkit-text-fill-color:var(--theme-on-primary)!important;border-color:var(--theme-primary)!important}
#margin-workbench-dialog[data-quote-theme] #margin-wizard-error:not([hidden]){background:var(--theme-danger-soft)!important;color:var(--theme-danger)!important;border-color:var(--theme-danger)!important}
#margin-workbench-dialog[data-quote-theme] #margin-wizard-dots i{background:var(--theme-border)!important}
#margin-workbench-dialog[data-quote-theme] #margin-wizard-dots i.active{background:var(--theme-primary)!important}
#margin-workbench-dialog[data-quote-theme] #margin-wizard-dots i.done{background:var(--theme-success)!important}
#margin-workbench-dialog[data-quote-theme] .margin-request-stock-hole label>span{background:var(--theme-card)!important;color:var(--theme-text)!important;-webkit-text-fill-color:var(--theme-text)!important;border-color:var(--theme-border)!important}
#margin-workbench-dialog[data-quote-theme] .margin-request-stock-hole label>span input[type=checkbox]{accent-color:var(--theme-primary)!important;opacity:1!important}
#margin-workbench-dialog .margin-item-actions[hidden],#margin-workbench-dialog #margin-draft-items[hidden],#margin-workbench-dialog #margin-draft-items-product[hidden]{display:none!important}
/* Buyer response: summary first, optional full record, suppliers, final conditions. */
#margin-workbench-dialog.margin-buyer-response{width:min(1040px,calc(100vw - 24px))!important}
#margin-workbench-dialog.margin-buyer-response .margin-workbench-body{padding:16px!important}
#margin-workbench-dialog.margin-buyer-response :is(.margin-flow,.margin-buyer-shortcut,.margin-identification>header,.quote-duplicate-customer-search){display:none!important}
#margin-workbench-dialog.margin-buyer-response .margin-workspace{display:flex!important;flex-direction:column!important;gap:14px!important}
#margin-workbench-dialog.margin-buyer-response :is(.margin-step,.margin-buyer-request-context){margin:0!important;border:1px solid var(--theme-border)!important;border-radius:12px!important;overflow:hidden;padding:0!important}
#margin-workbench-dialog.margin-buyer-response .margin-buyer-request-context{padding:14px!important}
#margin-workbench-dialog.margin-buyer-response .margin-buyer-request-context>header{background:transparent!important;padding:0 0 10px!important;border-bottom:1px solid var(--theme-border)}
#margin-workbench-dialog.margin-buyer-response .margin-buyer-request-context>div{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:10px}
#margin-workbench-dialog.margin-buyer-response .margin-buyer-request-context>div>span{min-width:0;padding:9px!important;border-radius:8px!important}
#margin-workbench-dialog.margin-buyer-response .margin-buyer-request-context>div strong{white-space:normal!important;overflow-wrap:anywhere;font-size:12px!important;line-height:1.4}
#margin-workbench-dialog .quote-request-full-details>summary{padding:12px 14px;color:var(--theme-accent)!important;background:var(--theme-inner);font-size:12px;font-weight:650;cursor:pointer}
#margin-workbench-dialog .quote-request-full-details>.margin-form-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:14px!important;padding:16px!important}
#margin-workbench-dialog .quote-request-full-details .margin-customer-fields{grid-column:1/-1!important;display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:14px!important}
#margin-workbench-dialog.margin-buyer-response :is(.margin-form-grid,.margin-condition-grid) label{font:600 11px/1.4 system-ui,sans-serif!important;text-transform:none!important;letter-spacing:0!important;min-width:0}
#margin-workbench-dialog.margin-buyer-response :is(.margin-form-grid,.margin-condition-grid) :is(input,select){width:100%!important;min-width:0!important;height:40px!important;box-sizing:border-box;font:500 12px system-ui,sans-serif!important}
#margin-workbench-dialog.margin-buyer-response .margin-form-grid small{font:400 10px/1.4 system-ui,sans-serif!important}
#margin-workbench-dialog.margin-buyer-response .margin-condition-grid{padding:14px!important;gap:14px!important}
#margin-workbench-dialog.margin-buyer-response .margin-note{margin:0 14px 14px!important;display:grid;gap:6px}
#margin-workbench-dialog.margin-buyer-response .margin-actions{margin:0!important;bottom:0!important;padding:12px 14px!important;display:flex!important;flex-wrap:wrap;justify-content:flex-end;gap:8px}
#margin-workbench-dialog.margin-buyer-response .margin-actions button{min-height:38px!important;font:600 12px system-ui,sans-serif!important}
@media(max-width:700px){#margin-workbench-dialog.margin-buyer-response .margin-buyer-request-context>div,#margin-workbench-dialog .quote-request-full-details>.margin-form-grid,#margin-workbench-dialog .quote-request-full-details .margin-customer-fields{grid-template-columns:1fr!important}#margin-workbench-dialog.margin-buyer-response .margin-workbench-body{padding:8px!important}}
/* Item ordinals use a paired high-contrast palette in review and draft lists. */
#margin-workbench-dialog[data-quote-theme] :is(.margin-draft-product>b,.margin-review-items article>b){display:grid!important;place-items:center!important;flex:0 0 22px;width:22px!important;height:22px!important;background:var(--theme-primary)!important;color:var(--theme-on-primary,#fff)!important;-webkit-text-fill-color:var(--theme-on-primary,#fff)!important;border:1px solid var(--theme-primary)!important;border-radius:50%!important;font:700 12px/1 system-ui,sans-serif!important;opacity:1!important;text-indent:0!important;visibility:visible!important}
/* Match the quotation heading to the surrounding rounded panels. */
#margin-view[data-quote-theme] .margin-heading{border:1px solid color-mix(in srgb,var(--theme-border) 65%,transparent)!important;border-radius:14px!important;padding:16px 18px!important;background:var(--theme-surface)!important;background-clip:padding-box;box-sizing:border-box}
@media(max-width:700px){#margin-view[data-quote-theme] .margin-heading{padding:12px!important;border-radius:12px!important}}

/* Audio messages need only the player, timestamp and permitted message actions. */
.quote-chat-dock .quote-chat-messages article:has(audio){min-height:0!important;min-width:0!important;padding:8px 9px!important;gap:4px!important}
.quote-chat-dock .quote-chat-messages article:has(audio) :is(.quote-chat-attachment,.quote-chat-edit){display:none!important}
.quote-chat-dock .quote-chat-messages article:has(audio)>p:empty{display:none!important;margin:0!important}
.quote-chat-dock .quote-chat-messages article:has(audio) audio{display:block;width:min(260px,60vw)!important;max-width:100%!important;height:36px!important;margin:0 0 5px!important}
.quote-chat-dock .quote-chat-messages article:has(audio)>small{margin:2px 0!important;font-size:9px!important}
.quote-chat-dock .quote-chat-messages article:has(audio) .quote-chat-delete{margin-top:2px!important;min-height:22px!important;padding:2px 4px!important}

/* Identificação apenas no resumo fechado; cores herdadas de cada tema. */
.quote-summary-people{display:flex;align-items:center;gap:6px 12px;flex-wrap:wrap;min-width:0}
.quote-summary-person{display:inline-flex;align-items:center;gap:5px;min-width:0;max-width:100%;font-size:11px;line-height:20px;color:inherit}
.quote-summary-person>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:135px}
.quote-summary-person .chat-person-avatar,.quote-summary-avatar{position:relative!important;display:inline-flex!important;align-items:center;justify-content:center;flex:0 0 20px;width:20px!important;height:20px!important;min-width:20px!important;border:1px solid currentColor;border-radius:50%;overflow:hidden;font-size:8px;line-height:1}
.quote-summary-person img{position:absolute;inset:0;width:100%!important;height:100%!important;object-fit:cover;border-radius:50%}
.quote-kanban-card[data-expanded=true] .quote-summary-people{display:none!important}

/* Controles do chat consistentes em todos os temas. */
.quote-chat-dock .quote-chat-shell form[data-chat-form] :is(.quote-chat-emoji-button,.quote-chat-file,.quote-chat-record){display:inline-flex!important;align-items:center;justify-content:center;width:32px!important;height:32px!important;min-height:32px!important;padding:6px!important;background:var(--theme-inner)!important;color:var(--theme-text)!important;border:1px solid var(--theme-border)!important;border-radius:8px!important;opacity:1!important}
.quote-chat-dock .quote-chat-shell form[data-chat-form] :is(.quote-chat-emoji-button,.quote-chat-file,.quote-chat-record) svg{width:18px!important;height:18px!important;color:var(--theme-text)!important;stroke:currentColor!important;opacity:1!important}
.quote-chat-dock .quote-chat-shell .quote-chat-messages article{width:fit-content!important;min-width:0!important;min-height:0!important;max-width:85%!important;padding:6px 9px!important;border:0!important;border-radius:9px!important;box-shadow:none!important}
.quote-chat-dock .quote-chat-shell .quote-chat-messages article>p{margin:0!important;line-height:1.35!important}
.quote-chat-dock .quote-chat-shell .quote-chat-messages article>small{margin:3px 0 0!important;line-height:1.2!important}
.quote-chat-dock .quote-chat-shell .quote-chat-messages article :is(.quote-chat-edit,.quote-chat-delete){display:inline-block!important;min-height:0!important;padding:2px 4px!important;margin:2px 0 0!important;font-size:9px!important}
.quote-kanban-card[data-expanded=false]{content-visibility:auto;contain-intrinsic-size:auto 220px}

.quote-chat-dock .quote-chat-messages article .chat-reaction-picker{position:relative!important;inset:auto!important;display:inline-flex!important;margin:0!important;vertical-align:middle}
.quote-chat-dock .quote-chat-messages article .chat-message-reactions{position:static!important;inset:auto!important;width:auto!important;display:flex!important;align-items:center;gap:4px;margin:3px 0 0!important}
.quote-chat-dock .quote-chat-messages .chat-reaction-picker summary{display:inline-flex!important;align-items:center;justify-content:center;width:22px!important;height:22px!important;min-height:0!important;padding:0!important;border:0!important;background:transparent!important;color:var(--theme-muted)!important;font-size:0!important;opacity:1!important;list-style:none}
.quote-chat-dock .quote-chat-messages .chat-reaction-picker summary::before{content:'☺︎';font:18px/1 Arial,sans-serif;color:var(--theme-muted)!important}

.quote-chat-dock .quote-chat-shell .quote-chat-messages article{position:relative;padding-bottom:23px!important}
.quote-chat-dock .quote-chat-shell .quote-chat-messages article :is(.quote-chat-edit,.quote-chat-delete){position:absolute!important;bottom:3px!important;right:6px!important;display:inline-flex!important;align-items:center;height:16px!important;min-height:0!important;padding:0 2px!important;margin:0!important;border:0!important;background:transparent!important;box-shadow:none!important;border-radius:3px!important;font-size:9px!important;line-height:16px!important;width:auto!important}
.quote-chat-dock .quote-chat-shell .quote-chat-messages article .quote-chat-edit{right:43px!important;color:var(--theme-muted)!important}
.quote-chat-dock .quote-chat-shell .quote-chat-messages article:not(:has(.quote-chat-edit,.quote-chat-delete)){padding-bottom:6px!important}

/* Reagir fora do balão, sem reservar uma linha entre texto e horário. */
.quote-chat-dock .quote-chat-shell .quote-chat-messages article .chat-message-reactions{position:absolute!important;inset:auto!important;top:50%!important;right:-28px!important;transform:translateY(-50%);width:22px!important;min-height:22px!important;margin:0!important;overflow:visible!important;z-index:2}
.quote-chat-dock .quote-chat-shell .quote-chat-messages article.mine .chat-message-reactions{right:auto!important;left:-28px!important}
.quote-chat-dock .quote-chat-shell .quote-chat-messages article .chat-reaction-picker{position:relative!important;inset:auto!important;margin:0!important;flex:none}
.quote-chat-dock .quote-chat-shell .quote-chat-messages article>small{margin-top:2px!important;padding:0!important;line-height:1.2!important}

:is([data-quote-theme="teal"],html[data-dashboard-theme="teal"]) .quote-chat-shell .quote-chat-messages article.mine{--theme-text:#202020;--theme-muted:#514600;--paint-text:#202020;--paint-muted:#514600;background:#ffcc00!important;color:#202020!important}
:is([data-quote-theme="teal"],html[data-dashboard-theme="teal"]) .quote-chat-shell .quote-chat-messages article.mine :is(p,strong,small){color:#202020!important}

:is([data-quote-theme="teal"],html[data-dashboard-theme="teal"]) .quote-chat-shell .quote-chat-messages article.mine .quote-chat-delete{color:#79280c!important;-webkit-text-fill-color:#79280c!important;opacity:1!important;font-weight:600!important}

#margin-history .quote-kanban-card[data-expanded=true]{gap:5px!important;padding:8px!important}
#margin-history .quote-kanban-card[data-expanded=true] .quote-card-meta{gap:4px!important;grid-template-columns:repeat(2,minmax(0,1fr))!important}
#margin-history .quote-kanban-card[data-expanded=true] .quote-card-meta>span{padding:5px 6px!important;gap:2px!important}
#margin-history .quote-kanban-card[data-expanded=true] :is(.quote-card-meta small,.quote-cost-comparison small){font-size:9px!important;line-height:1.2!important}
#margin-history .quote-kanban-card[data-expanded=true] :is(.quote-card-meta strong,.quote-cost-comparison strong){font-size:11px!important;line-height:1.25!important}
#margin-history .quote-kanban-card[data-expanded=true] :is(.quote-cost-comparison,.quote-winning-cost,.quote-card-timing,.quote-approval-time){margin:2px 0!important;padding:6px!important;gap:3px!important}
[data-quote-theme] #margin-history .quote-kanban-card[data-expanded=true] :is(.quote-cost-comparison,.quote-winning-cost,.quote-card-timing span,.quote-approval-time,.quote-requester-update){background:var(--theme-inner)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important;box-shadow:none!important}
[data-quote-theme] #margin-history .quote-kanban-card[data-expanded=true] :is(.quote-cost-comparison,.quote-winning-cost,.quote-card-timing,.quote-approval-time) :is(small,strong,span){color:var(--theme-text)!important}
#margin-history .quote-kanban-card>footer>div{display:flex!important;flex-wrap:nowrap!important;gap:6px!important;align-items:stretch!important}
#margin-history .quote-kanban-card>footer>div>.quote-card-expand{flex:1 1 0!important;min-width:0!important;order:0!important}
#margin-history .quote-kanban-card>footer>div>[data-quote-chat]{display:block!important;flex:0 0 65px!important;width:65px!important;min-width:0!important;order:1!important}
#margin-history .quote-kanban-card>footer>div>.quote-card-more{flex:0 0 32px!important;width:32px!important;order:2!important}

.quote-chat-dock .quote-chat-shell form[data-chat-form] .quote-chat-send{background:var(--theme-primary)!important;color:var(--theme-on-primary)!important;border:1px solid var(--theme-primary)!important;font-weight:700!important;opacity:1!important;min-height:30px!important}
.quote-chat-dock .quote-chat-shell form[data-chat-form] .quote-chat-send:disabled{opacity:1!important;filter:saturate(.65);cursor:not-allowed}
.quote-chat-dock .quote-chat-shell form[data-chat-form] [data-chat-end]{background:var(--theme-inner)!important;color:var(--theme-text)!important;border:1px solid var(--theme-secondary)!important;opacity:1!important;font-weight:600!important;min-height:30px!important}

[data-quote-theme] #margin-history .quote-kanban-card :is(.quote-time-card,.quote-time-metrics,.quote-timing,.quote-timing-metrics,.quote-timing-card,.quote-time-grid)>*{background:var(--theme-inner)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important}
.quote-kanban-card{content-visibility:visible!important;contain-intrinsic-size:none!important}
[data-quote-theme] #margin-history .quote-kanban-card .quote-live-timing>span{background:var(--theme-inner)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important;padding:5px!important;font-size:9px!important}
[data-quote-theme] #margin-history .quote-kanban-card .quote-live-timing b{color:var(--theme-text)!important;font-size:11px!important}
#margin-history .quote-kanban-card>footer>div.has-summary-complete{display:grid!important;grid-template-columns:minmax(0,1fr) 65px 32px!important}
#margin-history .quote-kanban-card[data-expanded=false]>footer>div>.quote-summary-complete,#margin-history .quote-kanban-card>footer>div>.quote-summary-complete{display:block!important;grid-column:1/-1!important;order:-1!important;width:100%!important;margin:0!important;background:#087eae!important;color:#fff!important;border-color:#2499c2!important;font-size:11px!important;min-height:32px!important}

/* Mensagens longas respeitam o lado da conversa e quebram dentro do balão. */
.quote-chat-dock .quote-chat-shell .quote-chat-messages article{box-sizing:border-box!important;width:fit-content!important;min-width:0!important;max-width:min(75%,calc(100% - 64px))!important;flex-shrink:0!important;overflow-wrap:anywhere!important;word-break:normal!important;white-space:normal!important;margin-left:32px!important;margin-right:auto!important;align-self:flex-start!important}
.quote-chat-dock .quote-chat-shell .quote-chat-messages article.mine{margin-left:auto!important;margin-right:32px!important;align-self:flex-end!important}
.quote-chat-dock .quote-chat-shell .quote-chat-messages article>p{min-width:0!important;max-width:100%!important;white-space:pre-wrap!important;overflow-wrap:anywhere!important;word-break:normal!important}
.quote-chat-dock .quote-chat-shell .quote-chat-messages article :is(a,img,audio,video){max-width:100%!important;box-sizing:border-box!important}

.quote-chat-dock .quote-chat-shell .quote-chat-person-form:not([hidden]){display:flex!important;flex-wrap:wrap!important;align-items:flex-end!important;gap:7px!important;width:100%!important;box-sizing:border-box!important;padding:8px!important;min-width:0!important}
.quote-chat-dock .quote-chat-shell .quote-chat-person-form>label{display:grid!important;gap:5px!important;flex:1 1 180px!important;min-width:0!important}
.quote-chat-dock .quote-chat-shell .quote-chat-person-form :is(select,input){box-sizing:border-box!important;width:100%!important;min-width:0!important;height:34px!important;font-size:12px!important;background:var(--theme-inner)!important;color:var(--theme-text)!important}
.quote-chat-dock .quote-chat-shell .quote-chat-person-form>input{flex:1 1 180px!important}
.quote-chat-dock .quote-chat-shell .quote-chat-person-form>button{flex:0 0 auto!important;height:34px!important;min-height:34px!important;padding:6px 10px!important;font-size:11px!important;opacity:1!important;background:var(--theme-primary)!important;color:var(--theme-on-primary)!important;border:1px solid var(--theme-border)!important}
.quote-chat-dock .quote-chat-shell .quote-chat-person-form>button:disabled{background:var(--theme-inner)!important;color:var(--theme-muted)!important;cursor:not-allowed!important}

/* O menu flutuante usa a paleta e linhas compactas, inclusive para autorização. */
[data-quote-theme] #margin-history .quote-card-more-menu[popover]{background:var(--theme-surface)!important;color:var(--theme-text)!important;border:1px solid var(--theme-border)!important;padding:7px!important;gap:5px!important;grid-auto-rows:max-content!important;min-height:0!important;height:auto!important;max-height:min(70dvh,420px)!important;box-shadow:var(--theme-shadow)!important}
[data-quote-theme] #margin-history .quote-card-more-menu[popover]>button{background:var(--theme-card)!important;color:var(--theme-text)!important;border:1px solid var(--theme-border)!important;font-size:11px!important;line-height:16px!important;min-height:30px!important;height:auto!important;padding:6px 8px!important}
[data-quote-theme] #margin-history .quote-card-more-menu[popover] .quote-isadora-authorization{display:grid!important;grid-template-columns:1fr!important;gap:2px!important;min-height:0!important;height:auto!important;max-height:none!important;min-width:0!important;width:auto!important;padding:6px 8px!important;margin:0!important;background:var(--theme-inner)!important;border:1px solid var(--theme-border)!important;color:var(--theme-text)!important;border-radius:7px!important}
[data-quote-theme] #margin-history .quote-card-more-menu[popover] .quote-isadora-authorization :is(small,strong,span){font-size:10px!important;line-height:1.3!important;color:var(--theme-text)!important;margin:0!important;padding:0!important;min-height:0!important}

[data-quote-theme] #margin-history :is(.quote-request-group,.quote-request-items,.quote-item-picker){background:var(--theme-surface)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important;box-shadow:none!important;min-height:0!important}
[data-quote-theme] #margin-history .quote-request-items{padding:7px!important;margin:0!important}
[data-quote-theme] #margin-history .quote-item-picker{display:grid!important;gap:4px!important;padding:0!important;font-size:10px!important;line-height:1.3!important}
[data-quote-theme] #margin-history .quote-item-picker select{width:100%!important;box-sizing:border-box!important;min-width:0!important;min-height:32px!important;height:32px!important;padding:5px 7px!important;font-size:11px!important;background:var(--theme-card)!important;color:var(--theme-text)!important;border:1px solid var(--theme-border)!important;border-radius:7px!important}

[data-quote-theme] #margin-history .quote-card-more-menu[popover] .quote-isadora-authorization{display:flex!important;align-items:center!important;flex-wrap:wrap!important;gap:2px 7px!important;padding:5px 2px!important;margin:2px 0!important;background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important}
[data-quote-theme] #margin-history .quote-card-more-menu[popover] .quote-isadora-authorization>small{display:none!important}
[data-quote-theme] #margin-history .quote-card-more-menu[popover] .quote-isadora-authorization>strong{font-size:10px!important;line-height:14px!important;font-weight:500!important;color:var(--theme-text)!important}
[data-quote-theme] #margin-history .quote-card-more-menu[popover] .quote-isadora-authorization>span{font-size:9px!important;line-height:14px!important;color:var(--theme-muted)!important;white-space:nowrap!important}

/* Compact, left-aligned authorization within the actions menu. */
[data-quote-theme] #margin-history .quote-card-more-menu .quote-isadora-authorization{display:flex!important;flex-direction:column!important;align-items:flex-start!important;justify-content:flex-start!important;align-self:stretch!important;gap:1px!important;padding:4px 6px!important;margin:0!important;min-height:0!important;height:auto!important;text-align:left!important}
[data-quote-theme] #margin-history .quote-card-more-menu .quote-isadora-authorization small{display:none!important}
[data-quote-theme] #margin-history .quote-card-more-menu .quote-isadora-authorization strong{display:block!important;font-size:10px!important;line-height:13px!important;margin:0!important;padding:0!important;min-height:0!important;text-align:left!important}
[data-quote-theme] #margin-history .quote-card-more-menu .quote-isadora-authorization span{display:block!important;font-size:9px!important;line-height:12px!important;margin:0!important;padding:0!important;min-height:0!important;opacity:.75;text-align:left!important}

[data-quote-theme] #margin-history .quote-card-more-menu .quote-isadora-authorization{order:99!important}

/* Message height follows its content; only the viewport scrolls. */
.quote-chat-dock .quote-chat-shell .quote-chat-messages{display:flex!important;flex-direction:column!important;min-height:0!important;overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain;scrollbar-gutter:stable;align-content:flex-start!important}
.quote-chat-dock .quote-chat-shell .quote-chat-messages>article{flex:0 0 auto!important;height:auto!important;max-height:none!important;grid-auto-rows:max-content!important}
.quote-chat-dock .quote-chat-shell>header,.quote-chat-dock .quote-chat-shell>.quote-chat-participants,.quote-chat-dock .quote-chat-shell>form{flex-shrink:0!important}
.quote-chat-dock .quote-chat-participants{flex-wrap:wrap!important;max-height:96px;overflow-y:auto;flex-shrink:0!important}
/* White palette: hovered and focused actions always paint text and fill together. */
body[data-quote-canvas='white'] .topbar :is(button,#logout):is(:hover,:focus-visible,:active):not(:disabled),
:is(#margin-view,#margin-workbench-dialog,#margin-record-details,.quote-chat-dock,.margin-confirm-dialog)[data-quote-theme='white'] button:is(:hover,:focus-visible,:active):not(:disabled),
body[data-quote-canvas='white'] dialog button:is(:hover,:focus-visible,:active):not(:disabled){background:#28638b!important;background-image:none!important;color:#fff!important;border-color:#28638b!important;--paint-text:#fff;--paint-muted:#fff;--paint-accent:#fff}
:is(#margin-view,#margin-workbench-dialog,#margin-record-details,.quote-chat-dock,.margin-confirm-dialog)[data-quote-theme='white'] button:is(:hover,:focus-visible,:active):not(:disabled) :is(span,strong,b,small,svg),body[data-quote-canvas='white'] .topbar button:is(:hover,:focus-visible,:active):not(:disabled) :is(span,strong,b,small,svg){color:#fff!important;-webkit-text-fill-color:currentColor}
[data-quote-theme='white'] button:focus-visible,body[data-quote-canvas='white'] .topbar button:focus-visible{outline:2px solid #174b70!important;outline-offset:3px}
:is(#margin-view,#margin-workbench-dialog,#margin-record-details,.quote-chat-dock,.margin-confirm-dialog)[data-quote-theme='white'] button:is(.active,.selected,[aria-pressed='true'],[aria-selected='true']):not(:disabled){background:#28638b!important;background-image:none!important;color:#fff!important;border-color:#28638b!important}
:is(#margin-view,#margin-workbench-dialog,#margin-record-details,.quote-chat-dock,.margin-confirm-dialog)[data-quote-theme='white'] button:is(.active,.selected,[aria-pressed='true'],[aria-selected='true']):not(:disabled) :is(span,strong,b,small,svg){color:#fff!important}
