:root {
  --bg: #0f1117;
  --panel: #171b24;
  --panel-2: #202532;
  --line: #303747;
  --text: #f4f7fb;
  --muted: #9aa7b8;
  --primary: #3fbf8f;
  --primary-2: #2a9d74;
  --accent: #e0a43a;
  --danger: #e26363;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body.resizing-columns,
body.resizing-rows {
  user-select: none;
}

body.resizing-columns {
  cursor: col-resize;
}

body.resizing-rows {
  cursor: row-resize;
}

button,
select,
input {
  font: inherit;
}

.app-shell {
  width: 100vw;
  height: 100vh;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr 24px;
  overflow: hidden;
}

.topbar {
  min-height: 86px;
  display: grid;
  grid-template-rows: 42px 43px;
  align-items: stretch;
  gap: 0;
  padding: 0;
  background: #121620;
  border-bottom: 1px solid var(--line);
}

.menubar {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border-bottom: 1px solid #252b38;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 128px;
}

.mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: #06120d;
  font-weight: 800;
  box-shadow: var(--shadow);
}

h1 {
  margin: 0;
  color: var(--primary);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand p {
  display: none;
}

.main-menu {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}

.menubar-button {
  height: 28px;
  min-width: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #d9e2ee;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 500;
}

.menubar-button:hover,
.dropdown.open > .menubar-button {
  background: #252b38;
  border-color: transparent;
}

.topbar-feedback {
  margin-left: auto;
  border: 1px solid var(--line);
  background: rgba(32, 37, 50, 0.68);
  color: #d9e2ee;
  font-weight: 700;
}

.topbar-feedback:hover {
  border-color: #3c465a;
  background: #252b38;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.toolbar {
  min-width: 0;
  display: grid;
  grid-template-columns: auto auto auto 1fr;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 7px 12px;
  background: #10141d;
}

.toolbar-field {
  height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(32, 37, 50, 0.68);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.toolbar-field select {
  min-width: 0;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0 6px 6px 0;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
}

.visually-hidden-select {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  opacity: 0;
  pointer-events: none;
}

.current-project-label {
  min-width: 150px;
  max-width: 230px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  border-left: 1px solid var(--line);
  border-radius: 0 6px 6px 0;
  color: var(--text);
  padding: 0 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

.nested-menu {
  position: relative;
}

.nested-menu-panel {
  top: 0;
  left: 100%;
  margin-left: 4px;
}

.dropdown.open .nested-menu:not(.open) .nested-menu-panel {
  display: none;
}

.dropdown.open .nested-menu.open .nested-menu-panel {
  display: grid;
  gap: 2px;
}

.toolbar-field .icon-button {
  width: 30px;
  min-width: 30px;
  border-width: 0 0 0 1px;
  border-radius: 0 6px 6px 0;
  padding: 0;
}

.dropdown {
  position: relative;
}

.menu-button {
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.menu-button span,
.inline-menu-button span {
  color: currentColor;
  font-size: 10px;
  opacity: 0.75;
}

.inline-dropdown {
  height: 30px;
}

.inline-menu-button {
  min-width: 106px;
  height: 30px;
  gap: 8px;
  justify-content: space-between;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0 6px 6px 0;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
}

.framework-menu-button {
  min-width: 86px;
}

.project-menu-button {
  min-width: 150px;
}

.inline-menu-panel,
.target-menu-panel {
  min-width: 106px;
}

.project-menu-panel {
  min-width: 220px;
  max-height: 320px;
  overflow: auto;
}

.inline-menu-panel button.active,
.target-menu-panel button.active {
  background: #1f6feb;
  color: #ffffff;
}

.menu-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  min-width: 190px;
  display: none;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #171b24;
  box-shadow: var(--shadow);
}

.menu-panel-right {
  left: auto;
  right: 0;
}

.dropdown.open .menu-panel {
  display: grid;
  gap: 2px;
}

.menu-panel button,
.menu-panel .menu-item {
  width: 100%;
  height: 32px;
  justify-content: flex-start;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  padding: 0 10px;
  font-size: 13px;
}

.edit-menu-panel {
  min-width: 270px;
}

.menu-panel button kbd {
  margin-left: auto;
  color: #7f8ea3;
  font: 12px/1 "Segoe UI", system-ui, sans-serif;
}

.menu-panel button:has(.pro-badge) {
  justify-content: space-between;
}

.menu-separator {
  height: 1px;
  margin: 4px 6px;
  background: var(--line);
}

.menu-label {
  padding: 7px 10px 3px;
  color: var(--muted);
  font-size: 12px;
}

.pro-badge {
  margin-left: auto;
  color: #e0a43a;
  font-size: 11px;
  font-weight: 700;
}

.quick-actions {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 5px;
}

.quick-action {
  min-width: 34px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: var(--panel-2);
  border-color: var(--line);
  color: #c8d7eb;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
}

.quick-action:hover {
  background: #242b3a;
  border-color: #60708a;
  color: #ffffff;
}

.quick-action.icon-only {
  width: 34px;
  padding: 0;
}

.quick-action svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-panel button:hover,
.menu-panel .menu-item:hover {
  background: #242b3a;
}

.project-menu-category {
  padding: 8px 10px 4px;
  color: #7f8ea3;
  font: 700 11px/1 "Segoe UI", system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.menu-panel button:disabled {
  color: var(--muted);
  opacity: 0.55;
}

.hidden-control {
  display: none;
}

.statusbar {
  min-width: 0;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 10px;
  border-top: 1px solid #1f6feb;
  background: #007acc;
  color: #ffffff;
  font: 12px/1.2 "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
}

.statusbar-left,
.statusbar-right {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.statusbar-left {
  flex: 1;
}

.statusbar-right {
  justify-content: flex-end;
}

.statusbar span {
  min-width: 0;
  white-space: nowrap;
}

#statusBarMessage {
  overflow: hidden;
  text-overflow: ellipsis;
}

button,
.upload-button,
select,
input {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  padding: 0 12px;
}

button,
.upload-button {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

button:hover,
.upload-button:hover,
select:hover,
input:focus {
  border-color: #60708a;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.primary {
  border-color: var(--primary-2);
  background: var(--primary);
  color: #06120d;
  font-weight: 700;
}

.accent {
  border-color: #bf8420;
  background: var(--accent);
  color: #171006;
  font-weight: 700;
}

.danger {
  border-color: #b74444;
  background: var(--danger);
  color: #1a0606;
  font-weight: 700;
}

.upload-button input {
  display: none;
}

#projectSelect {
  min-width: 150px;
}

#somSelect {
  min-width: 106px;
}

#frameworkSelect {
  width: 86px;
}

#portInput {
  width: 132px;
}

.workspace {
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-columns: var(--sidebar-width, 260px) 5px minmax(0, 1fr);
  grid-template-rows: minmax(160px, 1fr) 5px var(--log-height, 220px);
  overflow: hidden;
}

.sidebar {
  grid-row: 1 / 4;
  grid-column: 1;
  min-height: 0;
  min-width: 0;
  background: #181818;
  display: flex;
  flex-direction: column;
  color: #cccccc;
}

.splitter {
  position: relative;
  z-index: 5;
  background: var(--line);
  touch-action: none;
}

.splitter::before {
  content: "";
  position: absolute;
  inset: -3px;
}

.splitter:hover,
.splitter.dragging {
  background: var(--primary);
}

.splitter-vertical {
  grid-column: 2;
  grid-row: 1 / 4;
  cursor: col-resize;
}

.splitter-horizontal {
  grid-column: 3;
  grid-row: 2;
  cursor: row-resize;
}

.panel-title,
.filebar {
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.panel-title {
  min-height: 35px;
  padding: 0 8px 0 12px;
  border-bottom-color: #2b2b2b;
  background: #181818;
  color: #bbbbbb;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
}

.file-panel-title {
  justify-content: space-between;
}

.file-actions {
  display: flex;
  gap: 1px;
  opacity: 0.88;
}

.file-actions button {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #c5c5c5;
  padding: 0;
  font-size: 13px;
  font-weight: 400;
}

.file-actions button:hover {
  background: #2a2d2e;
  color: #ffffff;
}

.file-actions button:disabled {
  opacity: 0.38;
  pointer-events: none;
}

.file-actions svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.file-list {
  overflow: auto;
  padding: 4px 0 8px;
  font: 13px/1.35 "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  scrollbar-color: #424242 transparent;
}

.tree-row {
  width: 100%;
  height: 22px;
  min-height: 22px;
  display: grid;
  grid-template-columns: 16px 18px minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  justify-content: flex-start;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #cccccc;
  text-align: left;
  padding: 0 8px 0 calc(8px + (var(--depth, 0) * 16px));
  overflow: hidden;
  font: 400 13px/22px "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.tree-row:hover {
  background: #2a2d2e;
}

.tree-row.active {
  background: #04395e;
  color: #ffffff;
}

.tree-row.selected:not(.active) {
  background: #37373d;
  color: #ffffff;
}

.tree-row.folder {
  font-weight: 600;
  color: #dcdcdc;
}

.tree-row.file {
  font-weight: 400;
}

.tree-toggle,
.tree-icon,
.tree-folder-icon {
  width: 16px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.tree-toggle {
  color: #c5c5c5;
  font-size: 18px;
  line-height: 1;
}

.tree-spacer {
  pointer-events: none;
}

.tree-folder-icon {
  position: relative;
  display: inline-block;
  height: 16px;
}

.tree-folder-icon::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 16px;
  height: 10px;
  border-radius: 2px 2px 1px 1px;
  background: #e2b55f;
}

.tree-folder-icon::after {
  content: "";
  position: absolute;
  left: 1px;
  top: 3px;
  width: 8px;
  height: 4px;
  border-radius: 2px 2px 0 0;
  background: #f0c36f;
}

.tree-node:not(.collapsed) > .tree-row.folder .tree-folder-icon::before {
  background: #f1c978;
  clip-path: polygon(0 18%, 100% 18%, 88% 100%, 0 100%);
}

.tree-node:not(.collapsed) > .tree-row.folder .tree-folder-icon::after {
  background: #e0b25a;
}

.tree-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  place-items: center;
  width: 16px;
  height: 16px;
  color: #90a4ae;
  font-size: 0;
  letter-spacing: 0;
}

.tree-icon::before {
  content: "";
  position: absolute;
  inset: 1px 3px 1px 2px;
  border-radius: 1px;
  background: currentColor;
  opacity: 0.95;
}

.tree-icon::after {
  content: "";
  position: absolute;
  right: 3px;
  top: 1px;
  width: 5px;
  height: 5px;
  clip-path: polygon(0 0, 100% 100%, 0 100%);
  background: rgba(255, 255, 255, 0.35);
  opacity: 1;
}

.icon-c {
  color: #4fc3f7;
}

.icon-c::before,
.icon-cpp::before,
.icon-header::before,
.icon-cmake::before,
.icon-markdown::before {
  inset: 1px;
  border-radius: 3px;
  background: #0d1117;
  border: 1px solid rgba(255, 255, 255, 0.18);
  opacity: 1;
}

.icon-c::after {
  content: "C";
  inset: auto;
  width: auto;
  height: auto;
  clip-path: none;
  background: transparent;
  color: #4fc3f7;
  font: 800 9px/1 "Segoe UI", sans-serif;
}

.icon-cpp {
  color: #4fc3f7;
}

.icon-cpp::after {
  content: "C++";
  inset: auto;
  width: auto;
  height: auto;
  clip-path: none;
  background: transparent;
  color: #4fc3f7;
  font: 800 6px/1 "Segoe UI", sans-serif;
}

.icon-header {
  color: #b388ff;
}

.icon-header::after {
  content: "H";
  inset: auto;
  width: auto;
  height: auto;
  clip-path: none;
  background: transparent;
  color: #b388ff;
  font: 800 9px/1 "Segoe UI", sans-serif;
}

.icon-cmake {
  color: #f4f7fb;
}

.icon-cmake::after {
  content: "M";
  inset: auto;
  width: auto;
  height: auto;
  clip-path: none;
  background: transparent;
  color: #f4f7fb;
  font: 900 9px/1 "Segoe UI", sans-serif;
}

.icon-config {
  color: #8d6e63;
}

.icon-config::before {
  inset: 2px;
  border-radius: 50%;
  opacity: 1;
}

.icon-config::after {
  left: 6px;
  top: 6px;
  width: 4px;
  height: 4px;
  clip-path: none;
  border-radius: 50%;
  background: #181818;
  opacity: 0.9;
}

.icon-kconfig {
  color: #ffb74d;
}

.icon-kconfig::before {
  inset: 1px;
  border-radius: 3px;
  background: #0d1117;
  border: 1px solid rgba(255, 183, 77, 0.45);
  opacity: 1;
}

.icon-kconfig::after {
  content: "K";
  inset: auto;
  width: auto;
  height: auto;
  clip-path: none;
  background: transparent;
  color: #ffb74d;
  font: 900 9px/1 "Segoe UI", sans-serif;
}

.icon-gear {
  color: #b8a06a;
}

.icon-gear::before {
  left: 2px;
  top: 2px;
  width: 12px;
  height: 12px;
  inset: auto;
  border-radius: 50%;
  background: currentColor;
  opacity: 1;
  clip-path: polygon(
    45% 0,
    55% 0,
    60% 18%,
    74% 9%,
    91% 26%,
    82% 40%,
    100% 45%,
    100% 55%,
    82% 60%,
    91% 74%,
    74% 91%,
    60% 82%,
    55% 100%,
    45% 100%,
    40% 82%,
    26% 91%,
    9% 74%,
    18% 60%,
    0 55%,
    0 45%,
    18% 40%,
    9% 26%,
    26% 9%,
    40% 18%
  );
}

.icon-gear::after {
  left: 6px;
  top: 6px;
  width: 4px;
  height: 4px;
  clip-path: none;
  border-radius: 50%;
  background: #181818;
  opacity: 1;
}

.icon-markdown {
  color: #58a6ff;
}

.icon-markdown::after {
  content: "i";
  inset: auto;
  width: auto;
  height: auto;
  clip-path: none;
  background: transparent;
  color: #58a6ff;
  font: italic 900 10px/1 Georgia, serif;
}

.icon-json {
  color: #fbc02d;
}

.icon-json::after {
  content: "{}";
  inset: auto;
  width: auto;
  height: auto;
  clip-path: none;
  background: transparent;
  color: #332800;
  font: 900 7px/1 Consolas, monospace;
}

.icon-python {
  color: #3776ab;
}

.icon-python::before {
  left: 2px;
  top: 2px;
  width: 9px;
  height: 8px;
  inset: auto;
  border-radius: 3px 3px 2px 2px;
  background: #3776ab;
}

.icon-python::after {
  left: 6px;
  top: 7px;
  width: 9px;
  height: 8px;
  clip-path: none;
  border-radius: 2px 2px 3px 3px;
  background: #ffd43b;
}

.icon-yaml {
  color: #ef5350;
}

.icon-yaml::before {
  inset: 1px;
  border-radius: 3px;
  background: #0d1117;
  border: 1px solid rgba(239, 83, 80, 0.5);
  opacity: 1;
}

.icon-yaml::after {
  content: "#";
  inset: auto;
  width: auto;
  height: auto;
  clip-path: none;
  background: transparent;
  color: #ef5350;
  font: 900 10px/1 Consolas, monospace;
}

.icon-lock {
  color: #90a4ae;
}

.icon-lock::before {
  left: 3px;
  top: 7px;
  width: 10px;
  height: 7px;
  inset: auto;
  border-radius: 1px;
}

.icon-lock::after {
  left: 5px;
  top: 2px;
  width: 6px;
  height: 8px;
  clip-path: none;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: transparent;
}

.icon-binary {
  color: #7e57c2;
}

.icon-binary::before {
  inset: 2px;
  border-radius: 2px;
  opacity: 1;
}

.icon-binary::after {
  content: "01";
  inset: auto;
  width: auto;
  height: auto;
  clip-path: none;
  background: transparent;
  color: #ffffff;
  font: 800 6px/1 Consolas, monospace;
}

.icon-text {
  color: #90a4ae;
}

.icon-text::before {
  opacity: 0.95;
}

.icon-text::after {
  content: "";
  right: 5px;
  top: 6px;
  width: 8px;
  height: 1px;
  clip-path: none;
  box-shadow: 0 3px 0 currentColor, 0 6px 0 currentColor;
  opacity: 0.85;
}

.icon-file {
  color: #78909c;
}

.tree-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0;
}

