/**
 * Layout containers for /tools/ detail pages.
 *
 * .rlt-tool-page  — full-width page root
 * .rlt-text       — prose column (~1850px on large screens)
 * .rlt-workspace  — full-width interactive area
 *
 * body.roltec-tools — all /tools/ pages: lift 1130px chrome
 * body.roltec-tools-wide — visual editors: viewport-height workspaces
 */

:root {
  --rlt-tools-prose: 1850px;
  --rlt-tool-chrome: 180px;
  --rlt-tool-chrome-tight: 160px;
  --rlt-tool-chrome-viewer: 280px;
}

/* --- reusable containers --- */
.rlt-tool-page {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.rlt-text {
  max-width: var(--rlt-tools-prose);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.rlt-workspace {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

/* Aliases matching the recommended Roltec naming */
.tool-page {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.tool-workspace--editor,
.rlt-workspace--editor {
  width: 100%;
  min-height: 650px;
  height: calc(100vh - var(--rlt-tool-chrome));
  height: calc(100dvh - var(--rlt-tool-chrome));
  box-sizing: border-box;
}

.tool-workspace--calculator,
.rlt-workspace--calculator {
  width: 100%;
  min-height: 450px;
  height: auto;
  box-sizing: border-box;
}

.tool-workspace--results,
.rlt-workspace--results {
  width: 100%;
  min-height: 600px;
  height: auto;
  box-sizing: border-box;
}

/* --- Editor shells: fill remaining viewport --- */
/*
 * Schema-Editor: palette left, canvas center, Eigenschaften right.
 */
body.roltec-tools-wide .schema-editor__workspace {
  width: 100%;
  height: calc(100dvh - var(--rlt-tool-chrome, 180px));
  min-height: 560px;
  max-height: none;
  grid-template-columns: 300px minmax(0, 1fr) minmax(240px, 280px);
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
  box-sizing: border-box;
}

body.roltec-tools-wide .schema-editor__palette {
  display: flex;
  flex-direction: column;
  width: 300px;
  min-width: 300px;
  max-width: 300px;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

body.roltec-tools-wide .schema-editor__canvas-wrap {
  width: 100%;
  min-height: 0;
  height: 100%;
  max-height: none;
  box-sizing: border-box;
}

body.roltec-tools-wide .schema-editor__inspector {
  height: 100%;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
}

body.roltec-tools-wide .schema-editor__root {
  width: 100%;
  min-height: 0;
  height: auto;
  flex: 1 1 auto;
  box-sizing: border-box;
}

body.roltec-tools-wide .schema-editor__flow-host {
  width: 100%;
  min-height: 0;
  height: 100%;
  flex: 1 1 auto;
  box-sizing: border-box;
}

body.roltec-tools-wide .schema-editor__controls-bar,
body.roltec-tools-wide #schemaEditorControls {
  flex: 0 0 auto;
}

@media (max-width: 960px) {
  body.roltec-tools-wide .schema-editor__workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: calc(100dvh - 160px);
    min-height: 640px;
  }

  body.roltec-tools-wide .schema-editor__palette {
    width: 100%;
    min-width: 0;
    max-width: none;
    height: auto;
    max-height: none;
    overflow: hidden;
  }

  body.roltec-tools-wide .schema-editor__inspector {
    height: auto;
    max-height: 360px;
  }
}

/* Accordion + Statistik: explicit two-column meta row */
body.roltec-tools .rlt-tool-detail {
  display: block;
  max-width: none;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}

body.roltec-tools .rlt-tool-meta {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem 2rem;
  align-items: start;
  width: 100%;
  max-width: none;
  margin: 1.5rem 0 0;
  box-sizing: border-box;
  clear: both;
  position: relative;
  z-index: 5;
  visibility: visible !important;
  opacity: 1 !important;
  min-height: 8rem;
  overflow: visible !important;
}

/* If meta was left inside a tool workspace grid, span full row */
body.roltec-tools .rlt-workspace > .rlt-tool-meta,
body.roltec-tools [class*="__workspace"] > .rlt-tool-meta {
  grid-column: 1 / -1;
  width: 100%;
  max-width: none;
}

body.roltec-tools .rlt-tool-meta__info,
body.roltec-tools .rlt-tool-meta__stats {
  min-width: 0;
  width: 100%;
  max-width: none;
  overflow: visible !important;
}

body.roltec-tools .rlt-tool-meta__stats {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

body.roltec-tools .rlt-tool-detail form,
body.roltec-tools .rlt-tool-detail [class*="__form"] {
  display: block;
  visibility: visible;
  position: relative;
  z-index: 1;
  margin-top: 0;
}

/* H3 in der Form dupliziert die Seiten-H1 — ausblenden (Fallback bis DETAIL_TEXT bereinigt) */
body.roltec-tools .rlt-tool-detail form[class*="__form"] > h3 {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
}

/* Kein Leerraum zwischen H1 und .borderbx / Tool-Inhalt */
body.roltec-tools .block_uslugi_title,
body.roltec-tools .block_uslugi_title h1,
body.roltec-tools #content .block_uslugi_title h1 {
  margin-bottom: 0;
  padding-bottom: 0;
}

body.roltec-tools .borderbx {
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
}

body.roltec-tools .borderbx > .rlt-tool-detail,
body.roltec-tools .borderbx > .news-detail {
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
}

body.roltec-tools .rlt-tool-detail > .section_desc,
body.roltec-tools .news-detail > .section_desc {
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
}

body.roltec-tools .rlt-tool-detail > .section_desc > [class*="-page"],
body.roltec-tools .rlt-tool-detail > .section_desc > .rlt-section {
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
}

body.roltec-tools .rlt-tool-meta {
  margin-bottom: 0;
}

body.roltec-tools .rlt-tool-meta__info:empty {
  display: none;
}

body.roltec-tools .rlt-tool-meta:has(.rlt-tool-meta__info:empty) {
  grid-template-columns: 1fr;
}

body.roltec-tools .rlt-tool-detail .accordion {
  max-width: none;
  width: 100%;
  margin: 0;
}

/* Аккордеон: лёгкая серая плашка + стрелка */
body.roltec-tools .rlt-tool-detail .accordion .accordion_item {
  margin-bottom: 0.35rem;
  border-bottom: 1px solid #e5e7eb;
}

body.roltec-tools .rlt-tool-detail .accordion .title_block,
body.roltec-tools .rlt-tool-detail .accordion .title_block:hover,
body.roltec-tools .rlt-tool-detail .accordion .active_block .title_block {
  background: #f3f4f6;
  color: #111827;
  font-weight: 600;
  font-size: 1.05rem;
  padding: 0.7rem 2rem 0.7rem 0.85rem;
}

body.roltec-tools .rlt-tool-detail .accordion .title_block:hover,
body.roltec-tools .rlt-tool-detail .accordion .active_block .title_block {
  background: #eceef1;
}

body.roltec-tools .rlt-tool-detail .accordion .title_block:before,
body.roltec-tools
  .rlt-tool-detail
  .accordion
  .active_block
  .title_block:before {
  border-color: #374151;
  right: 0.25rem;
}

body.roltec-tools .rlt-tool-detail .accordion .title_block:before {
  top: 1rem;
}

body.roltec-tools
  .rlt-tool-detail
  .accordion
  .active_block
  .title_block:before {
  top: 1.15rem;
}

body.roltec-tools .rlt-tool-detail .accordion .info {
  padding: 0 0 0.85rem;
}

/* /tools/: keep .info_first closed (accordion.css opens it by default) */
body.roltec-tools .rlt-tool-detail .accordion .info_first {
  display: none;
}

body.roltec-tools .rlt-tool-detail .wissen-article-engagement,
body.roltec-tools .rlt-tool-meta__stats .wissen-article-engagement {
  position: relative;
  z-index: 2;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 1rem 1.1rem 1.15rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
  box-sizing: border-box;
}

body.roltec-tools .wissen-article-engagement__title {
  margin: 0 0 0.85rem;
  color: #111827;
  font-size: 1.05rem;
  font-weight: 700;
}

body.roltec-tools .wissen-article-engagement__actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
}

body.roltec-tools .wissen-article-engagement__vote,
body.roltec-tools .wissen-article-engagement__share,
body.roltec-tools .wissen-article-engagement__save {
  flex: 1 1 0;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 0.45rem;
  font-size: 0.82em;
  white-space: nowrap;
}

body.roltec-tools .wissen-article-engagement__label {
  white-space: nowrap;
}

@media (max-width: 640px) {
  body.roltec-tools .wissen-article-engagement__vote,
  body.roltec-tools .wissen-article-engagement__share,
  body.roltec-tools .wissen-article-engagement__save {
    flex: 1 1 0;
  }
}

body.roltec-tools .wissen-article-engagement__login {
  margin-top: 1rem;
  padding: 0.85rem 0.9rem;
  border-radius: 6px;
  background: #e8f5f3;
  color: #0f4c47;
}

body.roltec-tools .wissen-article-engagement__login p {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  line-height: 1.35;
}

body.roltec-tools .wissen-article-engagement__login-btn {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border-radius: 4px;
  background: #0f766e;
  color: #fff !important;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

body.roltec-tools .wissen-article-engagement__login-btn:hover {
  background: #0b5f59;
}

@media (max-width: 960px) {
  body.roltec-tools .rlt-tool-meta {
    grid-template-columns: 1fr;
  }
}

body.roltec-tools-wide .sps-logic-simulator__app,
body.roltec-tools-wide .gazebo-simulator__app,
body.roltec-tools-wide .moveit-planner__app {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 650px;
  height: calc(100vh - var(--rlt-tool-chrome));
  height: calc(100dvh - var(--rlt-tool-chrome));
  box-sizing: border-box;
}

body.roltec-tools-wide .sps-logic-simulator__toolbar,
body.roltec-tools-wide .gazebo-simulator__toolbar,
body.roltec-tools-wide .moveit-planner__toolbar {
  flex: 0 0 auto;
}

body.roltec-tools-wide .sps-logic-simulator__workspace,
body.roltec-tools-wide .gazebo-simulator__workspace,
body.roltec-tools-wide .moveit-planner__workspace {
  flex: 1 1 auto;
  min-height: 650px;
  height: auto;
  max-height: none;
}

/* Viewer canvases (toolbar / file controls above them) */
body.roltec-tools-wide .step-viewer-online__canvas-wrap,
body.roltec-tools-wide .s3d-compare__canvas-wrap,
body.roltec-tools-wide .pneumatik-simulator__canvas-wrap,
body.roltec-tools-wide .dxf-viewer-online__layout {
  width: 100%;
  min-height: 650px;
  height: calc(100vh - var(--rlt-tool-chrome-viewer));
  height: calc(100dvh - var(--rlt-tool-chrome-viewer));
  max-height: none;
  box-sizing: border-box;
}

body.roltec-tools-wide .dxf-viewer-online__canvas-wrap {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  box-sizing: border-box;
}

body.roltec-tools-wide .dxf-viewer-online__sidebar {
  max-height: none;
  height: 100%;
  overflow: auto;
}

body.roltec-tools-wide .gazebo-simulator__sidebar,
body.roltec-tools-wide .moveit-planner__sidebar {
  max-height: none;
  height: 100%;
  min-height: 0;
}

body.roltec-tools-wide .gazebo-simulator__viewer-area,
body.roltec-tools-wide .moveit-planner__viewer-area {
  min-height: 0;
  height: 100%;
}

body.roltec-tools-wide .gazebo-simulator__viewer3d,
body.roltec-tools-wide .moveit-planner__viewer3d,
body.roltec-tools-wide .robot-reach-calc__viewer3d {
  height: 100%;
  min-height: 420px;
}

body.roltec-tools-wide .robot-reach-calc__layout {
  min-height: 650px;
  height: calc(100vh - var(--rlt-tool-chrome-viewer));
  height: calc(100dvh - var(--rlt-tool-chrome-viewer));
}

body.roltec-tools-wide .robot-reach-calc__viewer-wrap {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

body.roltec-tools-wide .robot-reach-calc__viewer3d {
  flex: 1 1 auto;
}

/* Vollbild: hide site chrome, give tool the whole screen */
body.roltec-tools-fullscreen {
  overflow: hidden;
}

.schema-editor:fullscreen,
.schema-editor:-webkit-full-screen {
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 8px !important;
  box-sizing: border-box !important;
  background: #fff !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.schema-editor:fullscreen .schema-editor__form,
.schema-editor:-webkit-full-screen .schema-editor__form,
.schema-editor:fullscreen .schema-editor__workspace,
.schema-editor:-webkit-full-screen .schema-editor__workspace {
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
}

body.roltec-tools-fullscreen #header,
body.roltec-tools-fullscreen #breadcrumb,
body.roltec-tools-fullscreen .block_uslugi_title,
body.roltec-tools-fullscreen .img_top,
body.roltec-tools-fullscreen .section_desc .accordion,
body.roltec-tools-fullscreen .news-detail .accordion,
body.roltec-tools-fullscreen .rlt-tool-meta,
body.roltec-tools-fullscreen .rlt-tool-meta__stats,
body.roltec-tools-fullscreen .wissen-article-engagement,
body.roltec-tools-fullscreen .wissen-article-engagement--tools,
body.roltec-tools-fullscreen .link_back,
body.roltec-tools-fullscreen #footer_menu,
body.roltec-tools-fullscreen #footer_top,
body.roltec-tools-fullscreen #footer_bottom,
body.roltec-tools-fullscreen #footer_center,
body.roltec-tools-fullscreen #footer {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.schema-editor:fullscreen .rlt-tool-meta,
.schema-editor:fullscreen .rlt-tool-meta__stats,
.schema-editor:fullscreen .wissen-article-engagement,
.schema-editor:-webkit-full-screen .rlt-tool-meta,
.schema-editor:-webkit-full-screen .rlt-tool-meta__stats,
.schema-editor:-webkit-full-screen .wissen-article-engagement {
  display: none !important;
}

body.roltec-tools-fullscreen #wrapper {
  max-width: none;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
  box-sizing: border-box;
}

body.roltec-tools-fullscreen #main,
body.roltec-tools-fullscreen #content,
body.roltec-tools-fullscreen .section_desc,
body.roltec-tools-fullscreen .news-detail,
body.roltec-tools-fullscreen .rlt-tool-detail {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}

body.roltec-tools-fullscreen .sps-logic-simulator__app,
body.roltec-tools-fullscreen .gazebo-simulator__app,
body.roltec-tools-fullscreen .moveit-planner__app,
body.roltec-tools-fullscreen .step-viewer-online__canvas-wrap,
body.roltec-tools-fullscreen .dxf-viewer-online__layout,
body.roltec-tools-fullscreen .s3d-compare__canvas-wrap,
body.roltec-tools-fullscreen .pneumatik-simulator__canvas-wrap,
body.roltec-tools-fullscreen .robot-reach-calc__layout,
body.roltec-tools-fullscreen .tool-workspace--editor,
body.roltec-tools-fullscreen .rlt-workspace--editor {
  min-height: 0;
  height: calc(100vh - 16px);
  height: calc(100dvh - 16px);
}

body.roltec-tools-fullscreen .dxf-viewer-online__canvas-wrap {
  height: 100%;
  min-height: 0;
}

/*
 * Schema-Editor fullscreen: cover the viewport (fixed), so parent max-width /
 * accordion/meta leftovers cannot shrink the canvas.
 */
body.roltec-tools-fullscreen .schema-editor {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: none;
  margin: 0;
  padding: 8px;
  box-sizing: border-box;
  overflow: hidden;
  background: #fff;
}

body.roltec-tools-fullscreen .schema-editor__form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
}

body.roltec-tools-fullscreen .schema-editor__toolbar {
  flex: 0 0 auto;
}

body.roltec-tools-fullscreen .schema-editor__workspace {
  flex: 1 1 auto;
  min-height: 0;
  /* Must have a definite height — height:auto breaks grid 1fr → React Flow pane stays tiny */
  height: 100% !important;
  max-height: none;
  grid-template-columns: 300px minmax(0, 1fr) minmax(240px, 280px);
  grid-template-rows: minmax(0, 1fr) !important;
  overflow: hidden;
  width: 100%;
  max-width: none;
}

body.roltec-tools-fullscreen .schema-editor__palette {
  display: flex;
  flex-direction: column;
  width: 300px;
  min-width: 300px;
  max-width: 300px;
  min-height: 0;
  height: 100%;
  max-height: none;
  overflow: hidden;
}

body.roltec-tools-fullscreen .schema-editor__canvas-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: none;
  overflow: hidden;
}

body.roltec-tools-fullscreen .schema-editor__root {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  width: 100%;
}

body.roltec-tools-fullscreen .schema-editor__root > div {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  position: relative;
}

body.roltec-tools-fullscreen .schema-editor__flow-host {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  height: 100%;
}

/* React Flow pane fills the canvas host (absolute children need relative + definite size) */
body.roltec-tools-fullscreen .schema-editor__flow-host .react-flow,
body.roltec-tools-fullscreen .schema-editor .react-flow {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0;
}

body.roltec-tools-fullscreen .schema-editor .react-flow__renderer,
body.roltec-tools-fullscreen .schema-editor .react-flow__container,
body.roltec-tools-fullscreen .schema-editor .react-flow__pane {
  width: 100% !important;
  height: 100% !important;
}

body.roltec-tools-fullscreen .schema-editor .react-flow__container,
body.roltec-tools-fullscreen .schema-editor .react-flow__pane {
  position: absolute !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
}

body.roltec-tools-fullscreen .schema-editor__controls-bar,
body.roltec-tools-fullscreen #schemaEditorControls,
body.roltec-tools-fullscreen .schema-editor__zoom-group {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  flex: 0 0 auto;
  position: relative;
  z-index: 5;
}

body.roltec-tools-fullscreen .schema-editor__inspector {
  min-height: 0;
  height: 100%;
  max-height: none;
  overflow: auto;
}

@media (max-width: 960px) {
  body.roltec-tools-fullscreen .schema-editor__workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: auto;
  }

  body.roltec-tools-fullscreen .schema-editor__palette {
    width: 100%;
    min-width: 0;
    max-width: none;
    height: auto;
    max-height: 28vh;
  }

  body.roltec-tools-fullscreen .schema-editor__inspector {
    height: auto;
    max-height: 28vh;
  }
}

/* Hydraulikrohrnetze Vollbild */
body.roltec-tools-fullscreen .heizung-rohrnetz,
.heizung-rohrnetz:fullscreen,
.heizung-rohrnetz:-webkit-full-screen {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex !important;
  flex-direction: column;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: none;
  margin: 0;
  padding: 8px;
  box-sizing: border-box;
  overflow: hidden;
  background: #fff;
}

body.roltec-tools-fullscreen .heizung-rohrnetz > .accordion,
.heizung-rohrnetz:fullscreen > .accordion,
.heizung-rohrnetz:-webkit-full-screen > .accordion {
  display: none !important;
}

body.roltec-tools-fullscreen .heizung-rohrnetz__form {
  flex: 0 0 auto;
  width: 100%;
  margin: 0;
}

body.roltec-tools-fullscreen .heizung-rohrnetz__workspace,
.heizung-rohrnetz:fullscreen .heizung-rohrnetz__workspace,
.heizung-rohrnetz:-webkit-full-screen .heizung-rohrnetz__workspace {
  flex: 1 1 auto;
  min-height: 0;
  height: 100% !important;
  max-height: none;
  margin: 0.5rem 0 0;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  overflow: hidden;
  width: 100%;
}

body.roltec-tools-fullscreen .heizung-rohrnetz__schematic-wrap,
body.roltec-tools-fullscreen .heizung-rohrnetz__schematic-wrap[hidden] {
  display: flex !important;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  margin: 0;
  overflow: hidden;
}

body.roltec-tools-fullscreen .heizung-rohrnetz__schematic {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: auto;
}

body.roltec-tools-fullscreen .heizung-rohrnetz__result {
  flex: 0 1 30%;
  min-height: 0;
  max-height: 30vh;
  overflow: auto;
  margin: 0.5rem 0 0;
}

@media (max-width: 860px) {
  body.roltec-tools-fullscreen .heizung-rohrnetz__workspace {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    overflow: auto;
  }
}

.rlt-tool-fs-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  padding: 0.35rem 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  background: #fff;
  color: #1f2933;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
}

