/* Work surfaces: left panel, 3D stage overlays, bottom drawer, inspector. */

/* Left panel */
.panel { background: transparent; }
.panel-body { min-height: 0; }
.panel-tree { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.panel-section { padding-top: var(--s-1); }
.panel-section > .panel-note { padding-top: var(--s-3); }
.panel-section .section-title:first-child { margin-top: var(--s-3); }
.tree-search { position: relative; flex: none; padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--line); }
.tree-search .field { padding-left: 26px; }
.search-icon { position: absolute; top: 50%; left: 20px; width: 14px; height: 14px; color: var(--text-3); transform: translateY(-50%); pointer-events: none; }
.tree { flex: 1 1 auto; min-height: 0; padding: 2px 0; }

/* Findings list (Contrôler) */
.finding-group { margin-top: var(--s-3); }
.finding-group-head { display: flex; align-items: center; gap: var(--s-2); margin-bottom: 2px; color: var(--text-2); font-size: var(--t-xs); font-weight: var(--w-semibold); }
.finding-group-head .num { margin-left: auto; color: var(--text-3); }
.finding-list { display: grid; gap: 1px; }
.finding-row { display: flex; align-items: center; gap: var(--s-2); width: 100%; min-height: 30px; padding: 4px 6px 4px 10px; border: 0; border-radius: var(--r-2); background: transparent; color: var(--text-1); font-size: var(--t-sm); text-align: left; }
.finding-row:hover { background: var(--bg-2); }
.finding-row.is-selected { background: var(--sel-bg); box-shadow: inset 2px 0 0 var(--sel-line); }
.finding-title { flex: 1 1 auto; min-width: 0; }
.finding-group + .panel-note { margin-top: var(--s-4); color: var(--text-3); font-size: var(--t-xs); }

/* Capabilities, from the support matrix */
.capability-panel { flex: none; max-height: 40%; overflow-y: auto; padding: 10px var(--s-4) var(--s-3); border-top: 1px solid var(--line); background: var(--bg-1); }
.capability-panel h2 { margin-bottom: 6px; color: var(--text-3); font-size: var(--t-micro); font-weight: var(--w-semibold); letter-spacing: .07em; text-transform: uppercase; }
.capabilities { display: grid; gap: 3px; }
.capability { color: var(--text-2); font-size: var(--t-xs); line-height: 1.4; }
.capability::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--text-3); vertical-align: 1px; }
.capability[data-state="SUPPORTED"]::before { background: var(--ok); }
.capability[data-state="PARTIAL"]::before { background: var(--sev-review); }
.capability[data-state="NOT_SUPPORTED"]::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--text-3); }
.capability-label { color: var(--text-1); }

/* Secondary options behind one disclosure */
.expert { margin-top: var(--s-4); padding-top: var(--s-2); border-top: 1px solid var(--line); }
.expert summary { height: 26px; color: var(--text-2); font-size: var(--t-sm); }
.expert summary:hover { color: var(--text-1); }
.expert-options { display: grid; gap: var(--s-2); padding: var(--s-2) 0 0 18px; }
.expert-options li { display: grid; gap: 4px; justify-items: start; }
.expert-hint { color: var(--text-3); font-size: var(--t-xs); }

/* Explorer: tree / filters switch, filter facets */
/* Sub-tab switcher: the DEPLOYED app's .tabs/.tab shape (audit 1256-1310), same geometry
   as .tabs above — padded 8 px-radius strip of 6 px-radius pills, ink fill when active. */