.tree-node {
  position: relative;
}

.tree-children {
  position: relative;
}

.tree-children .tree-children::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 2px;
  left: calc(16px + (var(--depth-guide, 0) * 16px));
  width: 1px;
  background: rgba(204, 204, 204, 0.13);
  pointer-events: none;
}

.tree-node.collapsed > .tree-children {
  display: none;
}

.editor-pane {
  grid-column: 3;
  grid-row: 1;
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  background: #11151d;
  overflow: hidden;
}

.editor-pane.sdkconfig-raw {
  grid-template-rows: auto auto 1fr;
}

.filebar {
  justify-content: space-between;
  text-transform: none;
  color: #dfe6f1;
  gap: 10px;
  padding: 0;
  overflow: hidden;
}

#dirtyFlag {
  color: var(--accent);
  padding-right: 14px;
  white-space: nowrap;
}

.editor-tabs {
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: stretch;
  overflow: auto hidden;
}

.editor-empty-tab {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
}

.editor-tab {
  height: 40px;
  min-width: 120px;
  max-width: 220px;
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #151a23;
  color: #cbd5e1;
  padding: 0 10px 0 12px;
  font: 13px/1.35 "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
}

.editor-tab:hover {
  background: #202838;
}

.editor-tab.active {
  background: #1e1e1e;
  color: #ffffff;
  font-weight: 400;
  box-shadow: inset 0 2px 0 var(--primary);
}