/* Schema-Editor: Vollbild sits in the bottom zoom row */
.schema-editor__zoom-group .rlt-tool-fs-btn.schema-editor__zoom-btn {
  margin-left: 0;
  min-width: auto;
  padding: 0 0.65rem;
  border: none;
  border-right: 1px solid var(--se-border, #d8dee6);
  border-radius: 0;
  box-shadow: none;
  background: #fff;
  color: #1f2937;
  font-size: 0.92rem;
  font-weight: 600;
}

.schema-editor__zoom-group .rlt-tool-fs-btn.schema-editor__zoom-btn:last-child {
  border-right: none;
}

.schema-editor__zoom-group .rlt-tool-fs-btn.schema-editor__zoom-btn:hover,
.schema-editor__zoom-group
  .rlt-tool-fs-btn.schema-editor__zoom-btn:focus-visible {
  background: #eef5fb;
  color: #1a6fb5;
  border-color: var(--se-border, #d8dee6);
  outline: none;
}

.schema-editor__zoom-group
  .rlt-tool-fs-btn.schema-editor__zoom-btn[aria-pressed="true"] {
  background: #e8f5e9;
}

.rlt-tool-fs-btn:hover,
.rlt-tool-fs-btn:focus-visible {
  border-color: #086860;
  color: #086860;
  outline: none;
}

.sps-logic-simulator__toolbar .rlt-tool-fs-btn,
.gazebo-simulator__toolbar .rlt-tool-fs-btn,
.moveit-planner__toolbar .rlt-tool-fs-btn {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
}

.sps-logic-simulator__toolbar .rlt-tool-fs-btn:hover,
.gazebo-simulator__toolbar .rlt-tool-fs-btn:hover,
.moveit-planner__toolbar .rlt-tool-fs-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.55);
  color: inherit;
}

