/* React keeps ownership of its children; only their display is overridden. */
main section.metrics:has(> #gigahub-inventory) > :not(#gigahub-inventory),
main:has(> #gigahub-inventory) > :not(#gigahub-inventory),
main .content:has(> #gigahub-inventory) > :not(#gigahub-inventory) { display: none !important; }
main:has(#gigahub-inventory), main .content:has(#gigahub-inventory) { min-width: 0; max-width: 100%; }
#gigahub-inventory { width: 100%; min-width: 0; max-width: 100%; color: var(--ink, #20252e); font: inherit; }
#gigahub-inventory * { box-sizing: border-box; }
#gigahub-inventory [hidden] { display: none !important; }
#gigahub-inventory .inv-header { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:24px; }
#gigahub-inventory h1 { margin:4px 0 8px; font-size:26px; font-weight:800; letter-spacing:-.025em; }
#gigahub-inventory h2 { font-size:17px; margin:0 0 8px; }
#gigahub-inventory p { margin:6px 0; }
#gigahub-inventory .inv-eyebrow { font-size:10px; font-weight:750; letter-spacing:.12em; color:var(--text-secondary, #687383); }
#gigahub-inventory .inv-muted { color:var(--text-secondary, #687383); font-size:12px; line-height:1.5; }
#gigahub-inventory .inv-button, #gigahub-inventory input, #gigahub-inventory select { font:inherit; border:1px solid var(--border, #dce1e7); background:var(--surface, white); border-radius:8px; color:inherit; min-height:38px; padding:8px 12px; }
#gigahub-inventory .inv-button { cursor:pointer; text-decoration:none; font-weight:650; font-size:13px; white-space:nowrap; }
#gigahub-inventory .inv-button:hover { border-color:var(--primary, #deb03b); background:#fff9e9; }
#gigahub-inventory :is(button, input, select, a, summary, [tabindex]):focus-visible { outline:2px solid var(--primary, #dba62c); outline-offset:3px; }
#gigahub-inventory .inv-toolbar { display:flex; align-items:end; gap:12px; margin-bottom:20px; flex-wrap:wrap; }
#gigahub-inventory .inv-toolbar label { display:flex; flex-direction:column; gap:6px; font-size:12px; color:var(--text-secondary, #687383); }
#gigahub-inventory .inv-toolbar select { max-width:260px; }
#gigahub-inventory .inv-search { flex:1; min-width:220px; }
#gigahub-inventory .inv-toolbar .inv-vat { flex-direction:row; align-items:center; color:var(--ink, #20252e); min-height:38px; white-space:nowrap; }
#gigahub-inventory .inv-vat input { min-height:auto; accent-color:var(--primary, #deb03b); }
#gigahub-inventory .inv-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:12px; margin-bottom:20px; }
#gigahub-inventory .inv-cards article { border:1px solid var(--border, #dce1e7); border-radius:12px; padding:17px 18px; background:var(--surface, white); }
#gigahub-inventory .inv-cards article > span { font-size:12px; color:var(--text-secondary, #687383); }
#gigahub-inventory .inv-cards strong { display:block; font-size:23px; margin-top:8px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; letter-spacing:-.02em; }
#gigahub-inventory .inv-cards small { font-size:12px; font-weight:500; }
#gigahub-inventory .inv-table-wrap { max-width:100%; overflow:auto; border:1px solid var(--border, #dce1e7); border-radius:12px; max-height:68vh; background:var(--surface, white); }
#gigahub-inventory .inv-table { border-collapse:separate; border-spacing:0; width:100%; font-size:12px; }
#gigahub-inventory .inv-table :is(th,td) { padding:12px 13px; border-bottom:1px solid var(--border, #e6e9ed); vertical-align:top; text-align:left; }
#gigahub-inventory .inv-table th { font-weight:650; }
#gigahub-inventory .inv-table thead th { position:sticky; top:0; z-index:2; background:#f3f5f7; vertical-align:bottom; white-space:nowrap; font-size:11px; color:#4c5868; }
#gigahub-inventory .inv-table tr > :first-child { position:sticky; left:0; z-index:1; background:var(--surface, white); min-width:220px; max-width:300px; box-shadow:1px 0 0 var(--border, #e6e9ed); }
#gigahub-inventory .inv-table thead tr > :first-child { z-index:3; background:#f3f5f7; }
#gigahub-inventory .inv-table .inv-num { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
#gigahub-inventory .inv-table small { display:block; margin-top:4px; font-size:10px; font-weight:400; color:#6a7585; }
#gigahub-inventory .inv-table .inv-emphasis { background:#fffaf0; font-weight:700; }
#gigahub-inventory .inv-table tfoot :is(th,td) { background:#f3f5f7; border-bottom:0; font-weight:750; }
#gigahub-inventory .inv-table summary { cursor:pointer; overflow-wrap:anywhere; }
#gigahub-inventory .inv-row-detail { font-size:11px; font-weight:400; padding-top:8px; color:var(--text-secondary, #687383); }
#gigahub-inventory .inv-issues { padding:10px 14px 10px 30px; margin:0 0 14px; background:#fff7e6; border:1px solid #edd7a7; border-radius:8px; font-size:12px; color:#745018; line-height:1.5; }
#gigahub-inventory .inv-row-detail .inv-issues { padding:8px 8px 8px 22px; }
#gigahub-inventory .inv-warning { color:#8a5a16; font-size:12px; }
#gigahub-inventory .inv-valuation { margin:0 0 12px; }
#gigahub-inventory .inv-sources { margin-top:28px; }
#gigahub-inventory .inv-accounts { display:grid; grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); gap:12px; margin-top:12px; }
#gigahub-inventory .inv-account { border:1px solid var(--border, #dce1e7); padding:16px; border-radius:10px; background:var(--surface, white); font-size:12px; line-height:1.5; }
#gigahub-inventory .inv-account-title { display:flex; gap:12px; justify-content:space-between; }
#gigahub-inventory .inv-account-title span { text-transform:uppercase; font-size:10px; color:var(--text-secondary, #687383); }
#gigahub-inventory .inv-account .inv-issues { margin:12px 0 0; }
#gigahub-inventory .inv-state, #gigahub-inventory .inv-empty { padding:40px 20px; text-align:center; color:var(--text-secondary, #687383); }
#gigahub-inventory .inv-error { color:#933b32; border:1px solid #e9c1bb; border-radius:10px; background:#fff7f5; }
@media(max-width:700px) {
  #gigahub-inventory .inv-header { flex-direction:column; gap:12px; }
  #gigahub-inventory h1 { font-size:23px; }
  #gigahub-inventory .inv-cards { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #gigahub-inventory .inv-cards strong { font-size:19px; }
  #gigahub-inventory .inv-cards article { padding:12px; }
  #gigahub-inventory .inv-toolbar > label { flex:1; }
  #gigahub-inventory .inv-toolbar select { max-width:100%; width:100%; }
  #gigahub-inventory .inv-search { min-width:100%; }
  #gigahub-inventory .inv-table tr > :first-child { min-width:170px; max-width:190px; }
  #gigahub-inventory .inv-table :is(th,td) { padding:10px; }
}

#gigahub-inventory .inv-product-link { color:var(--ink, #20252e); font-weight:650; text-decoration:underline; text-underline-offset:3px; }

main section.metrics:has(> #gigahub-inventory) { display:block; min-width:0; max-width:100%; }
#gigahub-inventory[data-product-view] .inv-product-link { display:none; }
#gigahub-inventory[data-product-view] h1 { font-size:19px; }

/* Keep table text readable in both native themes. */
#gigahub-inventory .inv-table tbody th { text-transform:none; letter-spacing:normal; color:var(--ink, #20252e); }
#gigahub-inventory .inv-table thead th,
#gigahub-inventory .inv-table thead tr > :first-child,
#gigahub-inventory .inv-table tfoot :is(th,td) { background:var(--surface-subtle, #f3f5f7); color:var(--text-secondary, #687383); }
#gigahub-inventory .inv-table small { color:var(--text-secondary, #687383); }
#gigahub-inventory .inv-table .inv-emphasis,
#gigahub-inventory .inv-button:hover { background:color-mix(in srgb, var(--primary, #deb03b) 8%, var(--surface, white)); }
:root[data-theme=dark] #gigahub-inventory .inv-issues { background:#2b2314; border-color:#5f4b23; color:#e4c78f; }
:root[data-theme=dark] #gigahub-inventory .inv-warning { color:#e4c78f; }
:root[data-theme=dark] #gigahub-inventory .inv-error { background:#2d1b1d; color:#f2b4b0; border-color:#70403c; }
/* Native link badges use a different last-card cache; quantities live in the report. */
main:has(#gigahub-inventory[data-product-view]) .card-head .links a small { display:none; }

#gigahub-inventory .inv-table thead .inv-expected-header { white-space:normal; min-width:190px; max-width:230px; }