.editor-tab.preview .editor-tab-name {
  font-style: italic;
}

.editor-tab-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-tab-dirty {
  color: var(--accent);
  font-size: 9px;
}

.editor-tab-close {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  border-radius: 3px;
  color: var(--muted);
}

.editor-tab-close:hover {
  background: #303747;
  color: #ffffff;
}

#editor {
  min-height: 0;
  min-width: 0;
  width: 100%;
  height: 100%;
  grid-row: 2;
  overflow: hidden;
}

.editor-pane.sdkconfig-raw #editor {
  grid-row: 3;
}

.sdkconfig-editor {
  min-height: 0;
  grid-row: 2;
  display: grid;
  grid-template-rows: auto 1fr;
  background: #151b26;
}

.sdkconfig-editor[hidden] {
  display: none;
}

.sdkconfig-editor.raw {
  min-height: auto;
  display: block;
}

.sdkconfig-editor.raw .sdkconfig-table-wrap {
  display: none;
}

.sdkconfig-toolbar {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #1b2230;
  padding: 6px 12px;
}

.sdkconfig-toolbar input[type="search"] {
  width: min(330px, 42vw);
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111827;
  color: var(--text);
  outline: 0;
  padding: 0 10px;
}

.sdkconfig-toolbar input[type="search"]:focus {
  border-color: var(--primary);
}