.segmented { display: flex; flex-wrap: nowrap; gap: 0.25rem; flex: none; margin: var(--s-2) var(--s-3) 0; padding: 0.5rem; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-2); overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.segmented [role="tab"], .segmented > button { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0.5rem 0.75rem; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font-size: var(--t-body); font-weight: var(--w-medium); white-space: nowrap; flex-shrink: 0; transition: background-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease); }
.segmented [role="tab"] .icon { width: 14px; height: 14px; }
.segmented [role="tab"]:hover:not([aria-selected="true"]), .segmented > button:hover:not([aria-pressed="true"]) { background: var(--bg-3); color: var(--text-1); }
.segmented [role="tab"][aria-selected="true"], .segmented > button[aria-pressed="true"] { background: var(--text-1); color: var(--text-inverse); }
.filters { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin-top: var(--s-2); padding: 0 var(--s-3) var(--s-4); border-top: 1px solid var(--line); }
.filter-summary { position: sticky; top: 0; z-index: 2; margin: 0 calc(-1 * var(--s-3)); padding: 6px var(--s-3); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px var(--s-2); min-height: 38px; border-bottom: 1px solid var(--line); background: var(--bg-1); color: var(--text-2); font-size: var(--t-sm); }
.filter-summary strong { color: var(--text-1); }
/* D-S1-03: the count and « Tout effacer » never cut: the count keeps its line, the button wraps under it. */
.filter-summary-count { min-width: 0; white-space: nowrap; }
.filter-summary .secondary-action { flex: 0 0 auto; white-space: nowrap; }
.secondary-action.compact { height: 24px; padding: 0 var(--s-2); font-size: var(--t-xs); }
.facet { padding: var(--s-2) 0; border-bottom: 1px solid var(--line); }
.facet:last-child { border-bottom: 0; }
.facet-title { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 0 4px 2px; color: var(--text-3); font-size: var(--t-micro); font-weight: var(--w-semibold); letter-spacing: .07em; text-transform: uppercase; }
.facet-title .num { letter-spacing: 0; text-transform: none; font-weight: var(--w-regular); }
.facet-list { display: grid; }
.facet-row { display: flex; align-items: center; gap: var(--s-2); width: 100%; height: 26px; padding: 0 6px 0 4px; border: 0; border-radius: var(--r-1); background: transparent; color: var(--text-2); font-size: var(--t-sm); text-align: left; }
.facet-row:hover { background: var(--bg-2); color: var(--text-1); }
.facet-row[aria-checked="true"] { color: var(--text-1); }
.check { display: grid; place-items: center; flex: none; width: 14px; height: 14px; border: 1.5px solid var(--line-2); border-radius: 3px; }
.facet-row[aria-checked="true"] .check { border-color: var(--text-1); background: var(--text-1); color: var(--bg-1); }
.check-icon { width: 11px; height: 11px; stroke-width: 2.2; }
.facet-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facet-count { flex: none; color: var(--text-3); font-size: var(--t-xs); }
.facet-more { height: 24px; margin-left: 22px; padding: 0; border: 0; background: transparent; color: var(--text-2); font-size: var(--t-xs); text-decoration: underline; text-underline-offset: 2px; }
.facet-more:hover { color: var(--text-1); }
.facet-search { margin: 2px 0 6px; }
.facet-note { padding: 4px 4px 0; color: var(--text-3); font-size: var(--t-xs); }
.facet-chosen { display: flex; align-items: center; gap: 4px; height: 26px; margin-bottom: 4px; padding: 0 2px 0 var(--s-2); border-radius: var(--r-1); background: var(--bg-3); color: var(--text-1); font-size: var(--t-sm); font-weight: var(--w-medium); }
.facet-chosen-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Gate explanation (inspector, Preuve) */
.gate-verdict { justify-self: start; display: inline-flex; align-items: center; gap: 8px; color: var(--text-1); font-size: var(--t-lg); font-weight: var(--w-semibold); }
.gate-verdict::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--text-3); }
.gate-verdict[data-verdict="BLOCKED"]::before { background: var(--sev-blocking); }
.gate-verdict[data-verdict="REVIEW"]::before { background: var(--sev-review); }
.gate-verdict[data-verdict="READY"]::before { background: var(--ok); }
.gate-reasons { display: grid; gap: var(--s-3); }
.gate-reason p { margin-bottom: 4px; color: var(--text-2); font-size: var(--t-sm); line-height: var(--lh); }

