/* Editor groups retain live section frames while their geometry changes. */
body.desk-panel:not(.desk-panel-ready) .app-shell {
  visibility: hidden;
}
body.desk-panel:not(.desk-panel-ready)::after {
  content: "Открываем раздел…";
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  background: var(--surface);
}
body.desk-mode .topbar {
  min-height: 0;
  padding-bottom: 0;
  gap: 0;
}
body.desk-mode .topbar-main {
  min-height: 48px;
}
body.desk-mode .topbar-context,
body.desk-mode #headerActions {
  display: none;
}
body.desk-mode .header-title {
  font-size: 16px;
  white-space: nowrap;
}
body.desk-mode .desk-content {
  max-width: none;
  margin: 0;
  padding: 8px;
  gap: 0;
}
body.desk-mode .topbar {
  overflow: visible;
}
.desk-global-controls {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: 4px;
  flex-shrink: 0;
}
.desk-group-select {
  display: none;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  padding: 5px;
  font: inherit;
  font-size: 10px;
  max-width: 96px;
  min-width: 0;
}
.desk-stage {
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: 0;
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.desk-group {
  position: absolute;
  z-index: 0;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}
.desk-group-focused {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.desk-group[hidden] {
  display: none !important;
}
.desk-group-header {
  height: 35px;
  min-width: 0;
  padding: 2px 4px;
  background: var(--surface-alt, var(--surface));
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 3;
}
.desk-tab-controls {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  width: 100%;
  height: 30px;
}
.desk-tabs {
  display: flex;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  height: 30px;
}
.desk-tab {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  border: 1px solid transparent;
  border-radius: 5px 5px 0 0;
  background: var(--surface);
  min-width: 80px;
  max-width: min(260px, 100%);
  min-height: 28px;
  overflow: hidden;
  cursor: grab;
}
.desk-tab.selected {
  background: var(--accent-soft);
  border-color: var(--line);
  border-bottom-color: var(--accent);
}
.desk-tab-select {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  gap: 5px;
  min-height: 27px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  padding: 5px 5px 5px 8px;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  overflow: hidden;
  cursor: inherit;
}
.desk-tab-select > span {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.desk-tab-select:focus-visible,
.desk-tab-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.desk-tab.selected .desk-tab-select {
  font-weight: 650;
}
.desk-tab-close {
  flex: 0 0 22px;
  height: 23px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
}
.desk-tab-close:hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 4px;
}
.desk-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 6px;
  min-height: 28px;
  padding: 5px 8px;
  font: inherit;
  font-size: 11px;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  cursor: pointer;
}
.desk-group-header .desk-button {
  font-size: 13px;
  min-width: 24px;
  min-height: 26px;
  height: 26px;
  padding: 3px 5px;
  flex-shrink: 0;
  background: transparent;
  border-color: transparent;
}
.desk-button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.desk-button:disabled {
  opacity: 0.35;
  cursor: default;
}
.desk-button[hidden],
.desk-tab[hidden] {
  display: none !important;
}
.desk-group-header .desk-compact-tabs {
  display: none;
  font-size: 10px;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  justify-content: flex-start;
}
.desk-compact-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.desk-compact-chevron {
  flex: 0 0 auto;
}
.desk-compact-group .desk-tabs,
.desk-compact-group [data-desk-action="previous"],
.desk-compact-group [data-desk-action="next"] {
  display: none !important;
}
.desk-compact-group .desk-compact-tabs {
  display: inline-flex;
}
.desk-compact-group > .desk-group-header [data-desk-action="new"] {
  display: none;
}
.desk-choice-list {
  display: grid;
  gap: 8px;
  align-content: start;
}
.desk-choice-list > .desk-button {
  min-width: 0;
  justify-content: flex-start;
  text-align: left;
  white-space: normal;
  min-height: 36px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.desk-tab-choice {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}
.desk-tab-choice > [data-desk-action="select"] {
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}
.desk-tab-choice-title {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.desk-tab-choice-status {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}
.desk-tab-choice > [data-desk-action="close"] {
  flex: 0 0 32px;
  align-self: flex-start;
  min-width: 32px;
  height: 32px;
  font-size: 16px;
}
.desk-choice-list + .detail-subtitle {
  line-height: 1.6;
  margin-top: 13px;
}
.desk-frame {
  position: absolute;
  z-index: 1;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0 0 7px 7px;
  background: var(--surface);
}
.desk-frame[hidden] {
  display: none !important;
}
.desk-empty-group {
  position: absolute;
  inset: 36px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  min-width: 0;
  min-height: 0;
}
.desk-empty-group p {
  margin: 8px 0 13px;
  line-height: 1.5;
  max-width: 280px;
}
.desk-empty-group b {
  color: var(--ink);
}
.desk-splitter {
  position: absolute;
  z-index: 4;
  border-radius: 5px;
  cursor: row-resize;
  touch-action: none;
  outline-offset: -2px;
}
.desk-splitter[data-axis="row"] {
  cursor: col-resize;
}
.desk-splitter::after {
  position: absolute;
  content: "";
  width: 28px;
  height: 3px;
  border-radius: 4px;
  background: var(--line);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.desk-splitter[data-axis="row"]::after {
  width: 3px;
  height: 28px;
}
.desk-splitter:focus-visible,
.desk-splitter:hover {
  background: var(--accent-soft);
}
.desk-splitter:focus-visible::after,
.desk-splitter:hover::after {
  background: var(--accent);
}
.desk-resizing .desk-frame {
  pointer-events: none;
}
.desk-drop-zones {
  display: none;
  position: absolute;
  inset: 35px 0 0;
  z-index: 10;
  background: color-mix(in srgb, var(--surface) 75%, transparent);
}
.desk-dragging .desk-group {
  z-index: 5;
}
.desk-dragging .desk-drop-zones {
  display: block;
}
.desk-dragging .desk-frame {
  pointer-events: none;
}
.desk-drop-zone {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 10px;
  text-align: center;
  background: color-mix(in srgb, var(--accent-soft) 75%, transparent);
  border-radius: 4px;
  pointer-events: auto;
}
.desk-drop-zone.over {
  background: var(--accent-soft);
  color: var(--accent);
  border: 2px solid var(--accent);
}
.desk-drop-center {
  inset: 27% 27%;
}
.desk-drop-left {
  left: 2%;
  top: 27%;
  bottom: 27%;
  width: 23%;
}
.desk-drop-right {
  right: 2%;
  top: 27%;
  bottom: 27%;
  width: 23%;
}
.desk-drop-top {
  top: 2%;
  left: 27%;
  right: 27%;
  height: 23%;
}
.desk-drop-bottom {
  bottom: 2%;
  left: 27%;
  right: 27%;
  height: 23%;
}
body.desk-panel .sidebar,
body.desk-panel #menuToggle,
body.desk-panel #topAvatar,
body.desk-panel #themeToggle,
body.desk-panel #notificationButton,
body.desk-panel .global-search {
  display: none !important;
}
body.desk-panel .main-area {
  width: 100%;
}
body.desk-panel .topbar {
  padding-left: 12px;
  padding-right: 12px;
  min-height: 0;
}
body.desk-panel .topbar-main {
  min-height: 39px;
}
body.desk-panel .topbar-context {
  min-height: 36px;
}
body.desk-panel .topbar-actions {
  margin-left: auto;
}
body.desk-panel .header-title {
  font-size: 14px;
}
body.desk-panel .header-actions {
  max-width: 60vw;
}
body.desk-panel .page-content {
  padding: 9px 10px;
  gap: 8px;
}
body.desk-panel .topbar .header-actions .button {
  white-space: nowrap;
}
body.desk-panel .app-shell {
  width: 100%;
}
body.directory-only .sidebar,
body.directory-only #menuToggle,
body.directory-only #workspaceSwitcher,
body.directory-only .desk-global-controls:not(.directory-navigation),
body.directory-only .desk-group,
body.directory-only .desk-splitter,
body.directory-only .desk-drop-zones {
  display: none !important;
}
body.directory-only .main-area {
  width: 100%;
  margin-left: 0;
}
body.directory-only.desk-mode .desk-content {
  padding: 0;
}
body.directory-only .desk-directory-frame {
  border-radius: 0;
}
body.directory-only .directory-navigation[hidden] {
  display: none !important;
}
body.directory-only .directory-navigation:not([hidden]) {
  display: flex;
}
body.directory-only .directory-navigation > .desk-button {
  font-size: 11px;
  padding: 5px 8px;
  gap: 5px;
}
body.directory-only .directory-navigation > .desk-button::before {
  content: none;
}
body.directory-only.desk-panel .header-title {
  display: none;
}
body.directory-only.desk-panel .topbar-main {
  min-height: 0;
}
body.directory-only.desk-panel .header-actions:empty {
  display: none;
}
@media (max-width: 380px) {
  body.directory-only.desk-mode .topbar-main:has(.directory-navigation:not([hidden])) .header-title {
    display: none;
  }
}
@media (max-width: 699px) {
  body.desk-mode .topbar {
    padding: 0 9px;
  }
  body.desk-mode .topbar-main {
    display: flex;
    min-height: 44px;
    padding: 0;
    gap: 5px;
  }
  body.desk-mode .topbar-actions {
    grid-column: auto;
    width: auto;
    margin-left: auto;
    gap: 2px;
  }
  body.desk-mode .header-title {
    font-size: 13px;
    white-space: nowrap;
    max-width: 105px;
  }
  body.desk-mode .desk-content {
    padding: 5px;
  }
  .desk-group-select {
    display: block;
  }
  .desk-global-controls {
    gap: 3px;
    margin-left: 0;
  }
  .desk-global-controls > .desk-button {
    font-size: 0;
    padding: 4px 6px;
    gap: 0;
  }
  .desk-global-controls > .desk-button::before {
    content: "▥";
    font-size: 15px;
  }
  .desk-group-header {
    padding-left: 3px;
    padding-right: 3px;
  }
  .desk-tab-select {
    font-size: 10px;
    padding-left: 6px;
  }
  .desk-tab {
    min-width: 74px;
  }
  .desk-tab-close {
    flex-basis: 20px;
  }
  .desk-button {
    font-size: 10px;
    padding: 5px 7px;
    min-height: 27px;
  }
  body.desk-panel .topbar {
    padding-left: 8px;
    padding-right: 8px;
  }
  body.desk-panel .topbar-main {
    display: flex;
    padding: 0;
    gap: 5px;
    min-height: 36px;
  }
  body.desk-panel .topbar-actions {
    grid-column: auto;
    width: auto;
  }
  body.desk-panel .header-title {
    font-size: 13px;
  }
  body.desk-panel .topbar-context {
    min-height: 35px;
  }
  body.desk-panel .page-content {
    padding: 7px;
    gap: 7px;
  }
}
@media (max-width: 390px) {
  body.desk-mode .header-title {
    max-width: 75px;
    font-size: 12px;
  }
  .desk-group-select {
    max-width: 77px;
  }
  .desk-global-controls {
    gap: 2px;
  }
}
@media (max-height: 500px) {
  body.desk-mode .topbar-main {
    min-height: 36px;
  }
  body.desk-panel .topbar-main {
    min-height: 32px;
  }
  body.desk-panel .topbar-context {
    min-height: 32px;
  }
}
@media print {
  body.desk-mode .desk-content {
    display: none;
  }
}
.desk-dirty {
  flex: 0 0 auto;
  font-size: 8px;
  font-style: normal;
  line-height: 1;
  color: var(--accent);
}
.desk-tab {
  touch-action: none;
  user-select: none;
}
.desk-dragging,
.desk-dragging * {
  cursor: grabbing !important;
}
body.desk-panel .header-title {
  display: none;
}
body.desk-panel .topbar-main:has(#headerActions:empty) {
  display: none;
}
body.desk-panel #headerTabs:has(.screen-tabs > button:only-child),
body.desk-panel #headerTabs:has(.section-select > option:only-child) {
  display: none;
}
body.desk-panel
  .topbar-context:has(#headerTools:empty):has(
    #headerTabs .screen-tabs > button:only-child
  ),
body.desk-panel
  .topbar-context:has(#headerTools:empty):has(
    #headerTabs .section-select > option:only-child
  ) {
  display: none;
}
.desk-stage > .desk-frame-expanded {
  z-index: 20;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(12, 20, 40, 0.12);
}
.desk-layer-open > .desk-group,
.desk-layer-open > .desk-splitter {
  pointer-events: none;
}
