.wo-service-workspace,
.wo-product-workspace,
.wo-work-dialog {
    box-sizing: border-box;
    border: 1px solid var(--wo-border, #cbd5e1);
    border-radius: 8px;
    background: var(--wo-surface, #fff);
    color: var(--wo-text, #0f172a);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.wo-service-workspace,
.wo-product-workspace {
    margin: 0;
    border-width: 1px 0 0;
    border-radius: 0;
    padding: .85rem;
    scroll-margin-top: 5rem;
}

.wo-work-dialog {
    width: min(1180px, 96vw);
    max-width: 96vw;
    max-height: 92dvh;
    margin: auto;
    overflow: auto;
    padding: 0;
}

.wo-work-dialog::backdrop { background: rgb(15 23 42 / .58); }
.wo-work-dialog__header {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--wo-border, #cbd5e1);
    background: var(--wo-surface, #fff);
    padding: .7rem .85rem;
}
.wo-work-dialog__header h2 { margin: 0; font-size: 1rem; }
.wo-work-dialog__body { padding: .85rem; }

.wo-work-button,
.wo-work-dialog__header button,
.wo-workspace-actions button,
.wo-workspace-actions a {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--wo-border, #94a3b8);
    border-radius: 6px;
    background: var(--wo-surface, #fff);
    color: var(--wo-primary, #2563eb);
    padding: .38rem .62rem;
    font-size: .75rem;
    font-weight: 750;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}
.wo-work-button:disabled { opacity: .5; cursor: default; }
.wo-work-button:focus-visible,
.wo-work-dialog button:focus-visible,
.wo-work-dialog a:focus-visible,
.wo-work-dialog summary:focus-visible,
.wo-service-workspace button:focus-visible,
.wo-service-workspace a:focus-visible,
.wo-product-workspace button:focus-visible,
.wo-product-workspace a:focus-visible,
.wo-tabs [role="tab"]:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--wo-focus, #7c3aed) 55%, transparent);
    outline-offset: 2px;
}

.wo-workspace-header {
    position: sticky;
    z-index: 8;
    top: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--wo-border, #cbd5e1);
    background: var(--wo-surface, #fff);
    padding: .15rem 0 .7rem;
}
.wo-workspace-header h2 { margin: .12rem 0; font-size: 1.02rem; line-height: 1.35; }
.wo-work-kicker { margin: 0; color: var(--wo-primary, #2563eb); font-size: .7rem; font-weight: 800; }
.wo-workspace-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; }
.wo-current-reference {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .45rem;
    border-bottom: 1px solid var(--wo-border, #cbd5e1);
    background: var(--wo-surface-muted, #f1f5f9);
    padding: .65rem .75rem;
}
.wo-current-reference > span { color: var(--wo-muted, #64748b); font-size: .72rem; }
.wo-current-reference strong { font-size: 1.22rem; font-variant-numeric: tabular-nums; }
.wo-current-reference select { min-height: 34px; margin-left: auto; border: 1px solid var(--wo-border, #cbd5e1); border-radius: 6px; background: var(--wo-surface, #fff); color: inherit; padding: .25rem .45rem; }

.wo-tabs { display: flex; gap: .15rem; overflow-x: auto; border-bottom: 1px solid var(--wo-border, #cbd5e1); margin-top: .7rem; scrollbar-width: thin; }
.wo-tabs [role="tab"] {
    min-height: 40px;
    flex: 0 0 auto;
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: var(--wo-muted, #64748b);
    padding: .5rem .7rem;
    font-size: .78rem;
    font-weight: 800;
    cursor: pointer;
}
.wo-tabs [role="tab"][aria-selected="true"] { border-bottom-color: var(--wo-primary, #2563eb); color: var(--wo-text, #0f172a); }
.wo-tab-panel { min-height: 150px; padding: .85rem .1rem .1rem; outline: none; }
.wo-tab-panel[hidden] { display: none; }

.wo-work-metrics { display: grid; grid-template-columns: repeat(4, minmax(145px, 1fr)); gap: .55rem; margin-bottom: .9rem; }
.wo-work-metric { display: grid; align-content: start; gap: .22rem; min-height: 92px; border: 1px solid var(--wo-border, #cbd5e1); border-radius: 8px; padding: .7rem; }
.wo-work-metric span,
.wo-work-metric small { color: var(--wo-muted, #64748b); font-size: .68rem; line-height: 1.35; }
.wo-work-metric strong { font-size: .98rem; line-height: 1.3; font-variant-numeric: tabular-nums; }
.wo-work-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; margin: .8rem 0 .5rem; }
.wo-work-section-heading h3,
.wo-tab-panel > h3 { margin: .8rem 0 .45rem; font-size: .92rem; }
.wo-work-section-heading span { color: var(--wo-muted, #64748b); font-size: .7rem; }

.wo-cost-stack { display: flex; width: 100%; height: 22px; overflow: hidden; border: 1px solid var(--wo-border, #cbd5e1); border-radius: 6px; background: var(--wo-surface-muted, #f1f5f9); }
.wo-cost-stack__part { min-width: 2px; }
.wo-cost-stack__part--labor { background: #7c3aed; }
.wo-cost-stack__part--material { background: #059669; }
.wo-cost-stack__part--equipment { background: #d97706; }
.wo-cost-stack__part--third { background: #0891b2; }
.wo-cost-stack__part--other { background: #64748b; }

.wo-work-scroll { max-height: 430px; overflow: auto; border: 1px solid var(--wo-border, #cbd5e1); border-radius: 6px; }
.wo-work-table { width: 100%; min-width: 660px; border-collapse: collapse; color: inherit; font-size: .74rem; }
.wo-work-table caption { padding: .45rem; text-align: left; }
.wo-work-table th,
.wo-work-table td { border-bottom: 1px solid var(--wo-border, #cbd5e1); padding: .42rem .5rem; text-align: left; vertical-align: top; }
.wo-work-table thead th { position: sticky; z-index: 2; top: 0; background: var(--wo-surface-muted, #f1f5f9); color: var(--wo-muted, #64748b); font-size: .66rem; letter-spacing: .03em; text-transform: uppercase; }
.wo-work-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--wo-surface-muted, #f1f5f9) 42%, transparent); }
.wo-work-table tbody tr[data-current="true"] { box-shadow: inset 4px 0 var(--wo-primary, #2563eb); font-weight: 750; }
.wo-work-table .wo-number { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wo-work-table th:first-child { min-width: 120px; }

.wo-line-chart { display: block; width: 100%; height: 150px; margin: .55rem 0; color: var(--wo-primary, #2563eb); }
.wo-line-chart__line { stroke: currentColor; stroke-width: 3; }
.wo-line-chart__dot { fill: var(--wo-surface, #fff); stroke: currentColor; stroke-width: 3; }
.wo-line-chart__dot:focus { outline: none; fill: var(--wo-selected, #dbeafe); stroke-width: 5; }

.wo-bars { display: grid; gap: .4rem; margin: .65rem 0; }
.wo-bar-row { display: grid; grid-template-columns: minmax(36px, 70px) minmax(120px, 1fr) minmax(110px, auto); align-items: center; gap: .55rem; min-height: 30px; font-size: .72rem; }
.wo-bar-row--wide { grid-template-columns: minmax(190px, 1.2fr) minmax(120px, 1fr) minmax(160px, auto); }
.wo-bar-row[data-current="true"] { border-left: 4px solid var(--wo-primary, #2563eb); padding-left: .4rem; }
.wo-bar-row > strong { text-align: right; font-variant-numeric: tabular-nums; }
.wo-bar-track { display: block; height: 10px; overflow: hidden; border-radius: 999px; background: var(--wo-surface-muted, #e2e8f0); }
.wo-bar-fill { display: block; height: 100%; border-radius: inherit; background: var(--wo-primary, #2563eb); }

.wo-work-note { margin: .45rem 0; color: var(--wo-muted, #64748b); font-size: .72rem; line-height: 1.45; }
.wo-work-highlight,
.wo-work-warning,
.wo-work-error,
.wo-work-empty { margin: .55rem 0; border: 1px solid var(--wo-border, #cbd5e1); border-left: 4px solid var(--wo-primary, #2563eb); border-radius: 6px; background: var(--wo-surface-muted, #f1f5f9); padding: .65rem .75rem; font-size: .76rem; line-height: 1.45; }
.wo-work-warning { border-left-color: var(--wo-warning, #b45309); }
.wo-work-error { border-left-color: var(--wo-error, #b91c1c); }
.wo-work-empty { border-style: dashed; border-left-style: solid; border-left-color: var(--wo-muted, #64748b); color: var(--wo-muted, #64748b); }
.wo-work-error p,
.wo-work-warning p { margin: .25rem 0 0; }
.wo-work-status { min-height: 20px; margin: 0 0 .45rem; font-size: .76rem; }
.wo-work-skeleton { height: 118px; border-radius: 6px; background: linear-gradient(100deg, transparent, rgb(148 163 184 / .22), transparent); background-size: 200% 100%; animation: wo-work-loading 1.4s linear infinite; }
@keyframes wo-work-loading { to { background-position: -200% 0; } }

.wo-work-tree-panel { margin-bottom: .55rem; }
.wo-work-tree-panel > summary,
.wo-work-method > summary { min-height: 34px; color: var(--wo-primary, #2563eb); font-size: .76rem; font-weight: 800; cursor: pointer; }
.wo-work-tree { max-height: 180px; overflow: auto; border: 1px solid var(--wo-border, #cbd5e1); border-radius: 6px; padding: .35rem; }
.wo-work-tree button { display: block; width: 100%; border: 0; background: transparent; color: inherit; padding: .3rem; text-align: left; }
.wo-work-tree button[aria-current="true"] { background: var(--wo-selected, #dbeafe); font-weight: 800; }
.wo-work-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem; margin: .4rem 0; }
.wo-work-crumb { min-height: 30px; border: 0; background: transparent; color: var(--wo-primary, #2563eb); padding: .25rem; font-size: .72rem; cursor: pointer; }
.wo-work-filters { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem; margin: .45rem 0; color: var(--wo-muted, #64748b); font-size: .7rem; }
.wo-work-filter { min-height: 30px; border: 1px solid var(--wo-border, #cbd5e1); border-radius: 999px; background: transparent; color: inherit; padding: .25rem .5rem; cursor: pointer; }
.wo-work-filter--active { border-color: var(--wo-primary, #2563eb); background: var(--wo-selected, #dbeafe); color: var(--wo-text, #0f172a); }
.wo-work-category { display: block; width: fit-content; border-left: 3px solid #94a3b8; margin-bottom: .18rem; padding-left: .3rem; color: var(--wo-muted, #64748b); font-size: .65rem; }
.wo-work-category[data-category="Material"] { border-color: #38bdf8; }
.wo-work-category[data-category="MaoDeObra"] { border-color: #a78bfa; }
.wo-work-category[data-category="Equipamento"] { border-color: #f59e0b; }
.wo-work-category[data-category="ServicoAuxiliar"],
.wo-work-category[data-category="Servico"] { border-color: #fb923c; }

.wo-results-toolbar { display: flex; min-height: 40px; align-items: center; flex-wrap: wrap; gap: .4rem; border-bottom: 1px solid var(--wo-border, #cbd5e1); padding: .25rem .65rem; }
.wo-results-toolbar .wo-sort-form { align-items: center; border: 0; padding: 0; }
.wo-results-toolbar .wo-sort-form label { display: inline-flex; align-items: center; gap: .4rem; }
.wo-filter-chip,
.wo-selection-count { display: inline-flex; min-height: 30px; align-items: center; border: 1px solid var(--wo-border, #cbd5e1); border-radius: 999px; background: var(--wo-surface-muted, #f1f5f9); color: var(--wo-muted, #64748b); padding: .25rem .52rem; font-size: .68rem; }
.wo-filter-chip--removable { color: var(--wo-primary, #2563eb); text-decoration: none; }
.wo-selection-count { margin-left: auto; }
[data-selection-host] { display: contents; }
.wo-selection-tray { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; }
.wo-selection-tray[hidden] { display: none; }
.wo-selection-tray__items { display: flex; flex-wrap: wrap; gap: .25rem; }
.wo-selection-chip { min-height: 30px; border: 1px solid var(--wo-primary, #2563eb); border-radius: 999px; background: transparent; color: var(--wo-primary, #2563eb); padding: .25rem .5rem; font-size: .68rem; cursor: pointer; }
.wo-selection-tray .wo-primary-button { min-height: 32px; padding: .35rem .6rem; }
.wo-selection-tray > .wo-work-button { min-height: 32px; }
.wo-results-table tr[data-compare-selected="true"] { box-shadow: inset 4px 0 var(--wo-primary, #2563eb); background: var(--wo-selected, #dbeafe) !important; }
.wo-results-table tr[data-work-selected="true"] { outline: 2px solid var(--wo-primary, #2563eb); outline-offset: -2px; }

.wo-results-table-wrap { height: 300px; max-height: 55vh; }
.wo-insumos .wo-results-table { min-width: 880px; }
.wo-insumos .wo-results-table tbody th { width: 48%; }
.wo-insumos .wo-source-cell span { display: block; margin-top: .12rem; color: var(--wo-muted, #64748b); }
.wo-price-unit { color: var(--wo-muted, #64748b); font-size: .68rem; font-weight: 500; }
.wo-regime-chip--reference { background: var(--wo-surface-muted, #f1f5f9); color: var(--wo-muted, #64748b); }

.wo-tutorial { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: .7rem; border: 1px solid var(--wo-border, #cbd5e1); border-left: 4px solid var(--wo-primary, #2563eb); border-radius: 6px; background: var(--wo-surface, #fff); margin: 0 0 .7rem; padding: .48rem .7rem; }
.wo-tutorial summary { min-height: 32px; color: var(--wo-primary, #2563eb); font-size: .76rem; font-weight: 800; cursor: pointer; }
.wo-tutorial > div { display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.wo-tutorial:not([open]) > div { display: none; }
.wo-tutorial p { margin: .3rem 0; color: var(--wo-muted, #64748b); font-size: .72rem; }

.wo-secondary-content { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; margin: .8rem 0; }
.wo-secondary-content details,
.wo-related { border: 1px solid var(--wo-border, #cbd5e1); border-radius: 6px; background: var(--wo-surface, #fff); padding: .7rem .8rem; }
.wo-secondary-content summary { min-height: 32px; font-size: .78rem; font-weight: 800; cursor: pointer; }
.wo-secondary-content p,
.wo-secondary-content li { color: var(--wo-muted, #64748b); font-size: .75rem; line-height: 1.55; }
.wo-secondary-content ul { margin: .4rem 0; padding-left: 1.1rem; }
.wo-secondary-content a,
.wo-related a { color: var(--wo-primary, #2563eb); }
.wo-related { margin-top: .7rem; }
.wo-related ul { display: grid; grid-template-columns: repeat(4, 1fr); gap: .45rem; list-style: none; margin: .5rem 0 0; padding: 0; }
.wo-related li { border: 1px solid var(--wo-border, #cbd5e1); border-radius: 5px; padding: .5rem; font-size: .72rem; }
.wo-page-numbers { display: flex; align-items: center; gap: .35rem; }
.wo-page-numbers a,
.wo-page-numbers strong { display: inline-grid; min-width: 30px; min-height: 30px; place-items: center; border: 1px solid var(--wo-border, #cbd5e1); border-radius: 5px; text-decoration: none; }

/* Compact workbench: the result list is the page entry point and the detail stays in the same viewport. */
.wo-services[data-mode="PesquisaLocal"] { padding-top: 5.35rem; }
.wo-services[data-mode="PesquisaLocal"] .wo-breadcrumb { margin-bottom: .35rem; }
.wo-services[data-mode="PesquisaLocal"] .wo-results { margin-bottom: .6rem; }
.wo-section-heading--results h1 { margin: .12rem 0; font-size: clamp(1.05rem, 1.8vw, 1.32rem); line-height: 1.2; }
.wo-query-utilities { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(220px, 1fr); gap: .3rem; border-top: 1px solid var(--wo-border, #cbd5e1); padding: .25rem; }
.wo-query-utilities .wo-search-panel,
.wo-query-utilities .wo-tutorial { min-width: 0; margin: 0; }
.wo-query-utilities .wo-search-panel__summary { min-height: 30px; gap: .45rem; padding: .15rem .45rem; }
.wo-query-utilities .wo-search-panel__summary-copy { gap: .45rem; }
.wo-query-utilities .wo-search-panel__summary-copy > .wo-eyebrow { white-space: nowrap; }
.wo-query-utilities .wo-search-panel__summary-copy > strong { font-size: .72rem; }
.wo-query-utilities .wo-search-panel__toggle { align-self: center; min-height: 22px; }
.wo-query-utilities .wo-search-panel__toggle::after { width: 20px; height: 20px; line-height: 1; }
.wo-query-utilities .wo-tutorial { display: block; padding: 0 .45rem; }
.wo-query-utilities .wo-tutorial summary { display: flex; min-height: 28px; align-items: center; font-size: .7rem; }
.wo-scope-note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.wo-regime-switch { display: inline-flex; min-height: 32px; align-items: center; gap: .2rem; border: 1px solid var(--wo-border, #cbd5e1); border-radius: 999px; background: var(--wo-surface-muted, #f1f5f9); padding: 2px; }
.wo-regime-switch > span { margin: 0 .35rem; color: var(--wo-muted, #64748b); font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.wo-regime-switch label { position: relative; cursor: pointer; }
.wo-regime-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.wo-regime-switch label span { display: grid; min-height: 26px; place-items: center; border-radius: 999px; color: var(--wo-muted, #64748b); padding: .25rem .55rem; font-size: .7rem; font-weight: 800; }
.wo-regime-switch input:checked + span { background: var(--wo-surface, #fff); box-shadow: 0 1px 4px rgb(15 23 42 / .16); color: var(--wo-text, #0f172a); }
.wo-regime-switch input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--wo-focus, #7c3aed) 55%, transparent); outline-offset: 2px; }

.wo-table-shell { position: relative; min-width: 0; height: 100%; overflow: hidden; }
.wo-table-width-toggle { position: absolute; z-index: 6; top: 3px; right: 4px; display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid var(--wo-border, #cbd5e1); border-radius: 4px; background: var(--wo-surface, #fff); color: var(--wo-primary, #2563eb); padding: 0; font: inherit; font-size: .75rem; cursor: pointer; }
.wo-table-width-toggle[aria-expanded="true"] span { transform: rotate(90deg); }
.wo-results-table-wrap { overflow-x: hidden; }
.wo-table-shell .wo-results-table { min-width: 0; table-layout: fixed; }
.wo-results-table th,
.wo-results-table td { height: 28px; overflow: hidden; padding: .25rem .4rem; text-overflow: ellipsis; white-space: nowrap; }
.wo-results-table tbody th { min-width: 0; max-width: none; width: auto; text-align: left; }
.wo-results-table tbody th a,
.wo-service-link { display: block; overflow: hidden; margin: 0; text-overflow: ellipsis; white-space: nowrap; -webkit-line-clamp: unset; }
.wo-code-cell { text-align: left; }
.wo-source-cell strong,
.wo-source-cell span { display: inline !important; }
.wo-services-table th:nth-child(1), .wo-services-table td:nth-child(1) { width: 46px; text-align: center; }
.wo-insumos-table th:nth-child(1), .wo-insumos-table td:nth-child(1) { width: 54px; text-align: center; }
.wo-services-table th:nth-child(2), .wo-services-table td:nth-child(2) { width: 82px; }
.wo-insumos-table th:nth-child(2), .wo-insumos-table td:nth-child(2) { width: 112px; }
.wo-services-table th:nth-child(3), .wo-services-table td:nth-child(3) { width: auto; }
.wo-insumos-table th:nth-child(3), .wo-insumos-table td:nth-child(3) { width: 39%; }
.wo-services-table th:nth-child(4), .wo-services-table td:nth-child(4) { width: 104px; }
.wo-insumos-table th:nth-child(4), .wo-insumos-table td:nth-child(4) { width: 150px; }
.wo-services-table th:nth-child(5), .wo-services-table td:nth-child(5) { width: 132px; }
.wo-insumos-table th:nth-child(5), .wo-insumos-table td:nth-child(5) { width: 190px; }
.wo-services-table th:nth-child(6), .wo-services-table td:nth-child(6) { width: 104px; }
.wo-insumos-table th:nth-child(6), .wo-insumos-table td:nth-child(6) { width: 120px; }
.wo-table-shell[data-table-expanded="true"] .wo-results-table-wrap,
.wo-work-scroll[data-table-expanded="true"] { overflow-x: auto; scrollbar-gutter: stable; }
.wo-table-shell[data-table-expanded="true"] .wo-results-table { min-width: 1120px; table-layout: auto; }
.wo-table-shell[data-table-expanded="true"] .wo-results-table th,
.wo-table-shell[data-table-expanded="true"] .wo-results-table td { overflow: visible; text-overflow: clip; }

.wo-workbench { min-width: 0; }
.wo-workbench[data-open="true"] { display: grid; height: clamp(430px, calc(100dvh - 255px), 760px); grid-template-rows: minmax(120px, var(--wo-results-pane, 44%)) 12px minmax(180px, 1fr); }
.wo-workbench[data-open="true"] .wo-workbench__results { min-height: 0; overflow: hidden; }
.wo-workbench[data-open="true"] .wo-results-table-wrap { height: 100% !important; max-height: none !important; }
.wo-workbench__splitter { position: relative; border-block: 1px solid var(--wo-border, #cbd5e1); background: var(--wo-surface-muted, #f1f5f9); cursor: row-resize; touch-action: none; }
.wo-workbench__splitter span { position: absolute; inset: 50% auto auto 50%; width: 48px; height: 4px; border-radius: 999px; background: var(--wo-muted, #64748b); opacity: .55; transform: translate(-50%, -50%); }
.wo-workbench__splitter:hover span,
.wo-workbench__splitter:focus-visible span { background: var(--wo-primary, #2563eb); opacity: 1; }
.wo-workbench[data-open="true"] > .wo-service-workspace,
.wo-workbench[data-open="true"] > .wo-product-workspace { min-height: 0; overflow: auto; padding: .45rem .6rem; scroll-margin: 0; }
.wo-analysis-bar { display: none; }
.wo-service-workspace--compact { position: relative; padding: 0 !important; }
.wo-service-workspace--compact .wo-analysis-bar {
    position: sticky;
    z-index: 9;
    top: 0;
    display: flex;
    min-height: 30px;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    border-bottom: 1px solid var(--wo-border, #cbd5e1);
    background: var(--wo-surface, #fff);
    padding: .15rem .35rem .15rem .55rem;
}
.wo-analysis-bar > strong { overflow: hidden; min-width: 0; color: var(--wo-primary, #2563eb); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.wo-analysis-bar__actions { display: flex; flex: 0 0 auto; gap: .25rem; }
.wo-analysis-bar__actions .wo-work-button { min-height: 24px; border-radius: 4px; padding: .12rem .4rem; font-size: .64rem; }
.wo-service-workspace--compact > .wo-compact-composition { min-height: 0; padding-top: 0; }
.wo-service-workspace--compact > .wo-compact-composition .wo-work-filters { display: none; }
.wo-service-workspace--compact > .wo-compact-composition .wo-work-scroll { border-top: 0; }
.wo-technical-details { border-top: 1px solid var(--wo-border, #cbd5e1); background: var(--wo-surface, #fff); }
.wo-technical-details > summary { display: flex; min-height: 30px; align-items: center; color: var(--wo-primary, #2563eb); padding: .25rem .55rem; font-size: .7rem; font-weight: 800; cursor: pointer; }
.wo-technical-details__body { display: grid; gap: .45rem; padding: .45rem .55rem .65rem; }
.wo-technical-intro { margin: 0; color: var(--wo-muted, #64748b); font-size: .72rem; }
.wo-technical-links { display: flex; flex-wrap: wrap; gap: .35rem; }
.wo-technical-links a { display: inline-flex; min-height: 28px; align-items: center; border: 1px solid var(--wo-border, #cbd5e1); border-radius: 5px; color: var(--wo-primary, #2563eb); padding: .2rem .5rem; font-size: .68rem; font-weight: 800; text-decoration: none; }
.wo-product-workspace > .wo-technical-details,
.wo-work-dialog .wo-technical-details { margin-top: .55rem; border: 1px solid var(--wo-border, #cbd5e1); border-radius: 6px; }
.wo-workspace-header { position: static; align-items: center; padding-bottom: .35rem; }
.wo-workspace-header h2 { overflow: hidden; max-width: 72ch; text-overflow: ellipsis; white-space: nowrap; }
.wo-workspace-header .wo-work-note { display: none; }
.wo-current-reference { padding: .35rem .5rem; }
.wo-current-reference strong { font-size: 1rem; }
.wo-tabs { margin-top: .3rem; }
.wo-tabs [role="tab"] { min-height: 32px; padding: .32rem .55rem; }
.wo-tab-panel { min-height: 100px; padding-top: .4rem; }

/* All data stays in one line until the user explicitly expands the table. */
.wo-work-scroll { position: relative; overflow: hidden; }
.wo-work-table { min-width: 0; table-layout: fixed; }
.wo-work-table th,
.wo-work-table td { height: 26px; overflow: hidden; padding: .24rem .38rem; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.wo-work-scroll[data-table-expanded="true"] .wo-work-table { min-width: 980px; table-layout: auto; }
.wo-work-scroll[data-table-expanded="true"] .wo-work-table th,
.wo-work-scroll[data-table-expanded="true"] .wo-work-table td { overflow: visible; text-overflow: clip; }
.wo-work-scroll > .wo-table-width-toggle { top: 2px; }

/* Composition tree inspired by the work manager: dense rows, lazy descendants and full-row categories. */
.wo-composition-grid .wo-tree-code { padding-left: calc(.35rem + var(--wo-tree-depth, 0) * 16px); }
.wo-tree-toggle { display: inline-grid; width: 20px; height: 20px; margin-right: .28rem; place-items: center; border: 0; border-radius: 3px; background: rgb(255 255 255 / .45); color: inherit; padding: 0; cursor: pointer; }
.wo-tree-toggle::before { content: "›"; font-size: 1rem; font-weight: 900; line-height: 1; }
.wo-tree-toggle[aria-expanded="true"]::before { transform: rotate(90deg); }
.wo-tree-toggle--empty { visibility: hidden; }
.wo-work-category { display: inline; width: auto; border: 0; margin: 0; padding: 0; color: inherit; font-size: .66rem; font-weight: 800; }
.wo-composition-grid tbody tr[data-category] { color: #0b1726; }
.wo-composition-grid tbody tr[data-category="Material"],
.wo-composition-grid tbody tr[data-category="Outro"] { background: #67d4e7; }
.wo-composition-grid tbody tr[data-category="Equipamento"] { background: #7bd184; }
.wo-composition-grid tbody tr[data-category="MaoDeObra"] { background: #b91c1c; color: #fff; }
.wo-composition-grid tbody tr[data-category="ServicoAuxiliar"] { background: #f8c35b; }
.wo-composition-grid tbody tr[data-category="Servico"] { background: #7c3aed; color: #fff; }
.wo-composition-grid tbody tr[data-category="Terceiro"] { background: #2563eb; color: #fff; }
.wo-composition-grid tbody tr[data-category]:hover { filter: brightness(.96); }
.wo-composition-grid tbody tr[data-category] a,
.wo-composition-grid tbody tr[data-category] button { color: inherit; }
.wo-tree-detail-row td { height: auto; background: var(--wo-surface, #fff); color: var(--wo-text, #0f172a); padding: .45rem; white-space: normal; }
.wo-inline-product { display: block; }
.wo-inline-product__identity { display: grid; align-content: start; gap: .2rem; }
.wo-inline-product__identity strong { font-size: .78rem; }
.wo-inline-product__identity span { color: var(--wo-muted, #64748b); font-size: .68rem; }

.dark .wo-composition-grid tbody tr[data-category="Material"],
.dark .wo-composition-grid tbody tr[data-category="Outro"] { background: #0e7490; color: #fff; }
.dark .wo-composition-grid tbody tr[data-category="Equipamento"] { background: #166534; color: #fff; }
.dark .wo-composition-grid tbody tr[data-category="ServicoAuxiliar"] { background: #d97706; color: #111827; }

.dark .wo-workspace-header,
.dark .wo-work-dialog__header,

@media (max-width: 900px) {
    .wo-work-metrics { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
    .wo-related ul { grid-template-columns: repeat(2, 1fr); }
    .wo-bar-row--wide { grid-template-columns: minmax(150px, 1fr) minmax(90px, .8fr); }
    .wo-bar-row--wide > strong { grid-column: 1 / -1; text-align: left; }
}

@media (max-width: 700px) {
    .wo-services[data-mode="PesquisaLocal"] { padding-top: 4.85rem; }
    .wo-query-utilities { grid-template-columns: 1fr; }
    .wo-query-utilities .wo-search-panel__summary-copy > span:last-child { max-width: 42vw; }
    .wo-regime-switch { order: -1; }
    .wo-workbench[data-open="true"] { display: block; height: auto; }
    .wo-workbench__splitter { display: none; }
    .wo-workbench[data-open="true"] > .wo-service-workspace,
    .wo-workbench[data-open="true"] > .wo-product-workspace { overflow: visible; }
    .wo-workspace-header h2 { max-width: 100%; white-space: normal; }
    .wo-inline-product { grid-template-columns: 1fr; }
    .wo-work-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
    .wo-work-dialog__body { padding: .65rem; }
    .wo-workspace-header { position: static; flex-direction: column; }
    .wo-workspace-actions { justify-content: flex-start; }
    .wo-workspace-actions button,
    .wo-workspace-actions a { min-height: 42px; }
    .wo-current-reference select { width: 100%; margin-left: 0; }
    .wo-work-metrics { grid-template-columns: 1fr; }
    .wo-work-metric { min-height: 78px; }
    .wo-work-table { min-width: 610px; }
    .wo-bar-row,
    .wo-bar-row--wide { grid-template-columns: 58px minmax(100px, 1fr); }
    .wo-bar-row > strong { grid-column: 1 / -1; text-align: left; }
    .wo-results-toolbar { align-items: center; }
    .wo-selection-count { margin-left: 0; }
    [data-selection-host] { display: block; width: 100%; }
    .wo-selection-tray { width: 100%; border-top: 1px solid var(--wo-border, #cbd5e1); padding-top: .4rem; }
    .wo-selection-tray__items { width: 100%; }
    .wo-selection-chip { min-height: 40px; }
    .wo-insumos .wo-results-table-wrap { display: block; height: 54vh; max-height: 500px; }
    .wo-insumos .wo-results-table { min-width: 0; }
    .wo-insumos .wo-table-shell:not([data-table-expanded="true"]) .wo-insumos-table th:nth-child(4),
    .wo-insumos .wo-table-shell:not([data-table-expanded="true"]) .wo-insumos-table td:nth-child(4),
    .wo-insumos .wo-table-shell:not([data-table-expanded="true"]) .wo-insumos-table th:nth-child(6),
    .wo-insumos .wo-table-shell:not([data-table-expanded="true"]) .wo-insumos-table td:nth-child(6) { display: none; }
    .wo-insumos .wo-insumos-table th:nth-child(1), .wo-insumos .wo-insumos-table td:nth-child(1) { width: 38px; }
    .wo-insumos .wo-insumos-table th:nth-child(2), .wo-insumos .wo-insumos-table td:nth-child(2) { width: 76px; }
    .wo-insumos .wo-insumos-table th:nth-child(3), .wo-insumos .wo-insumos-table td:nth-child(3) { width: auto; }
    .wo-insumos .wo-insumos-table th:nth-child(5), .wo-insumos .wo-insumos-table td:nth-child(5) { width: 112px; }
    .wo-tutorial { grid-template-columns: 1fr; }
    .wo-secondary-content,
    .wo-related ul { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .wo-work-skeleton { animation: none; }
    .wo-service-workspace *,
    .wo-product-workspace *,
    .wo-work-dialog * { scroll-behavior: auto !important; transition: none !important; }
}

@media (forced-colors: active) {
    .wo-results-table tr[data-compare-selected="true"],
    .wo-results-table tr[data-work-selected="true"] { outline: 3px solid Highlight; }
    .wo-cost-stack__part,
    .wo-bar-fill { background: Highlight; }
    .wo-tabs [role="tab"][aria-selected="true"] { border-bottom-color: Highlight; }
}
