/* GemLooM Diamond Engine R5R15R4 final visual closure.
   Scope: layout-only. No scientific, pricing, identity, market, history, auth or API logic changes. */

/* Sticky must use the page scrollport. overflow:hidden on html/body creates a
   clipping/scroll ancestor in Chromium and can prevent the identity bar from
   sticking reliably. overflow:clip preserves horizontal containment without
   creating a scroll container. */
html,body{
  overflow-x:clip !important;
  overflow-y:visible !important;
}
html[data-diamond-theme] .container{
  overflow:visible !important;
}
.gl-r5r9-identity-bar{
  position:sticky !important;
  top:0 !important;
  z-index:10000 !important;
  align-self:start !important;
  height:max-content !important;
  isolation:isolate;
}

/* The first workbench row is as tall as the completeness/provenance stack.
   Stretch the Digital Twin into the previously unused space, then reserve the
   bottom row for L/W, face-up area, spread and optics. */
#glR5R9TwinCard{
  align-self:stretch !important;
  height:100% !important;
  min-height:0 !important;
  display:grid !important;
  box-sizing:border-box !important;
  grid-template-rows:auto minmax(0,1fr) auto !important;
}
#glR5R9TwinCard .gl-r5r9-twin-layout{
  min-height:0 !important;
  height:100% !important;
  align-items:stretch !important;
}
#glR5R9TwinCard .gl-r5r9-svgbox,
#glR5R9TwinCard .gl-r5r9-canvasbox{
  height:auto !important;
  min-height:300px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
}
#glR5R9TwinCard .gl-r5r9-svgbox svg,
#glR5R9TwinCard #glR5R9MeshCanvas{
  width:100% !important;
  height:100% !important;
  min-height:300px !important;
  align-self:stretch !important;
}
#glR5R9TwinCard .gl-r5r9-shape-metrics{
  align-self:end !important;
  margin-top:10px !important;
}

/* Scenario Studio actions stay on one line. Clear is intentionally destructive
   in appearance but only clears the in-browser comparison baseline. */
#glR5R9Workbench .gl-r5r9-actions{
  display:inline-flex !important;
  flex-wrap:nowrap !important;
  align-items:center !important;
  gap:7px !important;
  white-space:nowrap !important;
}
#glR5R9CaptureBaseline,
#glR5R9ClearBaseline{
  flex:0 0 auto !important;
}
/* Theme bridge has a high-specificity generic button rule (including :not(#r5AnalyseBtn)).
   Keep this destructive Clear action explicitly above that cascade in both themes. */
html[data-diamond-theme] #glR5R9Workbench #glR5R9ClearBaseline{
  background:#dc2626 !important;
  border-color:#dc2626 !important;
  color:#ffffff !important;
}
html[data-diamond-theme] #glR5R9Workbench #glR5R9ClearBaseline:hover,
html[data-diamond-theme] #glR5R9Workbench #glR5R9ClearBaseline:focus-visible{
  background:#b91c1c !important;
  border-color:#b91c1c !important;
  color:#ffffff !important;
}

@media(max-width:980px){
  #glR5R9TwinCard{height:auto !important;}
  #glR5R9TwinCard .gl-r5r9-svgbox,
  #glR5R9TwinCard .gl-r5r9-canvasbox,
  #glR5R9TwinCard .gl-r5r9-svgbox svg,
  #glR5R9TwinCard #glR5R9MeshCanvas{
    min-height:260px !important;
    height:260px !important;
  }
}

/* R14R40 TDP live-market provenance and summary. */
.r5-tdp-badge{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:38px;padding:3px 8px;border-radius:999px;
  font-size:11px;font-weight:800;letter-spacing:.04em;
  background:#4f46e5;color:#fff;border:1px solid #4338ca;
}
.r5-source-tdp{font-weight:700;}
.r5-tdp-market-block{margin-top:16px;padding-top:14px;border-top:1px solid rgba(100,116,139,.28);}
.r5-tdp-title{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:10px;}
.r5-tdp-title>span:last-child{font-size:12px;opacity:.72;}
.r5-tdp-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:10px 0 12px;}
.r5-tdp-summary-grid>div{padding:10px;border:1px solid rgba(100,116,139,.24);border-radius:9px;min-width:0;}
.r5-tdp-summary-grid span{display:block;font-size:11px;opacity:.7;margin-bottom:3px;}
.r5-tdp-summary-grid strong{font-size:15px;}
@media(max-width:760px){.r5-tdp-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}