.sdkconfig-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.sdkconfig-table-wrap {
  position: relative;
  min-height: 0;
  overflow: auto;
}

.sdkconfig-table {
  width: auto;
  min-width: 856px;
  border-collapse: collapse;
  table-layout: fixed;
  font: 12px/1.32 "Cascadia Mono", "Arial Narrow", Consolas, monospace;
  font-stretch: condensed;
}

.sdkconfig-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid var(--line);
  background: #20293a;
  color: #d8e6f8;
  padding: 7px 12px;
  text-align: left;
  font: 12px/1.3 "Segoe UI", system-ui, sans-serif;
  text-transform: uppercase;
}

.sdkconfig-table td {
  border-bottom: 1px solid rgba(73, 86, 112, 0.72);
  padding: 4px 12px;
  vertical-align: middle;
}

.sdkconfig-table tbody tr {
  background: #151b26;
}

.sdkconfig-table tbody tr:nth-child(even) {
  background: #18202d;
}

.sdkconfig-table tbody tr:hover {
  background: #202a3b;
}

.sdkconfig-table th:nth-child(1),
.sdkconfig-table td:nth-child(1) {
  width: 420px;
}

.sdkconfig-table th:nth-child(2),
.sdkconfig-table td:nth-child(2) {
  width: 360px;
}