.rlt-tool-fs-bar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 0.5rem;
}

/* --- /tools/: free header / menu / content from 1130px --- */
body.roltec-tools #wrapper,
body.roltec-tools #header_top_main,
body.roltec-tools #header_main,
body.roltec-tools #footer_menu_main,
body.roltec-tools #footer_top_main,
body.roltec-tools #footer_bottom_main,
body.roltec-tools #footer_center_main {
  max-width: none;
  width: 100%;
  box-sizing: border-box;
}

body.roltec-tools #wrapper {
  padding-top: 0;
  padding-bottom: 12px;
  padding-left: 16px;
  padding-right: 16px;
}

/* Хлебные крошки: убрать большую пустоту сверху/снизу */
body.roltec-tools #breadcrumb {
  margin: 0;
  padding: 8px 0;
}

body.roltec-tools #header_top_main,
body.roltec-tools #header_main {
  padding-left: 16px;
  padding-right: 16px;
}

@media (min-width: 769px) {
  body.roltec-tools #header_main {
    display: flex;
    align-items: center;
  }

  body.roltec-tools #header_text {
    float: none;
    flex: 0 1 auto;
    order: 2;
    margin: 0 0 0 12px;
    padding: 0 16px 0 0;
    white-space: nowrap;
  }

  body.roltec-tools #header_zayavka {
    float: none;
    flex: 0 0 auto;
    order: 3;
    margin: 0 12px 0 auto;
  }

  body.roltec-tools #header_contact {
    float: none;
    flex: 0 0 auto;
    order: 4;
    margin: 0;
  }

  body.roltec-tools #header_logo {
    float: none;
    flex: 0 0 auto;
    margin-top: 0;
    order: 1;
  }
}

