:root{--pbs-context-button-padding-inline:7px;--pbs-main-button-font-weight:700;
  --gap:8px;
  --button-h:36px;
  --header-h:88px;
  --border:#9ca3af;
  --orange:#fed7aa;
  --orange-hover:#ffedd5;
  --black:#050505;
  --blue:#1557a5;
  --blue-hover:#0f4688;
  --blue-surface:#f3f8ff;
  --yellow:#6d28d9;
  --yellow-hover:#5b21b6;
  --yellow-surface:#faf7ff;
  --red:#c2410c;
  --red-hover:#9a3412;
  --red-surface:#fff8f2;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;background:#fff;color:#111}
body{overflow:hidden}
.pbs-shell{height:var(--header-h);position:relative;z-index:50;border-bottom:1px solid #222;background:#fff;display:flex;overflow:visible}
.control-panel{width:50%;min-width:0;padding:5px 8px;display:grid;grid-template-rows:36px 36px;gap:6px;overflow:hidden;background:var(--black);color:#fff}
.identity-row{display:grid;grid-template-columns:auto minmax(120px,1fr) auto;align-items:center;gap:8px;min-width:0}
.brand{text-align:center;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#fff}
.project-number{font-weight:600;white-space:nowrap;color:#fff;font-size:14.5px}
.shell-btn,.mode-btn{height:var(--button-h);min-height:var(--button-h);max-height:var(--button-h);min-width:0;border:1px solid rgba(0,0,0,.35);border-radius:4px;padding:0 9px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-sizing:border-box}
.shell-btn{font-weight:var(--pbs-main-button-font-weight,700)}
.shell-btn:focus-visible,.mode-btn:focus-visible,.context-btn:focus-visible,.drop-control:focus-visible{outline:3px solid #60a5fa;outline-offset:2px}
.shell-btn:disabled{opacity:.45;cursor:not-allowed}
.save-btn{background:#fff;color:#111;border-color:#d1d5db}
.save-btn:hover{background:#f3f4f6}
.save-btn:active{background:#e5e7eb}
.btn-icon{width:16px;height:16px;flex:0 0 16px;display:inline-block;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.mode-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;min-width:0;overflow:hidden}
.mode-btn{background:#3f3f46;color:#fff;border-color:#606067}
.mode-btn:hover{background:#52525b}
.mode-btn[data-mode="rooms-openings"].active{background:var(--blue);border-color:var(--blue);color:#fff}
.mode-btn[data-mode="rooms-openings"].active:hover{background:var(--blue-hover)}
.mode-btn[data-mode="boundaries"].active{background:#c59b00;border-color:#c59b00;color:#fff}
.mode-btn[data-mode="boundaries"].active:hover{background:#a98200}
.mode-btn[data-mode="fire-hazard"].active{background:var(--yellow);border-color:var(--yellow);color:#fff}
.mode-btn[data-mode="fire-hazard"].active:hover{background:var(--yellow-hover)}
.mode-btn[data-mode="fire-compartments"].active{background:var(--red);border-color:var(--red);color:#fff}
.mode-btn[data-mode="fire-compartments"].active:hover{background:var(--red-hover)}
.drop-control{position:absolute;right:0;top:0;height:var(--header-h);width:50%;border-left:1px solid var(--border);background:var(--orange);cursor:pointer;transition:width .18s ease,background .18s ease,box-shadow .18s ease;overflow:hidden;z-index:55}
.drop-control.loaded{width:var(--header-h);background:#fff;border:1px solid var(--border)}
.drop-control.loaded.expanded{width:50%;box-shadow:-8px 4px 20px rgba(0,0,0,.2)}
.drop-control.drag-active{width:50%;background:var(--orange-hover);border:3px dashed #f97316;box-shadow:-8px 4px 20px rgba(0,0,0,.2)}
.drop-inner{height:100%;display:flex;align-items:center;justify-content:center;gap:10px;padding:8px;white-space:nowrap}
.drop-icon{font-size:28px;font-weight:700;flex:0 0 auto}
.drop-copy{display:flex;flex-direction:column;min-width:0}
.drop-copy small{margin-top:4px;overflow:hidden;text-overflow:ellipsis}
.loaded:not(.expanded):not(.drag-active) .drop-copy{display:none}
.context-toolbar{height:42px;padding:5px 8px;display:flex;align-items:center;gap:8px;border-bottom:1px solid #cbd5e1;position:relative;z-index:20;transition:background-color .15s ease}
body.mode-rooms-openings .context-toolbar{background:var(--blue-surface)}
body.mode-boundaries .context-toolbar{background:#fff4b8}
body.mode-fire-hazard .context-toolbar{background:var(--yellow-surface)}
body.mode-fire-compartments .context-toolbar{background:var(--red-surface)}
/* Context controls intentionally retain the exact legacy button geometry. */
.context-btn{height:32px;min-height:32px;max-height:32px;border:none;border-radius:4px;cursor:pointer;transition:background .1s;display:inline-flex;align-items:center;gap:5px;padding:0 var(--pbs-context-button-padding-inline);white-space:nowrap;box-sizing:border-box}
.context-btn .btn-icon{width:16px!important;height:16px!important;flex:0 0 16px!important}
.context-btn.openings{background:#3b82f6;color:#fff}
.context-btn.openings:hover{background:#2563eb;color:#fff}
.context-btn.hazard{background:#8b5cf6!important;color:#fff!important}
.context-btn.hazard:hover{background:#7c3aed!important;color:#fff!important}
.context-btn.compartment-gray,.context-btn.compartment-toggle{height:32px;min-height:32px;max-height:32px;padding:0 var(--pbs-context-button-padding-inline);gap:6px;box-sizing:border-box}
.context-btn.compartment-gray{background:#f97316;color:#fff;border:1px solid #ea580c}
.context-btn.compartment-gray:hover{background:#ea580c}
.context-btn.compartment-toggle{background:#f97316;color:#fff;border:1px solid #ea580c}
.context-btn.compartment-toggle:hover{background:#ea580c;color:#fff}
.context-checkmark{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;min-width:16px;background:#fff;border:1px solid #64748b;border-radius:3px;color:#0f2a05;}
.workspace{height:calc(100vh - var(--header-h) - 42px);position:relative;transition:background-color .15s ease;padding:8px}
body.mode-rooms-openings .workspace{background:var(--blue-surface)}
body.mode-boundaries .workspace{background:#fff4b8}
body.mode-fire-hazard .workspace{background:var(--yellow-surface)}
body.mode-fire-compartments .workspace{background:var(--red-surface)}
.module-frame{position:absolute;inset:8px;width:calc(100% - 16px);height:calc(100% - 16px);border:0;background:transparent;display:none}
.module-frame.active{display:block}
.toast{position:fixed;right:16px;bottom:16px;z-index:100;padding:10px 14px;background:#111827;color:#fff;border-radius:6px;opacity:0;pointer-events:none;transform:translateY(8px);transition:.2s}
.toast.show{opacity:1;transform:none}
@media(max-width:850px){:root{--pbs-main-button-font-weight:700;--header-h:88px;--button-h:36px}.control-panel{width:calc(100% - var(--header-h))}.identity-row{grid-template-columns:auto 1fr}.brand{text-align:center}.project-number{grid-column:2;text-align:right;font-size:12px}.drop-control.empty,.drop-control.loaded.expanded,.drop-control.drag-active{width:70%}.save-btn span{display:none}.context-toolbar{overflow-x:auto}}
@media(prefers-reduced-motion:reduce){.drop-control,.toast,.context-toolbar,.workspace{transition:none}}

/* v1.0.3 visual containment and hierarchy */
.identity-row > *{min-width:0}
.save-btn{flex-shrink:0}
.brand{font-size:14px}
.project-number{font-size:14.5px;overflow:hidden;text-overflow:ellipsis}
.mode-btn{width:100%;max-width:100%}
@media(max-width:1100px){.mode-btn{padding-inline:6px}.brand{font-size:13px}.project-number{font-size:14.5px}.save-btn{padding-inline:8px}}

/* v1.0.7: contextual controls use one foreground color in every mode. */
.context-btn,
.context-btn:hover,
.context-btn:active,
.context-btn:focus-visible,
.context-btn.compartment-toggle,
.context-btn.compartment-toggle:hover { color:#ffffff !important; }
.context-btn .context-checkmark {
  color:#ffffff !important;
  border-color:#ffffff !important;
  background:transparent !important;
}
.context-btn .context-checkmark.checked::after {
  content:'✓';
  
  
  
}

/* v1.0.16 mode surfaces match the corresponding table-row surfaces. */
:root{--pbs-main-button-font-weight:700;
  --blue-surface:rgb(192,225,255);
  --yellow-surface:#ede9fe;
  --red-surface:#ffedd5;
}


/* Editable project number keeps the header geometry unchanged. */
.project-number{cursor:text;display:flex;align-items:center;justify-content:flex-end;gap:4px;min-width:92px}
.project-number-input{width:42px;height:26px;margin:0;padding:1px 4px;border:1px solid #93c5fd;border-radius:3px;background:#fff;color:#111;font:600 14.5px/1 'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;text-align:center;outline:none}
.project-number-input:focus{border-color:#60a5fa;box-shadow:0 0 0 2px rgba(96,165,250,.35)}

/* v1.0.58: Obvody contextual control follows the yellow mode palette. */
body.mode-boundaries .context-btn.compartment-toggle {
  background:#c59b00 !important;
  border-color:#a98200 !important;
  color:#ffffff !important;
}
body.mode-boundaries .context-btn.compartment-toggle:hover {
  background:#a98200 !important;
  border-color:#8a6d00 !important;
  color:#ffffff !important;
}

/* v1.0.59: Obvody generation action uses the mode yellow. */
body.mode-boundaries .context-btn.boundary-action{background:#c59b00!important;border:1px solid #a98200!important;color:#fff!important}
body.mode-boundaries .context-btn.boundary-action:hover{background:#a98200!important;border-color:#8a6d00!important}

/* v1.0.64: three-column top control table with overlaying drop tile. */
:root{--pbs-main-button-font-weight:700;--header-h:88px;--header-square:88px}
.pbs-shell{height:var(--header-h);display:block;position:relative;overflow:visible;background:#fff}
.header-base{height:100%;display:grid;grid-template-columns:var(--header-square) minmax(0,1fr) var(--header-square);background:#fff}
.control-panel{width:auto;height:100%;padding:5px 8px;display:grid;grid-template-rows:36px 36px;gap:6px;overflow:hidden;background:var(--black);color:#fff}
.identity-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;min-width:0}
.brand{text-align:left;padding-left:4px}
.save-tile{width:var(--header-square)!important;height:var(--header-square)!important;min-width:var(--header-square)!important;max-width:var(--header-square)!important;min-height:var(--header-square)!important;max-height:var(--header-square)!important;border-radius:0!important;border:1px solid var(--border)!important;background:#fff!important;color:#111!important;padding:0!important}
.save-tile .btn-icon{width:42px!important;height:42px!important;flex:0 0 42px!important;stroke-width:1.7!important}
.save-tile:hover:not(:disabled){background:#f3f4f6!important}.save-tile:active:not(:disabled){background:#e5e7eb!important}
.drop-tile-placeholder{width:var(--header-square);height:var(--header-square);background:#fff;border-left:1px solid var(--border)}
.drop-control{top:0;right:0;width:var(--header-square);height:var(--header-square);border:1px solid var(--border);border-radius:0;transition:width .18s ease,background .18s ease,box-shadow .18s ease;z-index:60}
.drop-control.empty{background:var(--orange)}
.drop-control.loaded{width:var(--header-square);height:var(--header-square);background:#fff}
.drop-control.expanded,.drop-control.loaded.expanded,.drop-control.empty.expanded,.drop-control.drag-active{width:75%;box-shadow:-8px 4px 20px rgba(0,0,0,.22)}
.drop-control.drag-active{background:var(--orange-hover);border:3px dashed #f97316}
.drop-control:not(.expanded):not(.drag-active) .drop-copy{display:none}
.drop-control:not(.expanded):not(.drag-active) .drop-icon{font-size:34px}
.mode-row{grid-template-columns:repeat(var(--mode-count,4),minmax(0,1fr))}
@media(max-width:850px){.header-base{grid-template-columns:var(--header-square) minmax(0,1fr) var(--header-square)}.control-panel{width:auto}.drop-control.expanded,.drop-control.loaded.expanded,.drop-control.empty.expanded,.drop-control.drag-active{width:82%}.save-tile{display:flex}.identity-row{grid-template-columns:minmax(0,1fr) auto}.project-number{grid-column:auto}.brand{text-align:left}}
/* Mode buttons share the middle-row width equally for any button count. */
.mode-row{grid-template-columns:none!important;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr)}
/* v1.0.64: Openings quantity-display toggle follows the blue mode palette. */
body.mode-rooms-openings .context-btn.openings-toggle{background:#3b82f6!important;border:1px solid #2563eb!important;color:#fff!important}
body.mode-rooms-openings .context-btn.openings-toggle:hover{background:#2563eb!important}

/* v1.0.77 */
.icon-btn:disabled,button:disabled,[aria-disabled="true"]{pointer-events:auto!important}


/* v1.0.77: inset rounded save/drop tiles. */
.save-tile,
.save-tile:hover:not(:disabled),
.save-tile:active:not(:disabled){
  background:#050505!important;
  color:#fff!important;
  border:0!important;
  border-radius:0!important;
}
.save-tile .save-icon{
  width:44px!important;
  height:44px!important;
  flex:0 0 44px!important;
  stroke:currentColor!important;
  stroke-width:1.8!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
  fill:none!important;
}
.drop-tile-placeholder{
  background:#050505!important;
  border-left:0!important;
}
.drop-control,
.drop-control.empty,
.drop-control.loaded,
.drop-control.expanded,
.drop-control.loaded.expanded,
.drop-control.empty.expanded,
.drop-control.drag-active{
  background:#050505!important;
  border:0!important;
  border-radius:0!important;
  padding:6px!important;
  overflow:hidden!important;
}
.drop-control .drop-inner{
  width:100%;
  height:100%;
  padding:8px;
  border:2px dashed #f97316;
  border-radius:11px;
  background:var(--orange);
  transition:background .18s ease,border-color .18s ease;
  overflow:hidden;
}
.drop-control.loaded:not(.expanded):not(.drag-active) .drop-inner{
  border-color:#fff;
  background:#9ca3af;
}
.drop-control.empty:not(.expanded):not(.drag-active) .drop-inner{
  border-color:#f97316;
  background:var(--orange);
}
.drop-control.expanded .drop-inner,
.drop-control.loaded.expanded .drop-inner,
.drop-control.empty.expanded .drop-inner{
  border-color:#f97316;
  background:var(--orange);
}
.drop-control.drag-active .drop-inner{
  border-color:#f97316;
  background:var(--orange-hover);
}
.drop-icon{
  width:40px;
  height:40px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 40px;
  color:#7c2d12;
}
.drop-icon svg{
  width:100%;
  height:100%;
  fill:none;
  stroke:currentColor;
  stroke-width:2.2;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.drop-control.loaded:not(.expanded):not(.drag-active) .drop-icon{color:#fff}
.drop-control:not(.expanded):not(.drag-active) .drop-icon{font-size:0}
.drop-control.expanded .drop-icon,.drop-control.drag-active .drop-icon{width:34px;height:34px;flex-basis:34px}


/* v1.0.77: balanced header spacing and clearer save/drop symbols. */
.header-base{
  gap:6px!important;
  background:#050505!important;
}
.save-tile{
  margin:0!important;
  padding:6px!important;
}
.save-tile .save-icon{
  width:42px!important;
  height:42px!important;
  flex-basis:42px!important;
  stroke-width:1.9!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
}
.drop-control{
  right:0!important;
  padding:6px!important;
}
.drop-icon{position:relative}
.drop-icon .drop-loaded-icon{display:none}
.drop-control.loaded .drop-icon .drop-upload-icon{display:none}
.drop-control.loaded .drop-icon .drop-loaded-icon{display:block}
.drop-control.loaded.expanded .drop-inner{
  border-color:#fff;
  background:#9ca3af;
}
.drop-control.loaded.expanded .drop-icon{color:#fff}


/* v1.0.77: exact outer-tile geometry and classic floppy icon. */
.header-base{
  gap:0!important;
  grid-template-columns:var(--header-square) minmax(0,1fr) var(--header-square)!important;
}
.control-panel{
  padding:5px 0!important;
}
.identity-row{
  padding-left:0!important;
  padding-right:0!important;
}
.brand{
  padding-left:0!important;
}
.project-number{
  margin-right:0!important;
  padding-right:0!important;
  justify-self:end!important;
}
.mode-row{
  margin-left:0!important;
  margin-right:0!important;
}
.mode-row .mode-btn:first-child{margin-left:0!important}
.mode-row .mode-btn:last-child{margin-right:0!important}
.save-tile{
  width:var(--header-square)!important;
  height:var(--header-square)!important;
  min-width:var(--header-square)!important;
  max-width:var(--header-square)!important;
  min-height:var(--header-square)!important;
  max-height:var(--header-square)!important;
  padding:6px!important;
}
.save-tile .save-icon{
  width:46px!important;
  height:46px!important;
  flex:0 0 46px!important;
  stroke-width:1.75!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
}
.drop-tile-placeholder,
.drop-control{
  width:var(--header-square)!important;
  height:var(--header-square)!important;
  min-width:var(--header-square)!important;
  min-height:var(--header-square)!important;
}
.drop-control{padding:6px!important}
.drop-control.expanded,
.drop-control.loaded.expanded,
.drop-control.empty.expanded,
.drop-control.drag-active{
  width:75%!important;
}


/* v1.0.80: five-cell centered identity row. */
.identity-row{
  --identity-logo-width:clamp(170px,22vw,220px);
  --identity-pbs-width:48px;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) var(--identity-pbs-width) var(--identity-logo-width) var(--identity-pbs-width) minmax(0,1fr)!important;
  align-items:center!important;
  column-gap:0!important;
  width:100%;
  min-width:0;
  height:36px;
  padding:0!important;
  overflow:hidden;
}
.identity-flex-left,.identity-balance{min-width:0;height:100%}
.identity-logo-cell{
  width:var(--identity-logo-width);
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.identity-logo{
  display:block;
  width:100%;
  height:auto;
  max-height:31px;
  object-fit:contain;
  object-position:center;
}
.identity-pbs{
  width:var(--identity-pbs-width);
  min-width:var(--identity-pbs-width);
  height:100%;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  padding-left:5px;
  color:#fff;
  font-weight:700;
  font-size:18px;
  white-space:nowrap;
}
.identity-row .project-number{
  width:100%;
  min-width:0;
  height:100%;
  margin:0!important;
  padding:0!important;
  display:flex;
  align-items:center;
  justify-content:flex-end!important;
  justify-self:stretch!important;
  white-space:nowrap;
  overflow:visible;
}
.identity-row .project-number-input{flex:0 0 42px}
@media(max-width:760px){
  .identity-row{--identity-logo-width:150px;--identity-pbs-width:42px}
  .identity-logo{max-height:27px}
}

/* v1.0.89: Facade mode uses an unused teal palette. */
:root{--pbs-main-button-font-weight:700;--facade:#0f766e;--facade-hover:#115e59;--facade-surface:#ccfbf1}
.mode-btn[data-mode="facade"].active{background:var(--facade);border-color:var(--facade);color:#fff}
.mode-btn[data-mode="facade"].active:hover{background:var(--facade-hover)}
body.mode-facade .context-toolbar{background:var(--facade-surface)}
body.mode-facade .workspace{background:var(--facade-surface)}
body.mode-facade .context-btn.facade-action,body.mode-facade .context-btn.facade-toggle{background:var(--facade)!important;border:1px solid var(--facade-hover)!important;color:#fff!important}
body.mode-facade .context-btn.facade-action:hover,body.mode-facade .context-btn.facade-toggle:hover{background:var(--facade-hover)!important}


/* v1.3.37: contact address in the first identity-row cell. */
.identity-flex-left{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  padding-left:8px!important;
  overflow:hidden!important;
}
.identity-email{
  display:block;
  width:100%;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#fff;
  font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;
  font-size:12px;
  font-weight:400;
  line-height:1.35;
  padding-bottom:1px;
  text-align:left;
  box-sizing:border-box;
}
@media(max-width:900px){
  .identity-email{font-size:11px}
}

/* v1.3.39: exact symmetric identity-row edge alignment. */
.identity-row{
  --identity-outer-width:minmax(0,1fr);
  grid-template-columns:var(--identity-outer-width) var(--identity-pbs-width) var(--identity-logo-width) var(--identity-pbs-width) var(--identity-outer-width)!important;
}
.identity-flex-left{
  width:100%!important;
  min-width:0!important;
  padding-left:0!important;
  padding-right:0!important;
  margin:0!important;
  justify-self:stretch!important;
}
.identity-email{
  margin:0!important;
  padding-left:0!important;
  padding-right:0!important;
  text-align:left!important;
}
.identity-row .project-number{
  width:100%!important;
  min-width:0!important;
  margin:0!important;
  padding-left:0!important;
  padding-right:0!important;
  justify-self:stretch!important;
  justify-content:flex-end!important;
  text-align:right!important;
}

/* v1.3.42: clickable identity email keeps existing alignment and typography. */
.identity-email:link,
.identity-email:visited {
  color:#fff!important;
  text-decoration:none!important;
}
.identity-email:hover,
.identity-email:focus-visible {
  color:#fff!important;
  text-decoration:underline!important;
  text-underline-offset:2px;
}

/* v1.3.42: only the visible email text is interactive. */
.identity-email{
  display:inline-block!important;
  width:auto!important;
  max-width:100%!important;
  flex:0 1 auto!important;
  align-self:center!important;
}


/* v1.3.65: save menu with DBF/ZIP options. */
.save-control-wrap{position:relative;width:var(--header-square);height:var(--header-square);z-index:85}
.save-control-wrap .save-tile{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:1px!important;line-height:1!important}
.save-tile .save-label,.save-menu-btn .save-label{display:block!important;font-size:11px!important;font-weight:700!important;line-height:12px!important;letter-spacing:.01em!important;color:currentColor!important;text-align:center!important;white-space:nowrap!important}
.save-control-wrap .save-tile .save-icon{width:38px!important;height:38px!important;flex:0 0 38px!important}
.save-menu{position:absolute;left:0;top:var(--header-square);width:var(--header-square);height:calc(var(--header-square) * 2);background:#050505;border:0;box-shadow:0 8px 18px rgba(0,0,0,.28);z-index:100;display:grid;grid-template-rows:1fr 1fr;padding:0}
.save-menu[hidden]{display:none!important}
.save-menu-btn{width:var(--header-square);height:var(--header-square);border:1px solid #1f2937;border-top:0;background:#050505;color:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;padding:6px;cursor:pointer}
.save-menu-btn:hover{background:#111827}.save-menu-btn:active{background:#1f2937}
.save-menu-btn .save-icon{width:38px!important;height:38px!important;flex:0 0 38px!important;stroke:currentColor!important;stroke-width:1.75!important;stroke-linecap:round!important;stroke-linejoin:round!important;fill:none!important}

/* v1.3.66: rounded save tile with hover/click DBF-ZIP flyout. */
:root{--pbs-main-button-font-weight:700;
  --saveFadeGray:#404040;
  --saveInnerRadius:11px;
}
.save-control-wrap{
  position:relative!important;
  width:var(--header-square)!important;
  height:var(--header-square)!important;
  padding:6px!important;
  box-sizing:border-box!important;
  background:#050505!important;
  overflow:visible!important;
  z-index:120!important;
}
.save-control-wrap .save-tile,
.save-control-wrap .save-tile:hover:not(:disabled),
.save-control-wrap .save-tile:active:not(:disabled){
  width:100%!important;
  height:100%!important;
  min-width:0!important;
  max-width:none!important;
  min-height:0!important;
  max-height:none!important;
  border:1px solid #fff!important;
  border-radius:var(--saveInnerRadius)!important;
  background:#050505!important;
  color:#fff!important;
  box-sizing:border-box!important;
  transition:color .14s ease,border-color .14s ease,background-color .14s ease,opacity .14s ease!important;
}
.save-control-wrap .save-tile .save-icon{
  width:38px!important;
  height:38px!important;
  flex:0 0 38px!important;
}
.save-control-wrap:hover .save-tile:not(:disabled),
.save-control-wrap .save-tile[aria-expanded="true"]{
  color:var(--saveFadeGray)!important;
  border-color:var(--saveFadeGray)!important;
  background:#050505!important;
}
.save-control-wrap:hover .save-tile:not(:disabled) .save-label,
.save-control-wrap .save-tile[aria-expanded="true"] .save-label{
  color:var(--saveFadeGray)!important;
}
.save-menu{
  left:6px!important;
  top:calc(var(--header-square) - 6px)!important;
  width:calc(var(--header-square) - 12px)!important;
  height:calc((var(--header-square) - 12px) * 2)!important;
  background:#050505!important;
  border:0!important;
  box-shadow:0 10px 22px rgba(0,0,0,.34)!important;
  display:grid!important;
  grid-template-rows:1fr 1fr!important;
  gap:0!important;
  padding:0!important;
  overflow:visible!important;
}
.save-menu[hidden]{display:none!important}
.save-menu-btn,
.save-menu-btn:hover,
.save-menu-btn:active{
  width:calc(var(--header-square) - 12px)!important;
  height:calc(var(--header-square) - 12px)!important;
  min-width:0!important;
  min-height:0!important;
  box-sizing:border-box!important;
  border:1px solid #fff!important;
  border-radius:var(--saveInnerRadius)!important;
  background:var(--saveFadeGray)!important;
  color:#fff!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:1px!important;
  padding:0!important;
  cursor:pointer!important;
}
.save-menu-btn + .save-menu-btn{margin-top:0!important}
.save-menu-btn:hover{filter:brightness(1.08)}
.save-menu-btn:active{filter:brightness(.96)}
.save-menu-btn .save-icon{
  width:38px!important;
  height:38px!important;
  flex:0 0 38px!important;
}
.save-menu-btn .save-label{
  color:#fff!important;
}


/* v1.3.67: save flyout spacing and drop-area-style borders. */
:root{--pbs-main-button-font-weight:700;
  --saveGap:6px;
  --saveBorderWidth:2px;
  --saveInnerRadius:11px;
}
.save-control-wrap{
  padding:var(--saveGap)!important;
  background:#050505!important;
  overflow:visible!important;
}
.save-control-wrap .save-tile,
.save-control-wrap .save-tile:hover:not(:disabled),
.save-control-wrap .save-tile:active:not(:disabled){
  border:var(--saveBorderWidth) dashed #fff!important;
  border-radius:var(--saveInnerRadius)!important;
  background:#050505!important;
  padding:var(--saveGap)!important;
}
.save-control-wrap:hover .save-tile:not(:disabled),
.save-control-wrap .save-tile[aria-expanded="true"]{
  border-color:var(--saveFadeGray)!important;
  color:var(--saveFadeGray)!important;
}
.save-menu{
  left:0!important;
  top:var(--header-square)!important;
  width:var(--header-square)!important;
  height:auto!important;
  min-height:calc(var(--header-square) * 2 - var(--saveGap))!important;
  padding:0 var(--saveGap) var(--saveGap)!important;
  gap:var(--saveGap)!important;
  background:#050505!important;
  display:grid!important;
  grid-template-rows:auto auto!important;
  box-sizing:border-box!important;
  box-shadow:0 10px 22px rgba(0,0,0,.34)!important;
}
.save-menu[hidden]{display:none!important}
.save-menu-btn,
.save-menu-btn:hover,
.save-menu-btn:active{
  width:calc(var(--header-square) - (var(--saveGap) * 2))!important;
  height:calc(var(--header-square) - (var(--saveGap) * 2))!important;
  border:var(--saveBorderWidth) solid #fff!important;
  border-radius:var(--saveInnerRadius)!important;
  background:var(--saveFadeGray)!important;
  color:#fff!important;
  padding:var(--saveGap)!important;
  box-sizing:border-box!important;
}
.save-menu-btn + .save-menu-btn{margin-top:0!important}


/* v1.3.68: remove duplicate top flyout gap; outside iframe clicks close save flyout. */
.save-menu{padding-top:0!important;}


/* v1.3.69: save flyout interaction polish. */
.save-menu-btn:hover,
.save-menu-btn:focus-visible{
  background:#000!important;
  filter:none!important;
}
.save-menu-btn:active{
  background:#000!important;
  filter:none!important;
}

/* v1.3.71: save flyout tiles black by default, gray on hover. */
.save-menu-btn,
.save-menu-btn:active{
  background:#000!important;
  filter:none!important;
}
.save-menu-btn:hover,
.save-menu-btn:focus-visible{
  background:var(--saveFadeGray)!important;
  filter:none!important;
}

/* v1.3.208 contextual typography; top five-button shell and drop area are intentionally excluded. */
.pbs-dialog,.pbs-dialog *,[role="dialog"],[role="dialog"] *{font-family:"Segoe UI",Tahoma,Geneva,Verdana,sans-serif!important;font-size:14px!important;line-height:1.25!important;font-weight:400!important;font-style:normal!important}
.pbs-dialog h1,.pbs-dialog h2,.pbs-dialog h3,[role="dialog"] h1,[role="dialog"] h2,[role="dialog"] h3{font-weight:600!important}

/* v1.3.275 — calculation-mode launcher. */
:root{--pbs-main-button-font-weight:700;
  --calculation-red:#dc2626;
  --calculation-red-hover:#b91c1c;
  --calculation-red-inactive:#b85b5b;
  --fire-risk:#9a3412;
  --fire-risk-hover:#7c2d12;
  --fire-risk-surface:#fff1e6;
}
.calculation-control-wrap{position:relative;min-width:0;height:var(--button-h);overflow:visible}
.calculations-btn{width:100%;height:100%;background:#3f3f46!important;border-color:#606067!important;color:#fff!important}
.calculations-btn:hover,.calculation-control-wrap:focus-within .calculations-btn{background:#52525b!important;border-color:#71717a!important}
.calculations-btn.active{background:var(--calculation-red)!important;border-color:var(--calculation-red-hover)!important}
.calculations-btn.active:hover{background:var(--calculation-red-hover)!important}
.calculations-menu{position:absolute;left:0;right:0;top:calc(100% + 4px);z-index:120;background:#fff;border:1px solid #991b1b;border-radius:4px;box-shadow:0 8px 18px rgba(0,0,0,.25);padding:3px;display:grid;gap:3px}
.calculations-menu[hidden]{display:none!important}
.calculations-menu-btn{min-height:34px;border:1px solid #fecaca;border-radius:3px;background:#fff;color:#7f1d1d;font:inherit;font-weight:700;cursor:pointer;padding:5px 8px;text-align:left}
.calculations-menu-btn:hover,.calculations-menu-btn:focus-visible{background:#fee2e2;outline:none}
body.mode-fire-risk .context-toolbar,body.mode-fire-risk .workspace{background:var(--fire-risk-surface)}
body.mode-fire-risk .context-btn.fire-risk-action{background:var(--fire-risk)!important;border:1px solid var(--fire-risk-hover)!important;color:#fff!important}
body.mode-fire-risk .context-btn.fire-risk-action:hover{background:var(--fire-risk-hover)!important}
.control-panel,.mode-row{overflow:visible!important}
.calculation-control-wrap{z-index:130}

/* v1.3.276 — the DBF drag-and-drop tile is always the top header layer.
   The calculations launcher keeps ordinary mode-button stacking; only its
   dropdown extends below the button, and it must never cover the drop tile. */
.calculation-control-wrap{
  z-index:auto !important;
}
.calculations-menu{
  z-index:40 !important;
}
.drop-control,
.drop-control.expanded,
.drop-control.loaded.expanded,
.drop-control.drag-active{
  z-index:200 !important;
}

/* v1.3.283: robust pointer corridor between Výpočty and its submenu. */
.calculation-control-wrap::after{content:"";position:absolute;left:0;right:0;top:100%;height:6px;z-index:121;background:transparent;pointer-events:auto}
.calculations-menu{top:calc(100% + 4px)}


/* v1.3.318 — Výpočty dropdown uses the same black tile surround and button geometry as Save. */
.calculation-control-wrap{
  background:#050505!important;
  height:var(--button-h)!important;
  overflow:visible!important;
}
.calculation-control-wrap .calculations-btn{
  width:100%!important;
  height:var(--button-h)!important;
  min-height:var(--button-h)!important;
  max-height:var(--button-h)!important;
  margin:0!important;
}
.calculations-menu{
  left:-6px!important;
  right:-6px!important;
  top:100%!important;
  width:auto!important;
  padding:6px!important;
  gap:6px!important;
  background:#050505!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:0 8px 18px rgba(0,0,0,.28)!important;
}
.calculations-menu-btn{
  width:100%!important;
  height:var(--button-h)!important;
  min-height:var(--button-h)!important;
  max-height:var(--button-h)!important;
  margin:0!important;
  padding:0 9px!important;
  border:1px solid #8f4545!important;
  border-radius:4px!important;
  background:var(--calculation-red-inactive)!important;
  color:#fff!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  font:inherit!important;
  font-weight:var(--pbs-main-button-font-weight,700)!important;
}
.calculations-menu-btn:hover,
.calculations-menu-btn:focus-visible{
  background:var(--calculation-red)!important;
  border-color:var(--calculation-red-hover)!important;
  color:#fff!important;
  outline:none!important;
}
.calculation-control-wrap::after{height:6px!important;background:#050505!important;}


/* v1.3.324 — show the black submenu surround only while the calculations menu is open. */
.calculation-control-wrap{background:transparent!important;}
.calculation-control-wrap::after{background:transparent!important;pointer-events:none!important;}
.calculation-control-wrap.menu-open{background:#050505!important;}
.calculation-control-wrap.menu-open::after{background:#050505!important;pointer-events:auto!important;}

/* v1.3.390 — maximum fire-compartment-size calculation mode. */
:root{--fire-size:#a21caf;--fire-size-hover:#86198f;--fire-size-surface:#fdf4ff}
body.mode-fire-size .context-toolbar,body.mode-fire-size .workspace{background:var(--fire-size-surface)}
body.mode-fire-size .context-btn.fire-size-action{background:var(--fire-size)!important;border:1px solid var(--fire-size-hover)!important;color:#fff!important}
body.mode-fire-size .context-btn.fire-size-action:hover{background:var(--fire-size-hover)!important}

/* v1.3.447 building-wide fire height control in the FCS contextual toolbar. */
body.mode-fire-size .building-fire-height-control{width:auto;min-width:0;cursor:default;gap:8px}
body.mode-fire-size .building-fire-height-label{white-space:nowrap}
body.mode-fire-size .building-fire-height-input-shell{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;width:66px;height:28px;padding-right:4px;border:1px solid #94a3b8;border-radius:3px;background:#fff;color:#111827;overflow:hidden}
body.mode-fire-size .building-fire-height-input-shell input{width:100%;height:100%;min-width:0;border:0;background:transparent;padding:0 2px;text-align:right;color:#111827;outline:0}
body.mode-fire-size .building-fire-height-input-shell span{margin-left:2px;color:#111827}
body.mode-fire-size .building-fire-height-input-shell:focus-within span{display:none}
body.mode-fire-size .building-fire-height-input-shell:focus-within input{grid-column:1/-1}


/* v1.4.111 — three project-save choices: PBS, ZIP, DBF. */
.save-menu{
  min-height:calc(var(--header-square) * 4 - var(--saveGap))!important;
  grid-template-rows:auto auto auto auto!important;
}



/* v1.4.133 — one shell for DBF and CAD. The existing DBF header geometry remains authoritative. */
.mode-row{grid-template-columns:repeat(5,minmax(0,1fr))!important;overflow:visible!important}
.shell-menu-wrap{position:relative;min-width:0;height:var(--button-h)}
.shell-menu-wrap>.mode-btn{width:100%}
.shell-dropdown{position:absolute;left:0;top:calc(var(--button-h) + 2px);z-index:180;min-width:100%;width:max-content;max-width:320px;padding:3px;background:#050505;border:1px solid #606067;border-radius:4px;box-shadow:0 9px 22px rgba(0,0,0,.34);display:grid;gap:3px}
.shell-dropdown[hidden]{display:none!important}
.shell-dropdown-btn{height:34px;min-width:150px;padding:0 10px;border:1px solid #606067;border-radius:4px;background:#3f3f46;color:#fff;font:var(--pbs-main-button-font-weight,700) var(--pbs-button-font-size,15px)/1.2 var(--pbs-button-font-family,"Segoe UI",Tahoma,Geneva,Verdana,sans-serif);text-align:left;cursor:pointer;white-space:nowrap}
.shell-dropdown-btn:hover,.shell-dropdown-btn:focus-visible{background:#52525b}
.workspace-mode-wrap .shell-dropdown-btn[data-workspace="tables"]{border-left:4px solid #64748b}
.workspace-mode-wrap .shell-dropdown-btn[data-workspace="drawings"]{border-left:4px solid #0f766e}
.fire-data-wrap .shell-dropdown-btn[data-fire-data-mode="fire-hazard"]{border-left:4px solid var(--yellow)}
.fire-data-wrap .shell-dropdown-btn[data-fire-data-mode="fire-compartments"]{border-left:4px solid var(--red)}
.drawing-mode-item{border-left:4px solid var(--item-color)!important}
.drawing-mode-btn{background:var(--drawing-mode-color,#6b7280)!important;border-color:var(--drawing-mode-color,#6b7280)!important}
.drawing-mode-btn:hover{filter:brightness(1.08)}
#workspace-mode-btn.editor-drawings-active{background:#0f766e;border-color:#0f766e}
#workspace-mode-btn.editor-tables-active{background:#3f3f46;border-color:#606067}
#fire-data-btn.active{background:var(--fire-data-active,#6d28d9);border-color:var(--fire-data-active,#6d28d9)}
.drawing-dummy{opacity:.35;cursor:default}
body.editor-drawings .context-toolbar{display:none!important}
body.editor-drawings .workspace{height:calc(100vh - var(--header-h))!important;padding:0!important;background:#eef1f4!important}
body.editor-drawings .module-frame.drawing-module-frame{inset:0!important;width:100%!important;height:100%!important;background:#eef1f4!important}
body.editor-tables .drawing-module-frame{display:none}
body.editor-drawings .tables-nav-control{display:none!important}
body.editor-tables .drawings-nav-control{display:none!important}
body.editor-drawings .drawings-nav-control:not([hidden]){display:inline-flex}
body.editor-drawings .drawing-mode-wrap:not([hidden]){display:block}
/* Shared Save menu has only PBS / ZIP / DBF in the unified shell. */
.save-menu{min-height:calc(var(--header-square)*3 - var(--saveGap))!important;grid-template-rows:repeat(3,auto)!important}

/* v1.4.134 — DBF/CAD and Požiarne údaje dropdowns use the exact Výpočty menu geometry. */
.workspace-mode-wrap,
.fire-data-wrap{
  background:#050505!important;
  height:var(--button-h)!important;
  overflow:visible!important;
}
.workspace-mode-wrap::after,
.fire-data-wrap::after{
  content:"";
  position:absolute;
  left:-6px;
  right:-6px;
  top:100%;
  height:6px;
  z-index:179;
  background:#050505;
  pointer-events:auto;
}
.workspace-mode-wrap>.mode-btn,
.fire-data-wrap>.mode-btn{
  width:100%!important;
  height:var(--button-h)!important;
  min-height:var(--button-h)!important;
  max-height:var(--button-h)!important;
  margin:0!important;
}
.workspace-mode-wrap .shell-dropdown,
.fire-data-wrap .shell-dropdown{
  left:-6px!important;
  right:-6px!important;
  top:100%!important;
  min-width:0!important;
  width:auto!important;
  max-width:none!important;
  padding:6px!important;
  gap:6px!important;
  background:#050505!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:0 8px 18px rgba(0,0,0,.28)!important;
}
.workspace-mode-wrap .shell-dropdown-btn,
.fire-data-wrap .shell-dropdown-btn{
  width:100%!important;
  min-width:0!important;
  height:var(--button-h)!important;
  min-height:var(--button-h)!important;
  max-height:var(--button-h)!important;
  margin:0!important;
  padding:0 9px!important;
  border:1px solid #606067!important;
  border-radius:4px!important;
  border-left-width:1px!important;
  background:#3f3f46!important;
  color:#fff!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  font:inherit!important;
  font-weight:var(--pbs-main-button-font-weight,700)!important;
}
.workspace-mode-wrap .shell-dropdown-btn:hover,
.workspace-mode-wrap .shell-dropdown-btn:focus-visible,
.fire-data-wrap .shell-dropdown-btn:hover,
.fire-data-wrap .shell-dropdown-btn:focus-visible{
  background:#52525b!important;
  border-color:#71717a!important;
  color:#fff!important;
  outline:none!important;
}


/* v1.4.136 — all shell dropdown surrounds exist only while their menu is open. */
.workspace-mode-wrap,
.fire-data-wrap,
.drawing-mode-wrap{
  background:transparent!important;
  overflow:visible!important;
}
.workspace-mode-wrap::after,
.fire-data-wrap::after,
.drawing-mode-wrap::after{
  content:"";
  position:absolute;
  left:-6px;
  right:-6px;
  top:100%;
  height:6px;
  z-index:179;
  background:transparent!important;
  pointer-events:none!important;
}
.workspace-mode-wrap.menu-open,
.fire-data-wrap.menu-open,
.drawing-mode-wrap.menu-open{background:#050505!important;}
.workspace-mode-wrap.menu-open::after,
.fire-data-wrap.menu-open::after,
.drawing-mode-wrap.menu-open::after{
  background:#050505!important;
  pointer-events:auto!important;
}
.workspace-mode-wrap .shell-dropdown,
.fire-data-wrap .shell-dropdown,
.drawing-mode-wrap .shell-dropdown{
  left:-6px!important;
  right:-6px!important;
  top:100%!important;
  min-width:0!important;
  width:auto!important;
  max-width:none!important;
  padding:6px!important;
  gap:6px!important;
  background:#050505!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:0 8px 18px rgba(0,0,0,.28)!important;
}
.drawing-mode-wrap .shell-dropdown-btn{
  width:100%!important;
  min-width:0!important;
  height:var(--button-h)!important;
  min-height:var(--button-h)!important;
  max-height:var(--button-h)!important;
  margin:0!important;
  padding:0 9px!important;
  border:1px solid var(--item-color)!important;
  border-left-width:1px!important;
  border-radius:4px!important;
  background:var(--item-color)!important;
  color:#fff!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  font:inherit!important;
  font-weight:var(--pbs-main-button-font-weight,700)!important;
}
.drawing-mode-wrap .shell-dropdown-btn:hover,
.drawing-mode-wrap .shell-dropdown-btn:focus-visible{
  filter:brightness(1.13);
  color:#fff!important;
  outline:none!important;
}
/* CAD shell controls are deliberately neutral; only the current CAD mode selector is colored. */
body.editor-drawings #workspace-mode-btn,
body.editor-drawings #drawing-consistency-btn,
body.editor-drawings #drawing-export-btn,
body.editor-drawings #drawing-dummy-2{
  background:transparent!important;
  border:1px solid #fff!important;
  color:#fff!important;
}
body.editor-drawings #workspace-mode-btn:hover,
body.editor-drawings #workspace-mode-btn:focus-visible,
body.editor-drawings #drawing-consistency-btn:hover,
body.editor-drawings #drawing-consistency-btn:focus-visible,
body.editor-drawings #drawing-export-btn:hover,
body.editor-drawings #drawing-export-btn:focus-visible{
  background:#3f3f46!important;
  border-color:#d4d4d8!important;
}
body.editor-drawings #drawing-export-btn.active{
  background:#52525b!important;
  border-color:#fff!important;
}
body.editor-drawings:not(.drawing-export-active) .drawing-mode-btn{
  background:var(--drawing-mode-color,#6b7280)!important;
  border-color:var(--drawing-mode-color,#6b7280)!important;
  color:#fff!important;
}
body.editor-drawings:not(.drawing-export-active) .drawing-mode-btn:hover,
body.editor-drawings:not(.drawing-export-active) .drawing-mode-btn:focus-visible{filter:brightness(1.12)}
body.editor-drawings.drawing-export-active .drawing-mode-btn{
  background:transparent!important;
  border:1px solid #fff!important;
  color:#fff!important;
  filter:none!important;
}
body.editor-drawings.drawing-export-active .drawing-mode-btn:hover,
body.editor-drawings.drawing-export-active .drawing-mode-btn:focus-visible{
  background:#3f3f46!important;
  border-color:#d4d4d8!important;
  filter:none!important;
}

/* v1.4.141 – Fire Compartments / Edit Rooms state. Match the button to the blue room-row surface. */
body.mode-fire-compartments .context-btn.compartment-toggle[data-action="toggle-edit-rooms"][aria-pressed="true"]{
  background:rgb(192,225,255)!important;
  border-color:rgb(128,192,255)!important;
  color:#0f172a!important;
}
body.mode-fire-compartments .context-btn.compartment-toggle[data-action="toggle-edit-rooms"][aria-pressed="true"]:hover{
  background:rgb(128,192,255)!important;
  border-color:rgb(128,192,255)!important;
  color:#0f172a!important;
}
body.mode-fire-compartments .context-btn.compartment-toggle[data-action="toggle-edit-rooms"][aria-pressed="true"] .context-checkmark{
  color:#0f172a!important;
  border-color:#0f172a!important;
}

/* v1.5.18 — Graphical projection revision indicator. Neutral is the standard
   CAD transparent/white treatment; orange means the displayed graphical
   revision is behind canonical ProjectState or the projection is stale. */
body.editor-drawings #drawing-update-btn{
  background:transparent!important;
  border:1px solid #fff!important;
  color:#fff!important;
}
body.editor-drawings #drawing-update-btn:hover,
body.editor-drawings #drawing-update-btn:focus-visible{
  background:#3f3f46!important;
  border-color:#d4d4d8!important;
}
body.editor-drawings #drawing-update-btn.project-stale{
  background:#f97316!important;
  border-color:#ea580c!important;
  color:#fff!important;
}
body.editor-drawings #drawing-update-btn.project-stale:hover,
body.editor-drawings #drawing-update-btn.project-stale:focus-visible{
  background:#ea580c!important;
  border-color:#c2410c!important;
}

/* v1.5.28 — Constructions calculation mode */
:root{--constructions:#4f46e5;--constructions-hover:#4338ca;--constructions-surface:#eef2ff}
body.mode-constructions .context-toolbar,body.mode-constructions .workspace{background:var(--constructions-surface)}
body.mode-constructions .context-btn.construction-action{background:var(--constructions)!important;border:1px solid var(--constructions-hover)!important;color:#fff!important}
body.mode-constructions .context-btn.construction-action:hover{background:var(--constructions-hover)!important}