.sdkconfig-table th:nth-child(3),
.sdkconfig-table td:nth-child(3) {
  width: 76px;
  padding-left: 6px;
}

.sdkconfig-table tr.modified td {
  background: rgba(224, 164, 58, 0.16);
}

.sdkconfig-key {
  color: #6ee7ff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sdkconfig-table input {
  width: min(100%, 340px);
  min-width: 160px;
  height: 28px;
  border: 1px solid #44516a;
  border-radius: 5px;
  background: #101826;
  color: #f4f8ff;
  outline: 0;
  padding: 0 8px;
  font: inherit;
  font-stretch: condensed;
}

.sdkconfig-table input:focus {
  border-color: var(--primary);
}

.sdkconfig-table button {
  height: 26px;
  border: 1px solid #3a465d;
  border-radius: 5px;
  background: #263247;
  color: #c8d7eb;
  padding: 0 8px;
  cursor: pointer;
  font-size: 12px;
}

.sdkconfig-table button:disabled {
  opacity: 0.45;
  cursor: default;
}

.sdkconfig-empty {
  padding: 18px 14px;
  color: var(--muted);
}

.log-pane {
  grid-column: 3;
  grid-row: 3;
  min-height: 0;
  min-width: 0;
  border-top: 1px solid #303030;
  background: #1e1e1e;
  display: grid;
  grid-template-rows: auto 1fr;
}

