.container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.main {
  display: flex;
  flex: 1;
  overflow: hidden;
  --sidebar-w: 260px;
  --right-sidebar-w: 250px;
  --terminal-h: 300px;
}

.main[data-resizing="true"] .sidebar,
.main[data-resizing="true"] .sidebarContent,
.main[data-resizing="true"] .terminal,
.main[data-resizing="true"] .rightSidebar,
.main[data-resizing="true"] .rightSidebarContent {
  transition: none;
}

/* Shared wrapper for settings and workspace view panels. */
.viewPanel {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.sidebar {
  flex-shrink: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  overflow: hidden;
  contain: layout style paint;
  transition:
    width var(--transition-slow),
    opacity var(--transition-normal),
    border-color var(--transition-normal);
  will-change: width;
}

.sidebarContent {
  width: var(--sidebar-w);
  height: 100%;
  transition:
    opacity var(--transition-normal),
    transform var(--transition-normal);
  will-change: opacity, transform;
}

.sidebarHidden {
  width: 0;
  opacity: 0;
  pointer-events: none;
  border-right-color: transparent;
}

.sidebarHidden .sidebarContent {
  opacity: 0;
  transform: translateX(-10px);
}

.center {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--app-bg);
  contain: layout style;
}

.content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--app-bg);
  contain: layout style;
}

.contentPanel {
  position: absolute;
  inset: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.contentPanelHidden {
  visibility: hidden;
  pointer-events: none;
}

.terminal {
  flex-shrink: 0;
  height: var(--terminal-h);
  border-top: 1px solid var(--sidebar-border);
  overflow: hidden;
  contain: layout style paint;
  transition:
    height var(--transition-slow),
    opacity var(--transition-normal),
    transform var(--transition-normal),
    border-color var(--transition-normal);
  will-change: height, opacity, transform;
}

.terminalHidden {
  height: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  border-top-color: transparent;
}

.rightSidebar {
  flex-shrink: 0;
  width: var(--right-sidebar-w);
  background: var(--sidebar-bg);
  border-left: 1px solid var(--sidebar-border);
  overflow: hidden;
  contain: layout style paint;
  transition:
    width var(--transition-slow),
    opacity var(--transition-normal),
    border-color var(--transition-normal);
  will-change: width;
}

.rightSidebarContent {
  width: var(--right-sidebar-w);
  height: 100%;
  transition:
    opacity var(--transition-normal),
    transform var(--transition-normal);
  will-change: opacity, transform;
}

.rightSidebarHidden {
  width: 0;
  opacity: 0;
  pointer-events: none;
  border-left-color: transparent;
}

.rightSidebarHidden .rightSidebarContent {
  opacity: 0;
  transform: translateX(10px);
}

.empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 14px;
}

/*
  Hide a subtree without unmounting it. Used for the terminal panel collapse
  and the settings/workspace view swap — unmounting either would destroy
  xterm instances and kill PTY children.
*/
.hidden {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .sidebarContent,
  .terminal,
  .rightSidebar,
  .rightSidebarContent {
    transition: none;
  }
}

:where([data-platform="mac"]) .sidebar,
:where([data-platform="mac"]) .rightSidebar {
  background: color-mix(in srgb, var(--sidebar-bg) 88%, transparent);
}

:where([data-platform="mac"]) .center,
:where([data-platform="mac"]) .content {
  background: color-mix(in srgb, var(--app-bg) 92%, transparent);
}
