.portfolio-editor-toolbar-root {
  position: fixed;
  z-index: 12050;
  margin: 0;
  padding: 0;
  pointer-events: none;
  box-sizing: border-box;
  width: max-content;
  max-width: calc(100vw - 36px);
}

.portfolio-editor-toolbar-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 0;
  pointer-events: auto;
  width: max-content;
  max-width: 100%;
}

.portfolio-editor-toolbar-row.is-context-open .portfolio-editor-toolbar {
  border-right: none;
}

.portfolio-editor-toolbar {
  pointer-events: auto;
  box-sizing: border-box;
  width: max-content;
  max-width: 100%;
  border: 1px solid #333;
  border-top: none;
  border-left: none;
  background: #000;
  padding: 5px 7px;
  flex: 0 0 auto;
}

.portfolio-editor-toolbar__inner {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  background: transparent;
  width: max-content;
  max-width: 100%;
}

.portfolio-editor-toolbar__btn {
  flex: 0 0 auto;
  margin: 0;
  padding: 6px 11px;
  min-height: 31px;
  border: 1px solid #333;
  border-radius: 0;
  background: #000;
  color: #888;
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: 9px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.portfolio-editor-toolbar__btn:hover {
  color: #9fd4ff;
  background: #0a0a0a;
}

.portfolio-editor-toolbar__btn:focus-visible {
  outline: 1px solid #9fd4ff;
  outline-offset: -1px;
}

.portfolio-editor-toolbar__btn.is-active {
  color: #9fd4ff;
  background: #111;
  border-color: #555;
}

.portfolio-editor-context-panel {
  pointer-events: auto;
  box-sizing: border-box;
  border: 1px solid #333;
  border-top: none;
  border-left: none;
  background: #000;
  padding: 5px 7px;
  flex: 0 0 auto;
  margin-left: -1px;
}

.portfolio-editor-context-panel__inner {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  width: max-content;
  max-width: 100%;
}

.portfolio-editor-context-panel__btn {
  flex: 0 0 auto;
  margin: 0;
  padding: 6px 10px;
  min-height: 31px;
  min-width: 36px;
  border: 1px solid #333;
  border-radius: 0;
  background: #000;
  color: #888;
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: 9px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.portfolio-editor-context-panel__btn:hover {
  color: #9fd4ff;
  background: #0a0a0a;
}

.portfolio-editor-context-panel__btn:focus-visible {
  outline: 1px solid #9fd4ff;
  outline-offset: -1px;
}

.portfolio-editor-context-panel__btn.is-active {
  color: #9fd4ff;
  background: #111;
  border-color: #555;
}

.portfolio-editor-media-window {
  position: absolute;
  margin: 0;
  padding: 0;
  transform: translate(-50%, -50%);
  z-index: 12;
  pointer-events: auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 2px solid #343434;
  background: #000;
}

.portfolio-editor-media-window.is-selected {
  border-color: #343434;
  outline: 2px solid var(--accent-bright, #5a92ff);
  outline-offset: 0;
  z-index: 13;
}

.portfolio-editor-media-window__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: 0 0 auto;
  height: 30px;
  min-height: 30px;
  max-height: 30px;
  padding: 0 8px;
  border-bottom: 1px solid #343434;
  background: #050505;
  font-family: "IBM Plex Mono", "Courier New", Courier, monospace;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  cursor: move;
  touch-action: none;
  user-select: none;
}

.portfolio-editor-media-window__header-left,
.portfolio-editor-media-window__header-right {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portfolio-editor-media-window__header-accent {
  color: var(--accent-bright, #5a92ff);
}

.portfolio-editor-media-window__header-title {
  color: #e8e8e8;
}

.portfolio-editor-media-window__header-right {
  color: #888;
}

.portfolio-editor-media-window__content {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  background: #000;
  overflow: hidden;
  box-sizing: border-box;
}

.portfolio-editor-media-window__plus {
  position: static;
  transform: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #6f6f6f;
  font-family: "IBM Plex Mono", "Courier New", Courier, monospace;
  font-size: 42px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.portfolio-editor-media-window__plus:hover {
  color: #9fd4ff;
}

.portfolio-editor-media-window__plus:focus-visible {
  outline: 1px solid #9fd4ff;
  outline-offset: -2px;
}

.portfolio-editor-media-window__plus.is-pressed {
  transform: scale(0.96);
  color: #888;
}

.portfolio-editor-media-window__plus.is-hidden {
  display: none;
}

.portfolio-editor-media-window__file-input {
  display: none;
}

.portfolio-editor-media-window__content.has-media {
  display: block;
  position: relative;
}

.portfolio-editor-media-window__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: auto;
}

.portfolio-editor-media-window__resize-handle {
  display: none;
  position: absolute;
  right: 0;
  bottom: 0;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
  touch-action: none;
  box-sizing: border-box;
  border-right: 2px solid var(--accent-bright, #5a92ff);
  border-bottom: 2px solid var(--accent-bright, #5a92ff);
  background: transparent;
  z-index: 2;
}

.portfolio-editor-media-window.is-selected .portfolio-editor-media-window__resize-handle {
  display: block;
}

body.portfolio-editor-toolbar-active .portfolio-v3__section5-stage,
body.portfolio-editor-toolbar-active .portfolio-v3__screen2-canvas,
body.portfolio-editor-toolbar-active .portfolio-v3__section4-stage,
body.portfolio-editor-toolbar-active .portfolio-v3__screen1 .portfolio-v3__stage {
  overflow: visible !important;
}