.console-tabs {
  min-height: 40px;
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid #303030;
  background: #252526;
}

.console-tab {
  height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  border-right: 1px solid #303030;
  border-radius: 0;
  background: transparent;
  color: #cccccc;
  padding: 0 14px;
  font: 12px/1.35 Consolas, "Cascadia Mono", monospace;
  text-transform: uppercase;
}

.console-tab.active {
  background: #1e1e1e;
  color: #ffffff;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 9, 14, 0.72);
  backdrop-filter: blur(6px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: min(430px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #171b24;
  box-shadow: var(--shadow);
  padding: 24px;
}

.modal-card h2 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.35;
}

.modal-card p {
  margin: 10px 0 0;
  color: var(--muted);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.modal-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #202532;
  color: var(--text);
  padding: 0 14px;
  cursor: pointer;
  font-weight: 700;
}

.modal-button:hover {
  background: #283044;
}

.modal-button.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #06120d;
}

.feedback-action {
  width: auto;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
}

.feedback-card {
  width: min(560px, 100%);
}

.feedback-form {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.feedback-form label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.feedback-form label > span,
.feedback-form legend {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.feedback-form textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f1117;
  color: var(--text);
  padding: 10px;
  font: inherit;
}

.feedback-form fieldset {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}

.feedback-category-grid,
.feedback-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.feedback-category-grid label,
.feedback-check-grid label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.hidden-file-input {
  display: none;
}

.project-transfer-card {
  width: min(480px, 100%);
}

.format-options {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
}

.format-options legend {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.format-options label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.format-options input {
  width: 15px;
  height: 15px;
}

.feedback-status {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
}

.feedback-status.error {
  color: var(--danger);
}

.feedback-status.success {
  color: var(--primary);
}

.cloud-project-card {
  width: min(620px, 100%);
}

.cloud-project-list {
  max-height: 360px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
  background: #10141d;
}

.cloud-project-row {
  width: 100%;
  display: grid;
  gap: 3px;
  border: 0;
  border-bottom: 1px solid rgba(48, 55, 71, 0.65);
  background: transparent;
  color: var(--text);
  padding: 11px 12px;
  text-align: left;
  cursor: pointer;
}

.cloud-project-row:hover {
  background: rgba(63, 191, 143, 0.12);
}

.cloud-project-row strong {
  font-size: 14px;
}

.cloud-project-row span,
.cloud-project-empty {
  color: var(--muted);
  font: 12px/1.35 Consolas, "Cascadia Mono", monospace;
}

.cloud-project-empty {
  padding: 14px 12px;
}

.console-panel {
  min-height: 0;
  overflow: hidden;
  display: none;
}

.console-panel.active {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

#logOutput,
#problemsOutput,
#appOutput,
#serialOutput,
#artifactsOutput,
#searchOutput {
  margin: 0;
  min-height: 0;
  max-height: 100%;
  padding: 12px 14px;
  overflow: auto;
  contain: content;
  background: #1e1e1e;
  color: #d4d4d4;
  white-space: pre-wrap;
  font: 12px/1.35 Consolas, "Cascadia Mono", monospace;
  overflow-anchor: none;
}

#artifactsOutput {
  white-space: normal;
}

.artifacts-output {
  align-content: start;
}

.artifacts-table {
  width: min(760px, 100%);
  border-collapse: collapse;
  color: #d7e0ec;
  font: 12px/1.45 Consolas, "Cascadia Mono", monospace;
}

.artifacts-table th,
.artifacts-table td {
  height: 32px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.artifacts-table th {
  color: #9fb0c4;
  font-weight: 700;
  text-transform: uppercase;
}

.artifacts-table td:first-child {
  color: #f4f7fb;
  font-weight: 700;
}

.artifact-action {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 9px;
  border: 1px solid rgba(63, 191, 143, 0.45);
  border-radius: 4px;
  background: rgba(63, 191, 143, 0.12);
  color: #7ee7bd;
  font: 700 12px/1 Consolas, "Cascadia Mono", monospace;
  text-decoration: none;
  cursor: pointer;
}

.artifact-action:hover {
  background: rgba(63, 191, 143, 0.2);
}

.artifacts-empty {
  color: var(--muted);
  font: 12px/1.45 Consolas, "Cascadia Mono", monospace;
}

.search-panel.active {
  grid-template-rows: auto minmax(0, 1fr);
}

.search-box {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid #303030;
  background: #1e1e1e;
}

.search-box input[type="search"] {
  width: min(360px, 42vw);
  height: 28px;
  border-radius: 4px;
  font: 12px/1.35 Consolas, "Cascadia Mono", monospace;
  background: #252526;
  border-color: #3c3c3c;
  color: #d4d4d4;
}

.search-box label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #cccccc;
  font: 12px/1.35 Consolas, "Cascadia Mono", monospace;
}

.search-box label input {
  width: 14px;
  height: 14px;
}

.search-box button {
  height: 28px;
  padding: 0 10px;
}

.search-output {
  display: grid;
  align-content: start;
  gap: 0;
  white-space: normal;
  background: #1e1e1e;
}

.search-root-header {
  min-height: 22px;
  display: flex;
  align-items: center;
  color: #d4d4d4;
  font-weight: 700;
  padding: 2px 0 2px 0;
}

.search-file-group {
  display: grid;
  gap: 0;
}

.search-file-header {
  min-height: 22px;
  display: flex;
  align-items: center;
  padding: 2px 0 2px 14px;
  color: #d4d4d4;
  font-weight: 700;
}

.search-result-row {
  width: min(980px, 100%);
  min-height: 22px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #d4d4d4;
  padding: 1px 7px 1px 28px;
  column-gap: 8px;
  text-align: left;
  font: 12px/1.35 Consolas, "Cascadia Mono", monospace;
}

.search-result-row:hover {
  background: #2a2d2e;
}

.search-result-row:focus {
  background: #373737;
}

.search-result-row:focus-visible {
  outline: 1px solid #007acc;
  outline-offset: -1px;
}

.search-result-location {
  color: #858585;
  font-variant-numeric: tabular-nums;
  text-align: right;
  user-select: none;
}

.search-result-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: pre;
}