/* Bottom drawer */
.drawer { flex-direction: column; background: var(--bg-1); }
.drawer-head { display: flex; align-items: center; gap: var(--s-3); height: var(--drawer-head-h); flex: none; padding: 0 var(--s-1) 0 var(--s-3); border-bottom: 1px solid var(--line); }
.drawer-title { display: flex; align-items: center; gap: var(--s-2); color: var(--text-1); font-size: var(--t-sm); font-weight: var(--w-semibold); }
.drawer-title .icon { color: var(--text-3); }
.drawer-scope { display: inline-flex; align-items: center; gap: 2px; min-width: 0; max-width: 40%; height: 20px; padding: 0 2px 0 var(--s-2); overflow: hidden; border-radius: var(--r-1); background: var(--bg-3); color: var(--text-2); font-size: var(--t-xs); white-space: nowrap; }
.chip-clear { width: 18px; height: 18px; }
.chip-clear .icon { width: 12px; height: 12px; }
.drawer-count { margin-left: auto; color: var(--text-3); font-size: var(--t-xs); }
.drawer-toggle { width: 26px; height: 26px; }
.table { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }
.shell[data-drawer="closed"] .table { display: none; }
.table-head { flex: none; overflow: hidden; background: var(--bg-1); }
.table-body { flex: 1 1 auto; min-height: 0; }

/* Inspector */
.inspector { background: var(--bg-1); }
.inspector-header { display: flex; align-items: center; justify-content: space-between; height: 36px; flex: none; padding: 0 var(--s-2) 0 var(--s-4); }
.inspector-header h2 { color: var(--text-1); font-size: var(--t-sm); font-weight: var(--w-semibold); letter-spacing: .01em; }
.inspector-tabs { flex: none; }
.inspector-panel { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--s-3) var(--s-4) var(--s-5); }
.inspector-empty { display: grid; gap: 6px; padding-top: var(--s-2); }
.inspector-empty strong { color: var(--text-1); font-size: var(--t-md); }
.inspector-empty p { color: var(--text-2); font-size: var(--t-sm); line-height: var(--lh); }
.detail-head { display: grid; gap: 2px; margin-bottom: var(--s-2); }
.detail-title { color: var(--text-1); font-size: var(--t-lg); font-weight: var(--w-semibold); line-height: var(--lh-tight); overflow-wrap: anywhere; }
.detail-sub { color: var(--text-3); font-size: var(--t-xs); }
.prop-group { border-top: 1px solid var(--line); }
.prop-group > summary { height: 28px; color: var(--text-1); font-size: var(--t-sm); font-weight: var(--w-medium); }
.prop-group > summary span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prop-count { color: var(--text-3); font-size: var(--t-xs); font-weight: var(--w-regular); }
.prop-group .kv { padding: 0 0 var(--s-2) 18px; }
/* D-S1-02 : un nom de propriété se coupe à ses jointures (<wbr> aux majuscules), jamais au milieu d'un mot. */
.prop-group .prop-facts dt { overflow-wrap: break-word; hyphens: manual; }
.plain-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; }
.plain-list > li { min-width: 0; overflow-wrap: break-word; } /* IFC file names have no spaces */
.link-row { display: flex; align-items: center; gap: var(--s-2); width: 100%; min-height: 26px; padding: 2px 6px; border: 0; border-radius: var(--r-1); background: transparent; color: var(--text-1); font-size: var(--t-sm); text-align: left; }
.link-row:hover { background: var(--bg-2); }
.link-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-meta { flex: none; max-width: 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); font-size: var(--t-xs); }

@media (max-width: 760px) {
  .panel { border-right: 0; border-top: 1px solid var(--line); }
  .panel-body { overflow: visible; }
  .panel-tree .tree { height: 360px; flex: none; }
  .panel-tree .filters { max-height: 460px; flex: none; }
  .capability-panel { max-height: none; overflow: visible; }
}

/* The inspector toggle and close exist only where the inspector is a sheet (declared last: wins over button display) */
/* The inspector is a contextual sheet at every width: its open/close controls live with it. */
.shell .inspector-toggle, .shell .inspector-close { display: inline-flex; }
.shell .inspector:not([data-open="true"]) { display: none; }