/* R14R47R1 final Diamond Engine closure UI — Top Market only; TDP block is intentionally untouched. */
.r5-legacy-market .r5-top-market-range-note{
  margin:8px 0 6px;padding:7px 10px;border:1px solid var(--gl-line);border-radius:10px;
  background:color-mix(in srgb,var(--gl-surface-2) 86%,transparent);color:var(--gl-text-soft);
  font:800 10px/1.35 inherit;letter-spacing:.01em;
}
.r5-legacy-market .r5-top-market-scroll{
  max-height:430px;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable both-edges;
  border:1px solid var(--gl-line);border-radius:12px;
}
.r5-legacy-market .r5-top-market-scroll thead th{
  position:sticky;top:0;z-index:4;background:var(--gl-surface);box-shadow:0 1px 0 var(--gl-line);
}
.r5-fluor-visual{
  display:grid;grid-template-columns:minmax(150px,.75fr) 120px minmax(260px,1.4fr);align-items:center;gap:14px;
  margin:10px 0 12px;padding:12px 14px;border:1px solid color-mix(in srgb,#4f46e5 28%,var(--gl-line));border-radius:14px;
  background:radial-gradient(circle at 34% 45%,rgba(99,102,241,.16),transparent 34%),linear-gradient(135deg,color-mix(in srgb,var(--gl-surface) 92%,#312e81 8%),var(--gl-surface));
  overflow:hidden;
}
.r5-fluor-copy{display:grid;gap:2px}.r5-fluor-copy>span{font:900 9px/1.2 inherit;text-transform:uppercase;letter-spacing:.08em;color:var(--gl-muted)}
.r5-fluor-copy>strong{font:900 18px/1.2 inherit;color:var(--gl-text)}.r5-fluor-copy>small{font:700 9px/1.35 inherit;color:var(--gl-text-soft)}
.r5-fluor-diamond{position:relative;width:72px;height:72px;margin:auto;filter:drop-shadow(0 0 8px rgba(99,102,241,.26))}
.r5-fluor-diamond span{position:absolute;inset:12px;transform:rotate(45deg);border:2px solid rgba(165,180,252,.9);background:linear-gradient(135deg,rgba(224,231,255,.10),rgba(99,102,241,.26));border-radius:8px;box-shadow:inset 0 0 18px rgba(129,140,248,.26),0 0 18px rgba(99,102,241,.18)}
.r5-fluor-visual.active .r5-fluor-diamond{filter:drop-shadow(0 0 8px rgba(59,130,246,.75)) drop-shadow(0 0 18px rgba(99,102,241,.48))}
.r5-fluor-visual.active .r5-fluor-diamond span{background:linear-gradient(135deg,rgba(125,211,252,.28),rgba(79,70,229,.56));box-shadow:inset 0 0 24px rgba(191,219,254,.48),0 0 24px rgba(59,130,246,.48)}
.r5-fluor-diamond i{position:absolute;left:50%;top:50%;width:7px;height:7px;border-radius:50%;background:#dbeafe;transform:translate(-50%,-50%);box-shadow:0 0 12px #93c5fd,0 0 22px #6366f1}
.r5-fluor-visual.none .r5-fluor-diamond i{opacity:.28;box-shadow:none}
.r5-fluor-scale{display:grid;gap:6px}.r5-fluor-track{height:10px;border-radius:999px;background:linear-gradient(90deg,rgba(148,163,184,.24),rgba(96,165,250,.20),rgba(79,70,229,.26));overflow:hidden;border:1px solid color-mix(in srgb,var(--gl-line) 75%,transparent)}
.r5-fluor-track i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#93c5fd,#60a5fa,#6366f1);box-shadow:0 0 14px rgba(99,102,241,.48)}
.r5-fluor-ticks{display:grid;grid-template-columns:repeat(5,1fr);gap:4px;color:var(--gl-muted);font:800 8px/1.2 inherit;text-align:center}.r5-fluor-ticks span:first-child{text-align:left}.r5-fluor-ticks span:last-child{text-align:right}
@media(max-width:820px){.r5-fluor-visual{grid-template-columns:1fr 90px}.r5-fluor-scale{grid-column:1/-1}.r5-legacy-market .r5-top-market-scroll{max-height:360px}}



/* R14R49 targeted page-stretch containment. Top Market only; TDP block intentionally untouched. */
#reportBox,
.r5-legacy-market{
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  box-sizing:border-box !important;
}
.r5-legacy-market{
  overflow-x:hidden !important;
}
.r5-legacy-market > *{
  min-width:0 !important;
  max-width:100% !important;
  box-sizing:border-box !important;
}
.r5-legacy-market .r5-top-market-scroll{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  overflow-x:auto !important;
  overflow-y:auto !important;
  box-sizing:border-box !important;
}
.r5-legacy-market .r5-top-market-scroll .r5-table{
  width:max-content !important;
  min-width:100% !important;
  max-width:none !important;
}
.r5-legacy-market .r5-top-market-scroll th,
.r5-legacy-market .r5-top-market-scroll td{
  white-space:nowrap;
}
.r5-legacy-market .r5-market-head,
.r5-legacy-market .r5-market-summary,
.r5-legacy-market .r5-market-note,
.r5-legacy-market .r5-top-market-range-note{
  min-width:0 !important;
  max-width:100% !important;
  overflow-wrap:anywhere;
  word-break:normal;
}
.r5-legacy-market .r5-fluor-visual{
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  box-sizing:border-box !important;
  grid-template-columns:minmax(0,.75fr) 120px minmax(0,1.4fr);
}
@media(max-width:820px){
  .r5-legacy-market .r5-fluor-visual{
    grid-template-columns:minmax(0,1fr) 82px;
  }
  .r5-legacy-market .r5-fluor-scale{
    min-width:0;
    max-width:100%;
  }
}

/* R14R49R3R3 responsive Top Market scroll authority.
   Parent-independent so responsive DOM/class changes cannot disable internal scrolling. */
.r5-top-market-scroll{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  overflow-x:auto !important;
  overflow-y:auto !important;
  box-sizing:border-box !important;
  overscroll-behavior:contain;
}
.r5-top-market-scroll .r5-table{
  width:max-content !important;
  min-width:100% !important;
  max-width:none !important;
}

/* R14R50R1 Top Market real-table repair.
   Keep all matched rows readable; no page stretch; horizontal scroll only when viewport truly requires it. */
.r5-top-market-scroll{
  max-height:none !important;
  overflow-x:auto !important;
  overflow-y:visible !important;
  scrollbar-gutter:auto !important;
  overscroll-behavior-x:contain;
  overscroll-behavior-y:auto;
}
.r5-top-market-scroll .r5-table{
  display:table !important;
  table-layout:fixed !important;
  width:100% !important;
  min-width:1180px !important;
  max-width:none !important;
  border-collapse:separate !important;
  border-spacing:0 !important;
}
.r5-top-market-scroll thead{display:table-header-group !important;}
.r5-top-market-scroll tbody{display:table-row-group !important;}
.r5-top-market-scroll tr{
  display:table-row !important;
  position:static !important;
  transform:none !important;
  height:auto !important;
}
.r5-top-market-scroll th,
.r5-top-market-scroll td{
  display:table-cell !important;
  position:static !important;
  transform:none !important;
  writing-mode:horizontal-tb !important;
  white-space:normal !important;
  overflow:visible !important;
  overflow-wrap:anywhere !important;
  word-break:normal !important;
  height:auto !important;
  max-height:none !important;
  min-width:0 !important;
  padding:8px 7px !important;
  vertical-align:top !important;
  line-height:1.25 !important;
}
.r5-top-market-scroll td small.gl-r5r9-delta{
  display:block;
  margin-top:2px;
  white-space:nowrap;
}
.gl-r5r50-fluor-row{margin:12px 0;display:block;min-width:0;}
.gl-r5r50-fluor-card{min-width:0;}
.gl-r5r50-fluor-card .r5-fluor-visual{margin:0;max-width:100%;min-width:0;}
.form-section[data-r50-bottom="true"]{margin-top:18px;}
@media(max-width:1200px){
  .r5-top-market-scroll .r5-table{min-width:1180px !important;}
}


/* R14R50R4C1 Report & Evidence foundation */
.r5-report-evidence-status{min-height:42px;display:flex;align-items:center;padding:10px 12px;border:1px solid var(--border,#d7dde5);border-radius:10px;background:var(--panel,#fff);font-size:13px}
.r5-report-evidence-status[data-kind="warn"],#r5ReportPdfStatus[data-kind="warn"]{font-weight:600}
.r5-report-evidence-status[data-kind="error"],#r5ReportPdfStatus[data-kind="error"]{font-weight:700}
.r5-report-evidence-preview{margin-top:8px;padding:14px;border:1px solid var(--border,#d7dde5);border-radius:12px;background:var(--panel,#fff)}
.r5-report-evidence-title{font-weight:800;margin-bottom:8px}
.r5-report-evidence-row{display:grid;grid-template-columns:minmax(120px,180px) 1fr;gap:12px;padding:6px 0;border-bottom:1px solid rgba(127,127,127,.16)}
.r5-report-evidence-row strong{overflow-wrap:anywhere}
.r5-report-evidence-note{margin-top:10px;font-size:12px;line-height:1.45;opacity:.78}
#r5ReportPdf{max-width:100%}

/* R14R50R4D1H5 explicit report extraction action */
#r5ReportExtractApply.r5-report-extract-action{width:100%;margin-top:6px;min-height:32px;}
#r5ReportExtractApply.r5-report-extract-action:disabled{opacity:.5;cursor:not-allowed;}


/* R14R50R4D1L UI repair: Top Market idempotency/readability + structured report evidence workspace */
.r5-top-market-scroll tbody tr{height:auto !important;min-height:44px !important;}
.r5-top-market-scroll th,.r5-top-market-scroll td{vertical-align:middle !important;line-height:1.25 !important;}
.r5-top-market-scroll td small.gl-r5r9-delta{display:inline-block !important;margin:2px 0 0 6px !important;padding:2px 5px;border-radius:999px;background:color-mix(in srgb,var(--gl-surface-2) 86%,transparent);font-size:9px;font-weight:800;line-height:1.2;white-space:nowrap !important;}
.r5-top-market-scroll td:nth-child(4){max-width:230px;overflow:hidden !important;text-overflow:ellipsis;white-space:nowrap !important;}
.r5-top-market-scroll td:nth-child(14){min-width:118px !important;}
.r5-top-market-scroll .gl-r5r9-simcell{min-width:105px;}

.r5-report-section{padding:12px !important;}
.r5-report-workspace{display:grid;grid-template-columns:minmax(280px,.9fr) minmax(420px,1.35fr) minmax(300px,.95fr);gap:12px;align-items:start;}
.r5-report-panel{min-width:0;border:1px solid var(--border,#d7dde5);border-radius:12px;background:var(--panel,#fff);padding:12px;box-sizing:border-box;}
.r5-report-panel-title{font-size:12px;font-weight:800;margin-bottom:10px;color:var(--gl-text,#111827);}
.r5-report-field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px 10px;align-items:start;}
.r5-report-file-field{grid-column:1/-1;}
.r5-report-detail-groups{display:grid;gap:10px;}
.r5-report-detail-group{min-width:0;border-top:1px solid rgba(127,127,127,.14);padding-top:9px;}
.r5-report-detail-group:first-child{border-top:0;padding-top:0;}
.r5-report-detail-group h5{margin:0 0 7px;font-size:10px;text-transform:uppercase;letter-spacing:.06em;opacity:.72;}
.r5-report-detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;}
.r5-report-detail-item{min-width:0;padding:7px 8px;border:1px solid rgba(127,127,127,.14);border-radius:8px;background:color-mix(in srgb,var(--gl-surface-2,#f8fafc) 88%,transparent);}
.r5-report-detail-item span{display:block;font-size:9px;line-height:1.2;opacity:.66;margin-bottom:2px;}
.r5-report-detail-item strong{display:block;font-size:11px;line-height:1.3;overflow-wrap:anywhere;}
.r5-report-empty{padding:14px;border:1px dashed rgba(127,127,127,.28);border-radius:9px;font-size:11px;line-height:1.4;opacity:.72;}
.r5-report-evidence-panel .r5-report-evidence-preview{margin-top:10px;padding:0;border:0;background:transparent;}
.r5-report-evidence-panel .r5-report-evidence-row{grid-template-columns:minmax(92px,120px) minmax(0,1fr);gap:8px;padding:6px 0;}
.r5-report-supplier-note{margin-top:10px;padding:10px;border:1px solid rgba(127,127,127,.16);border-radius:9px;display:grid;gap:3px;font-size:10px;line-height:1.4;}
.r5-report-supplier-note span{opacity:.72;}
#r5ReportExtractApply.r5-report-extract-action{min-height:38px;font-weight:800;}
@media(max-width:1180px){.r5-report-workspace{grid-template-columns:1fr 1fr}.r5-report-evidence-panel{grid-column:1/-1}.r5-report-evidence-panel .r5-report-evidence-preview{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 14px}.r5-report-evidence-title,.r5-report-evidence-note{grid-column:1/-1}}
@media(max-width:760px){.r5-report-workspace{grid-template-columns:1fr}.r5-report-evidence-panel{grid-column:auto}.r5-report-field-grid,.r5-report-detail-grid{grid-template-columns:1fr}.r5-report-evidence-panel .r5-report-evidence-preview{display:block}}

/* GL_R14R50R4D1M2R4R4_REPORT_WORKSPACE_VISIBILITY_REPAIR
   Scope: existing report/evidence workspace only. Top Market / analysis logic untouched. */
html body .r5-report-workspace {
  display:grid !important;
  grid-template-columns:minmax(0,1.15fr) minmax(0,1fr) minmax(0,.95fr) !important;
  gap:14px !important;
  align-items:stretch !important;
  width:100% !important;
  max-width:100% !important;
  margin:14px 0 0 !important;
  overflow:visible !important;
  box-sizing:border-box !important;
}
html body .r5-report-workspace > .r5-report-panel {
  display:flex !important;
  flex-direction:column !important;
  min-width:0 !important;
  width:auto !important;
  max-width:100% !important;
  height:100% !important;
  overflow:visible !important;
  box-sizing:border-box !important;
}
html body .r5-report-workspace .r5-report-field-grid,
html body .r5-report-workspace .r5-report-detail-groups,
html body .r5-report-workspace .r5-report-evidence-preview,
html body .r5-report-workspace .r5-report-supplier-note {
  min-width:0 !important;
  max-width:100% !important;
  overflow-wrap:anywhere !important;
}
@media (max-width:1400px) {
  html body .r5-report-workspace {
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;
  }
  html body .r5-report-workspace > .r5-report-evidence-panel {
    grid-column:1 / -1 !important;
  }
}
@media (max-width:900px) {
  html body .r5-report-workspace {
    grid-template-columns:minmax(0,1fr) !important;
  }
  html body .r5-report-workspace > .r5-report-evidence-panel {
    grid-column:auto !important;
  }
}
@media print {
  html body .r5-report-workspace {
    display:grid !important;
    grid-template-columns:minmax(0,1fr) !important;
    gap:8px !important;
  }
}
/* END GL_R14R50R4D1M2R4R4_REPORT_WORKSPACE_VISIBILITY_REPAIR */
/* GL_R14R50R4D1M2R4R5R3R7_COLLAPSE_SPECIFICITY_REPAIR
   Proven cause: r5r9-workbench.css generic collapsed-section rule wins by specificity.
   Scope: report workspace visibility/layout only. */
html body .form-section.r5-report-section.gl-r5r9-collapsed > .r5-report-workspace {
  display:grid !important;
  grid-template-columns:minmax(0,1.15fr) minmax(0,1fr) minmax(0,.95fr) !important;
  gap:14px !important;
  align-items:stretch !important;
  width:100% !important;
  max-width:100% !important;
  margin:14px 0 0 !important;
  overflow:visible !important;
  box-sizing:border-box !important;
}
html body .form-section.r5-report-section.gl-r5r9-collapsed > .r5-report-workspace > .r5-report-panel {
  display:flex !important;
  flex-direction:column !important;
  min-width:0 !important;
  width:auto !important;
  max-width:100% !important;
  height:100% !important;
  box-sizing:border-box !important;
}
@media (min-width:901px) {
  html body .form-section.r5-report-section.gl-r5r9-collapsed > .r5-report-workspace {
    grid-template-columns:minmax(0,1.15fr) minmax(0,1fr) minmax(0,.95fr) !important;
  }
  html body .form-section.r5-report-section.gl-r5r9-collapsed > .r5-report-workspace > .r5-report-evidence-panel {
    grid-column:auto !important;
  }
}
@media (max-width:900px) {
  html body .form-section.r5-report-section.gl-r5r9-collapsed > .r5-report-workspace {
    grid-template-columns:minmax(0,1fr) !important;
  }
  html body .form-section.r5-report-section.gl-r5r9-collapsed > .r5-report-workspace > .r5-report-evidence-panel {
    grid-column:auto !important;
  }
}
@media print {
  html body .form-section.r5-report-section.gl-r5r9-collapsed > .r5-report-workspace {
    display:grid !important;
    grid-template-columns:minmax(0,1fr) !important;
    gap:8px !important;
  }
}
/* END GL_R14R50R4D1M2R4R5R3R7_COLLAPSE_SPECIFICITY_REPAIR */