.search-match {
  border-radius: 0;
  background: #094771;
  color: #ffffff;
  padding: 0;
}

.problems-output {
  display: grid;
  align-content: start;
  gap: 0;
}

.problem-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
  gap: 12px;
  border: 0;
  border-bottom: 1px solid rgba(48, 55, 71, 0.55);
  background: transparent;
  color: inherit;
  padding: 6px 8px;
  text-align: left;
  font: inherit;
}

.problem-row.clickable {
  cursor: pointer;
}

.problem-row.clickable:hover {
  background: rgba(79, 140, 255, 0.14);
}

.problem-location {
  color: #4cc9f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.problem-message {
  color: #d7e0ec;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ansi-bold {
  font-weight: 700;
}

.ansi-fg-black {
  color: #6e7681;
}

.ansi-fg-red {
  color: #f85149;
}

.ansi-fg-green {
  color: #3fb950;
}

.ansi-fg-yellow {
  color: #d29922;
}

.ansi-fg-blue {
  color: #58a6ff;
}

.ansi-fg-magenta {
  color: #bc8cff;
}

.ansi-fg-cyan {
  color: #39c5cf;
}

.ansi-fg-white {
  color: #f0f6fc;
}

.ansi-fg-bright-black {
  color: #8b949e;
}

.ansi-fg-bright-red {
  color: #ff7b72;
}

