body, html {
  margin: 0;
  padding: 0;
  background-color: black;
  color: white;
  font-family: monospace;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: inherit;
}

.container {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 227px;             /* 225 + 2 */
  padding: 10px 8px 30px 8px;
  border-right: 2px solid #444;
  background: #000;
  height: 100vh;
  position: fixed;
  overflow-y: auto;
  user-select: none;
}

.version-tag {
  position: fixed;
  bottom: 8px;
  left: 10px;
  font-size: 10px;
  color: #333;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  pointer-events: none;
  z-index: 1;
}

.sidebar ul {
  list-style: none;
  margin-left: 0px;
  padding: 0;
  margin: 0;
}

.sidebar ul li {
  padding: 3px 0;
  margin-left: 15px;
  
  cursor: pointer;
}

/* specific adjustment for expandable rows (01, 02, …) */
.sidebar ul li.expandable {
  padding-top: 3px;
  padding-bottom: 3px;
}

.sidebar ul ul {
  margin-left: 30px;
  margin-bottom: 0px;
  margin-top: 0px;
}

/* remove the top padding of the first child in any nested list */
.sidebar ul ul > li:first-child {
  padding-top: 0;
}

/* remove the bottom padding of the last child in any nested list */
.sidebar ul ul > li:last-child {
  padding-bottom: 6px;
}

.nested {
  display: none;
}

/* Highlight state for planet hover integration */
.sidebar li.highlighted {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.expandable::before {
  content: '▶ ';
  display: inline-block;
  width: 15px;
}

.expandable.open::before {
  content: '▼ ';
}

.folder::before {
  content: '';
}

.content {
  flex: 1;
  margin-left: 245px;
  background: #000;
  position: relative;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}

#viewer {
  padding: 0px;
  background: #111;
  white-space: pre;
  user-select: text;
  height: 100%;
  overflow-y: auto;
}

#lifebrush-container {
  position: absolute;
  pointer-events:auto;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
}

#lifebrush-container canvas {
  pointer-events:auto;
  display: block;
}

#lifebrush-container canvas {
  pointer-events:auto;
  outline: none; /* Removes the blue focus ring */
}

#lifebrush-container canvas:focus {
  pointer-events:auto;
  outline: none;
}

/* tiny addition so preloaded page iframes can live in #viewer later */
.iframe-page {
  width: 100%;
  height: 100%;
  border: 0;
  display: none;
  pointer-events:auto;
}
.iframe-page.active { display: block; pointer-events:auto; }

/* ============ Floating Windows ============ */
.floating-window {
  position: fixed;
  background: #0a0a0c;
  border: 1px solid #333;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 2px 8px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: scale(0.95) translateY(10px);
  transition: opacity 0.15s ease-out, transform 0.15s ease-out;
  min-width: 320px;
  min-height: 200px;
}

.floating-window.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.floating-window.closing {
  opacity: 0;
  transform: scale(0.95) translateY(10px);
  pointer-events: none;
}

.floating-window.dragging {
  transition: none;
  opacity: 0.9;
}

.floating-window.resizing {
  transition: none;
}

.floating-window.resizing .window-content,
.floating-window.dragging .window-content {
  pointer-events: none;
}

.floating-window.minimized {
  height: 32px !important;
  min-height: 32px;
  overflow: hidden;
}

.floating-window.minimized .window-content,
.floating-window.minimized .window-resize-handle {
  display: none;
}

.floating-window.maximized {
  border: none;
  box-shadow: none;
}

.window-titlebar {
  height: 32px;
  background: linear-gradient(to bottom, #1a1a1e, #141416);
  border-bottom: 1px solid #222;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 12px;
  cursor: grab;
  flex-shrink: 0;
  user-select: none;
}

.window-titlebar:active {
  cursor: grabbing;
}

.window-title {
  font: 12px ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  margin-right: 12px;
}

.window-controls {
  display: flex;
  gap: 6px;
}

.window-btn {
  width: 24px;
  height: 24px;
  border: none;
  background: #252528;
  color: #777;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s, color 0.1s;
}

.window-btn:hover {
  background: #333;
  color: #aaa;
}

.window-btn-close:hover {
  background: #c44;
  color: #fff;
}

.window-btn-fullscreen:hover {
  background: #4a4;
  color: #fff;
}

.window-btn-minimize:hover {
  background: #c90;
  color: #fff;
}

.window-content {
  flex: 1;
  overflow: hidden;
  background: #000;
}

/* Edge resize handles (no north edges - top bar is drag only) */
.window-edge {
  position: absolute;
  z-index: 10;
}

.window-edge-s {
  bottom: -4px; left: 8px; right: 8px; height: 8px;
  cursor: ns-resize;
}

.window-edge-e {
  right: -4px; top: 8px; bottom: 8px; width: 8px;
  cursor: ew-resize;
}

.window-edge-w {
  left: -4px; top: 8px; bottom: 8px; width: 8px;
  cursor: ew-resize;
}

.window-edge-se {
  bottom: -4px; right: -4px; width: 12px; height: 12px;
  cursor: nwse-resize;
}

.window-edge-sw {
  bottom: -4px; left: -4px; width: 12px; height: 12px;
  cursor: nesw-resize;
}

.floating-window.maximized .window-edge {
  display: none;
}

/* ============ Sidebar Effects Settings Panel ============ */
#sidebar-effects-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 320px;
  max-height: 80vh;
  background: #0d0d10;
  border: 1px solid #333;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  font: 12px ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #aab;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#sidebar-effects-panel.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.sep-header {
  padding: 10px 12px;
  background: #151518;
  border-bottom: 1px solid #222;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.sep-header span {
  font-size: 13px;
  color: #ddd;
}

.sep-close {
  background: none;
  border: none;
  color: #666;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
}

.sep-close:hover {
  color: #c44;
}

.sep-body {
  padding: 12px;
  overflow-y: auto;
  flex: 1;
}

.sep-section {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #222;
}

.sep-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.sep-label {
  font-size: 11px;
  color: #778;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.sep-effects-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.sep-effect-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px 3px 8px;
  background: #1a1d22;
  border: 1px solid #333;
  font-size: 11px;
}

.sep-effect-tag button {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 0 2px;
  font-size: 12px;
}

.sep-effect-tag button:hover {
  color: #c44;
}

.sep-add-effect select {
  width: 100%;
  padding: 6px 8px;
  background: #1a1d22;
  border: 1px solid #333;
  color: #889;
  font: inherit;
  cursor: pointer;
}

.sep-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.sep-row label {
  min-width: 70px;
  color: #778;
  font-size: 11px;
}

.sep-row select,
.sep-row input[type="text"] {
  flex: 1;
  padding: 4px 6px;
  background: #1a1d22;
  border: 1px solid #333;
  color: #aab;
  font: inherit;
}

.sep-row input[type="color"] {
  width: 50px;
  height: 24px;
  padding: 0;
  border: 1px solid #333;
  background: #1a1d22;
  cursor: pointer;
}

.sep-row input[type="checkbox"] {
  margin: 0 4px 0 8px;
}