body.roltec-tools #header .top-menu-desktop-sandwich {
  max-width: none;
  width: 100%;
  padding-left: 16px;
  padding-right: 16px;
  box-sizing: border-box;
}

/* /tools/ ПК: скрыть текст MENU у сендвич-меню */
@media (min-width: 769px) {
  body.roltec-tools:not(.roltec-compact-viewport)
    #header
    .top-menu-desktop-sandwich
    .hdmname {
    display: none !important;
  }
}

body.roltec-tools #content {
  overflow: visible;
}

body.roltec-tools-wide #content {
  overflow: visible;
}

body.roltec-tools-wide .section_desc > .rlt-section,
body.roltec-tools-wide .section_desc > .rlt-tool-page,
body.roltec-tools-wide .news-detail > .rlt-section,
body.roltec-tools-wide .news-detail > .rlt-tool-page {
  max-width: none;
  width: 100%;
  padding-left: 0;
  padding-right: 0;
}

/* text column: title, FAQ/accordion, Bitrix editor prose → ~1850px */
body.roltec-tools #breadcrumb,
body.roltec-tools .block_uslugi_title,
body.roltec-tools .link_back,
body.roltec-tools .rlt-text,
body.roltec-tools .h2-section,
body.roltec-tools .mygallery,
body.roltec-tools .img_top,
body.roltec-tools .section_desc .accordion,
body.roltec-tools .news-detail .accordion,
body.roltec-tools .section_desc > p,
body.roltec-tools .section_desc > h2,
body.roltec-tools .section_desc > h3,
body.roltec-tools .section_desc > h4,
body.roltec-tools .section_desc > ul,
body.roltec-tools .section_desc > ol,
body.roltec-tools .section_desc > table,
body.roltec-tools .section_desc > div:not([class]),
body.roltec-tools .news-detail > p,
body.roltec-tools .news-detail > h2,
body.roltec-tools .news-detail > h3,
body.roltec-tools .news-detail > h4,
body.roltec-tools .news-detail > ul,
body.roltec-tools .news-detail > ol,
body.roltec-tools .news-detail > table,
body.roltec-tools .news-detail > div:not([class]),
body.roltec-tools .section_desc > .rlt-section > p,
body.roltec-tools .section_desc > .rlt-section > h2,
body.roltec-tools .section_desc > .rlt-section > h3,
body.roltec-tools .section_desc > .rlt-section > h4,
body.roltec-tools .section_desc > .rlt-section > ul,
body.roltec-tools .section_desc > .rlt-section > ol,
body.roltec-tools .section_desc > .rlt-section > table,
body.roltec-tools .section_desc > .rlt-section > div:not([class]),
body.roltec-tools .section_desc > .rlt-tool-page > p,
body.roltec-tools .section_desc > .rlt-tool-page > h2,
body.roltec-tools .section_desc > .rlt-tool-page > h3,
body.roltec-tools .section_desc > .rlt-tool-page > h4,
body.roltec-tools .section_desc > .rlt-tool-page > ul,
body.roltec-tools .section_desc > .rlt-tool-page > ol,
body.roltec-tools .section_desc > .rlt-tool-page > table,
body.roltec-tools .section_desc > .rlt-tool-page > div:not([class]),
body.roltec-tools .section_desc > [class*="-page"] > p,
body.roltec-tools .section_desc > [class*="-page"] > h2,
body.roltec-tools .section_desc > [class*="-page"] > h3,
body.roltec-tools .section_desc > [class*="-page"] > h4,
body.roltec-tools .section_desc > [class*="-page"] > ul,
body.roltec-tools .section_desc > [class*="-page"] > ol,
body.roltec-tools .section_desc > [class*="-page"] > table,
body.roltec-tools .section_desc > [class*="-page"] > div:not([class]),
body.roltec-tools .news-detail > .rlt-section > p,
body.roltec-tools .news-detail > .rlt-section > h2,
body.roltec-tools .news-detail > .rlt-section > h3,
body.roltec-tools .news-detail > .rlt-section > h4,
body.roltec-tools .news-detail > .rlt-section > ul,
body.roltec-tools .news-detail > .rlt-section > ol,
body.roltec-tools .news-detail > .rlt-section > table,
body.roltec-tools .news-detail > .rlt-section > div:not([class]),
body.roltec-tools .news-detail > .rlt-tool-page > p,
body.roltec-tools .news-detail > .rlt-tool-page > h2,
body.roltec-tools .news-detail > .rlt-tool-page > h3,
body.roltec-tools .news-detail > .rlt-tool-page > h4,
body.roltec-tools .news-detail > .rlt-tool-page > ul,
body.roltec-tools .news-detail > .rlt-tool-page > ol,
body.roltec-tools .news-detail > .rlt-tool-page > table,
body.roltec-tools .news-detail > .rlt-tool-page > div:not([class]),
body.roltec-tools .news-detail > [class*="-page"] > p,
body.roltec-tools .news-detail > [class*="-page"] > h2,
body.roltec-tools .news-detail > [class*="-page"] > h3,
body.roltec-tools .news-detail > [class*="-page"] > h4,
body.roltec-tools .news-detail > [class*="-page"] > ul,
body.roltec-tools .news-detail > [class*="-page"] > ol,
body.roltec-tools .news-detail > [class*="-page"] > table,
body.roltec-tools .news-detail > [class*="-page"] > div:not([class]) {
  max-width: var(--rlt-tools-prose);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

/* bare editor <img> next to tool root: same left edge as prose column */
body.roltec-tools .section_desc > img,
body.roltec-tools .news-detail > img,
body.roltec-tools .section_desc > .rlt-section > img,
body.roltec-tools .section_desc > .rlt-tool-page > img,
body.roltec-tools .section_desc > [class*="-page"] > img,
body.roltec-tools .news-detail > .rlt-section > img,
body.roltec-tools .news-detail > .rlt-tool-page > img,
body.roltec-tools .news-detail > [class*="-page"] > img {
  display: block;
  width: auto;
  max-width: min(100%, var(--rlt-tools-prose));
  height: auto;
  margin-left: max(0px, calc((100% - min(var(--rlt-tools-prose), 100%)) / 2));
  margin-right: auto;
}

/* images inside narrow prose stay left-aligned in that column */
body.roltec-tools-wide .section_desc > p > img,
body.roltec-tools-wide .news-detail > p > img,
body.roltec-tools-wide .section_desc > .rlt-section > p > img,
body.roltec-tools-wide .section_desc > .rlt-tool-page > p > img,
body.roltec-tools-wide .section_desc > [class*="-page"] > p > img,
body.roltec-tools-wide .news-detail > .rlt-section > p > img,
body.roltec-tools-wide .news-detail > .rlt-tool-page > p > img,
body.roltec-tools-wide .news-detail > [class*="-page"] > p > img,
body.roltec-tools-wide .section_desc > div:not([class]) > img,
body.roltec-tools-wide .news-detail > div:not([class]) > img,
body.roltec-tools-wide .section_desc > .rlt-section > div:not([class]) > img,
body.roltec-tools-wide .section_desc > .rlt-tool-page > div:not([class]) > img,
body.roltec-tools-wide
  .section_desc
  > [class*="-page"]
  > div:not([class])
  > img,
body.roltec-tools-wide .news-detail > .rlt-section > div:not([class]) > img,
body.roltec-tools-wide .news-detail > .rlt-tool-page > div:not([class]) > img,
body.roltec-tools-wide .news-detail > [class*="-page"] > div:not([class]) > img,
body.roltec-tools-wide .section_desc .accordion img,
body.roltec-tools-wide .news-detail .accordion img,
body.roltec-tools-wide .rlt-text img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin-left: 0;
  margin-right: auto;
  float: none;
}

/* interactive zones → full available width (never constrain __app / forms) */
body.roltec-tools-wide .rlt-workspace,
body.roltec-tools-wide [class*="__workspace"],
body.roltec-tools-wide [class*="__canvas-wrap"],
body.roltec-tools-wide [class*="__layout"],
body.roltec-tools-wide [class*="__app"],
body.roltec-tools-wide .section_desc > .rlt-section > form,
body.roltec-tools-wide .section_desc > .rlt-tool-page > form,
body.roltec-tools-wide .section_desc > [class*="-page"] > form,
body.roltec-tools-wide .news-detail > .rlt-section > form,
body.roltec-tools-wide .news-detail > .rlt-tool-page > form,
body.roltec-tools-wide .news-detail > [class*="-page"] > form,
body.roltec-tools-wide .drawing-compare__form,
body.roltec-tools-wide .s3d-compare__form {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  box-sizing: border-box;
}

/* tool-specific caps that fight full-width workspace */
body.roltec-tools-wide .sps-logic-simulator__canvas {
  max-width: none;
}
