/*
 * ext-layout: collapses editor areas when a reduced layout is active.
 * Classes are toggled on `.svg_editor` by ext-layout.js. With the default
 * "full" layout none of these classes are set, so nothing here applies.
 *
 * Base grid (svgedit.css):
 *   rows:    top(--svgp-toolbar-row-height) | rulerX(15px) | workarea(1fr) | bottom(40px)
 *   columns: left(40px) | rulerY(15px) | 50px | 1fr | side(15px, 500px when .open)
 * Hidden areas get a 0 track, so #workarea (and the rulers) take the space.
 * Top track stays fixed so selection panels overlay rather than reflow (SVGPLAYG-42).
 */

.svg_editor.svgp-layout-no-top #main_button,
.svg_editor.svgp-layout-no-top #tools_top,
.svg_editor.svgp-layout-no-left #tools_left,
.svg_editor.svgp-layout-no-bottom #tools_bottom {
  display: none !important;
}

.svg_editor.svgp-layout-no-top {
  grid-template-rows: 0 15px 1fr 40px;
}

.svg_editor.svgp-layout-no-bottom {
  grid-template-rows: var(--svgp-toolbar-row-height) 15px 1fr 0;
}

.svg_editor.svgp-layout-no-top.svgp-layout-no-bottom {
  grid-template-rows: 0 15px 1fr 0;
}

.svg_editor.svgp-layout-no-left {
  grid-template-columns: 0 15px 50px 1fr 15px;
}

.svg_editor.open.svgp-layout-no-left {
  grid-template-columns: 0 15px 50px 1fr 500px;
}

/* One-click way back to the full editor (only shown for reduced layouts). */
#svgp-layout-full-editor {
  position: fixed;
  /* Stay clear of a panel docked on the right (PanelDock sets --svgp-dock-right). */
  right: calc(28px + var(--svgp-dock-right, 0px));
  bottom: 24px;
  /* Above #tools_top overlay (6), code panel (~1000) and AI panel (10000) so the
   * control stays clickable when those panels are open (SVGPLAYG-43). */
  z-index: 10050;
  margin: 0;
  padding: 6px 12px;
  font-family: var(--svgp-font, system-ui, sans-serif);
  font-size: var(--svgp-font-size, 12px);
  font-weight: var(--svgp-font-weight-medium, 500);
  line-height: 1.2;
  color: var(--svgp-text, #f2f2f2);
  background: var(--svgp-surface-glass, rgba(32, 32, 32, 0.82));
  border: 1px solid var(--svgp-control-border, rgba(255, 255, 255, 0.18));
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s ease-in-out;
}

#svgp-layout-full-editor:hover,
#svgp-layout-full-editor:focus-visible {
  opacity: 1;
}

#svgp-layout-full-editor:focus-visible {
  outline: 2px solid var(--svgp-focus-ring, #4a90e2);
  outline-offset: 2px;
}

#svgp-layout-full-editor[hidden] {
  display: none;
}