.ansi-fg-bright-green {
  color: #56d364;
}

.ansi-fg-bright-yellow {
  color: #e3b341;
}

.ansi-fg-bright-blue {
  color: #79c0ff;
}

.ansi-fg-bright-magenta {
  color: #d2a8ff;
}

.ansi-fg-bright-cyan {
  color: #56d4dd;
}

.ansi-fg-bright-white {
  color: #ffffff;
}

.serial-log-error {
  color: #ff7b72;
}

.serial-log-warning {
  color: #e3b341;
}

.serial-log-info {
  color: #56d4dd;
}

.serial-log-debug {
  color: #8b949e;
}

.serial-log-verbose {
  color: #6e7681;
}

.ansi-bg-black {
  background: #161b22;
}

.ansi-bg-red {
  background: #da3633;
}

.ansi-bg-green {
  background: #238636;
}

.ansi-bg-yellow {
  background: #9e6a03;
}

.ansi-bg-blue {
  background: #1f6feb;
}

.ansi-bg-magenta {
  background: #8957e5;
}

.ansi-bg-cyan {
  background: #0980a5;
}

.ansi-bg-white {
  background: #c9d1d9;
}

.ansi-bg-bright-black {
  background: #30363d;
}

.ansi-bg-bright-red {
  background: #f85149;
}

.ansi-bg-bright-green {
  background: #3fb950;
}

.ansi-bg-bright-yellow {
  background: #d29922;
}

.ansi-bg-bright-blue {
  background: #388bfd;
}

.ansi-bg-bright-magenta {
  background: #bc8cff;
}

.ansi-bg-bright-cyan {
  background: #39c5cf;
}

.ansi-bg-bright-white {
  background: #f0f6fc;
}

.debug-panel {
  grid-template-rows: 1fr auto;
}

.debug-input-row {
  min-height: 36px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-top: 1px solid var(--line);
  color: var(--primary);
  font: 12px/1.45 Consolas, "Cascadia Mono", monospace;
}

#debugInput {
  width: 100%;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  font: inherit;
  outline: none;
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar {
    justify-content: flex-start;
  }

  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(110px, 24vh) minmax(0, 1fr) minmax(120px, 30vh);
  }

  .sidebar {
    grid-column: 1;
    grid-row: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .editor-pane,
  .log-pane {
    grid-column: 1;
  }

  .editor-pane {
    grid-row: 2;
  }

  .log-pane {
    grid-row: 3;
  }

  .splitter {
    display: none;
  }
}


.component-card {
  width: min(620px, 100%);
}


.component-list {
  max-height: 420px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
  background: #10141d;
}

.component-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(48, 55, 71, 0.65);
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  font: 13px/1.35 Consolas, "Cascadia Mono", monospace;
}

.component-row:hover,
.component-row:focus {
  background: rgba(63, 191, 143, 0.12);
  outline: 0;
}


.component-group {
  border-bottom: 1px solid rgba(48, 55, 71, 0.72);
}

.component-group:last-child {
  border-bottom: 0;
}

.component-group h3 {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0;
  border-bottom: 1px solid rgba(48, 55, 71, 0.72);
  background: #171b24;
  color: var(--primary);
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}
