/* Minor layout glue on top of uart.css, using the same palette */
.canvas-section {
  background: var(--darker-bg);
  border-radius: 8px;
  padding: 10px 20px 20px 20px;
  margin: 10px 20px 20px 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;
}

.toolbar .btn {
  padding: 8px 12px;
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s;
}
.toolbar .btn:hover {
  background: var(--primary-hover);
}
.toolbar .btn.secondary {
  background: #7f8c8d;
}
.toolbar .btn.secondary:hover {
  background: #95a5a6;
}
.toolbar .btn.danger {
  background: var(--danger-color);
}
.toolbar .btn.danger:hover {
  background: #c0392b;
}

/* Split layout reuses the visual language from UART terminals */
.canvas-split-container {
  display: flex;
  gap: 15px;
  height: calc(100vh - 220px);
  min-height: 380px;
}

.outliner {
  width: 305px;
  flex: 0 0 305px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.outliner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 8px 0;
  min-height: 20px;
  gap: 10px;
}

.outliner-title {
  margin: 0;
  color: var(--primary-color);
  font-size: 14px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.outliner-list {
  background: var(--dark-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  height: calc(100% - 0px);
  overflow-y: auto;
  padding: 6px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-color);
  user-select: none;
}
.file-item:hover {
  background: rgba(255, 255, 255, 0.06);
}
.file-item.active {
  background: rgba(26, 188, 156, 0.18);
  border: 1px solid rgba(26, 188, 156, 0.35);
}
.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.file-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}
.file-actions button {
  background: transparent;
  color: var(--muted-text);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.file-actions button:hover {
  color: var(--text-color);
  border-color: var(--primary-hover);
  background: rgba(255, 255, 255, 0.04);
}
.file-menu-btn {
  font-size: 18px;
  line-height: 1;
  padding-bottom: 2px;
}

.editor-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;

  min-height: 0;
}

.compile-wrap {
  width: 340px;
  flex: 0 0 340px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
}

.compile-panel {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.compile-body {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  background: var(--dark-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

.compile-target-row {
  min-width: 0;
}

.compile-target-row .compile-updi-target {
  min-width: 0;
}

.compile-target-row .compile-updi-target select {
  width: 100% !important;
  min-width: 0;
  max-width: none;
}

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 8px 0;
}
.editor-title {
  margin: 0;
  color: var(--primary-color);
  font-size: 14px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.editor-container {
  background: var(--dark-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

.editor-surface {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.compile-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

#compileBtn {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compile-toolbar .hex-status {
  flex: 0 0 auto;
  margin-left: auto;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.compile-toolbar .hex-status.download-ready {
  cursor: pointer;
}

.compile-toolbar .hex-status.download-ready:hover {
  background: rgba(26, 188, 156, 0.15);
}

.compile-log {
  flex: 1;
  min-height: 0;
  margin: 0;
  overflow: auto;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #d7f4ff;
  font:
    13px/1.5 ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    "Liberation Mono",
    monospace;
  white-space: pre-wrap;
}

.compile-log::-webkit-scrollbar {
  width: 8px;
}

.compile-log::-webkit-scrollbar-track {
  background: #2c3e50;
}

.compile-log::-webkit-scrollbar-thumb {
  background: #16a085;
  border-radius: 4px;
}

.compile-log {
  scrollbar-width: thin;
  scrollbar-color: #16a085 #2c3e50;
}

.flash-panel {
  background: var(--dark-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.flash-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.flash-toolbar {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex-wrap: wrap;
}

.flash-toolbar .connect-btn {
  flex: 1 1 140px;
  min-width: 0;
}

.flash-note {
  margin: 0;
  color: #ffd28c;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

#editorHost {
  flex: 1;
  min-height: 0;
}
.CodeMirror {
  height: 100%;
  width: 100%;
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 14px;
  background: var(--dark-bg);
  color: var(--text-color);
}
.cm-s-material-darker.CodeMirror {
  background: var(--dark-bg);
  color: var(--text-color);
}

@media (max-width: 900px) {
  .canvas-split-container {
    flex-direction: column;
    height: auto;

    min-height: 0;
  }
  .outliner {
    width: 100%;
    flex: 0 0 auto;
  }

  .compile-wrap {
    width: 100%;
    flex: 0 0 auto;
  }

  .compile-panel {
    min-height: 260px;
  }
}
/* 1) Запрет скролла у страницы (перебиваем uart.css) */
html,
body {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto !important;
}

body::-webkit-scrollbar {
  display: block;
  width: 10px;
}

body {
  -ms-overflow-style: auto;
  scrollbar-width: auto;
}

main,
.feature-panel {
  height: auto !important;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow: visible !important;
}

.feature-panel {
  max-height: none;
}

.feature-panel > .uart-section,
.feature-panel > .canvas-section {
  width: calc(100% - 40px);
  max-width: calc(100% - 40px);
  min-width: 0;
  margin-left: auto;
  margin-right: auto;
}

/* 2) Стили скролла как у .terminal-container (uart.html) */
/* CodeMirror filler squares (when both scrollbars are visible) */
.CodeMirror-scrollbar-filler,
.CodeMirror-gutter-filler {
  background: var(--dark-bg) !important;
  color: #2c3e50 !important;
  background-color: #2c3e50 !important;
}

/* === CodeMirror scrollbars styled like UART page === */
/* WebKit/Blink */
.CodeMirror-vscrollbar::-webkit-scrollbar {
  width: 8px;
}
.CodeMirror-hscrollbar::-webkit-scrollbar {
  height: 8px;
}
.CodeMirror-vscrollbar::-webkit-scrollbar-track,
.CodeMirror-hscrollbar::-webkit-scrollbar-track {
  background: var(--dark-bg);
}
.CodeMirror-vscrollbar::-webkit-scrollbar-thumb,
.CodeMirror-hscrollbar::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

/* Firefox */
.CodeMirror-vscrollbar,
.CodeMirror-hscrollbar {
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) var(--dark-bg);
}

.outliner-list::-webkit-scrollbar,
      .outliner-list::-webkit-scrollbar-track,
      .outliner-list::-webkit-scrollbar-thumb,
      /* Firefox */
      .outliner-list {
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) var(--dark-bg);
}

/* === Gutter same as canvas background (no separation) === */
.cm-s-material-darker .CodeMirror-gutters {
  background: var(--dark-bg) !important;
  border-right: none !important;
}
.cm-s-material-darker .CodeMirror-linenumber {
  background: transparent !important;
  color: var(--muted-text);
}
.cm-s-material-darker .CodeMirror-activeline-gutter {
  background: transparent !important;
}

/* New pseudo-file row for creating files */
.file-item.new-item {
  justify-content: center;
  gap: 6px;
  font-weight: 700;
  color: var(--primary-color);
  border: 1px dashed var(--border-color);
}
.file-item.new-item:hover {
  background: rgba(26, 188, 156, 0.1);
  border-color: var(--primary-color);
}
.file-item.new-item .file-name {
  flex: 0 0 auto;
}
/* GAP for file list items */
.outliner-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ——— Actions column ——— */
.actions {
  width: 140px;
  flex: 0 0 140px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.actions-body {
  background: var(--dark-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Кнопки в колонке действий */

/* Маленькие иконки внутри кнопок и в списке файлов */

/* На узких экранах Actions уезжает наверх отдельным блоком */
@media (max-width: 900px) {
  .actions {
    width: 100%;
    flex: 0 0 auto;
  }
}
/* === Canvas page (extracted) === */
/* Actions column buttons styled like file tiles */
.action-item {
  display: block;
  width: 100%;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  background: var(--dark-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  font-weight: 600;
  text-align: center;
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s;
}
.action-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--primary-hover);
  color: var(--text-color);
}
.action-item:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: grayscale(25%);
}
/* Keep small icon style for file list only */
.file-actions .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
}
.file-actions .icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.CodeMirror,
.CodeMirror-scroll {
  height: 100%;
}

/* Force CodeMirror theme background to match site (#2c3e50) */
.cm-s-material-darker.CodeMirror,
.cm-s-material-darker .CodeMirror-scroll,
.cm-s-material-darker .CodeMirror-gutters {
  background: var(--dark-bg) !important;
}
.cm-s-material-darker .CodeMirror-linenumber {
  color: var(--muted-text) !important;
}
.cm-s-material-darker .CodeMirror-activeline-background {
  background: rgba(255, 255, 255, 0.04) !important;
}
.cm-s-material-darker span.cm-comment {
  color: var(--muted-text) !important;
}
.cm-s-material-darker span.cm-number {
  color: #b5cea8 !important; /* VS Code number green */
}

/* === HEX Download button (canvas topbar) === */
.hex-panel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.hex-status {
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 12px;
  opacity: 0.85;
}
.hex-download.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 16px; /* arrow size */
  border-radius: 8px;
  border: 1px solid var(--ud-border, #3a3a3a);
  background: var(--ud-btn-bg, #1f1f1f);
  color: var(--ud-btn-fg, #e6e6e6);
  cursor: pointer;
  transition:
    transform 120ms ease,
    background 120ms ease,
    border-color 120ms ease,
    opacity 120ms ease;
  user-select: none;
  padding: 0;
  line-height: 1;
}
.hex-download.icon:disabled {
  opacity: 0.45;
  cursor: default;
}
.hex-download.icon:not(:disabled):hover {
  background: #262626;
  border-color: #4a4a4a;
  transform: translateY(-1px);
}
.hex-download.icon:not(:disabled):active {
  transform: translateY(0);
}

/* === Make HEX download button look exactly like file list buttons === */
.hex-panel .hex-download {
  background: transparent;
  color: var(--muted-text);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px !important;
  height: 28px;
  padding: 0;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.hex-panel .hex-download:hover {
  color: var(--text-color);
  border-color: var(--primary-hover);
  background: rgba(255, 255, 255, 0.04);
}

/* Bigger hex status (English only) */
.hex-status {
  font-size: 13px;
}

/* CodeMirror hints*/
.CodeMirror-hints {
  background: var(--dark-bg) !important;
  color: var(--text-color) !important;
  border: 1px solid var(--border-color) !important;
  max-height: 240px;
  overflow-y: auto;
}

/* WebKit/Blink */
.CodeMirror-hints::-webkit-scrollbar {
  width: 8px;
}
.CodeMirror-hints::-webkit-scrollbar-track {
  background: var(--dark-bg);
}
.CodeMirror-hints::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

/* Firefox */
.CodeMirror-hints {
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) var(--dark-bg);
}

.CodeMirror-hint {
  padding: 4px 8px;
  font-size: 13px;
  color: var(--text-color) !important;
}
.CodeMirror-hint-active {
  background: rgba(26, 188, 156, 0.18) !important;
  color: var(--text-color) !important;
}

/* HEX status pill */
.hex-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  min-height: 28px;
  border-radius: 4px;
  border: 1px solid var(--ud-border, #3a3a3a);
  background: var(--ud-btn-bg, #1f1f1f);
  color: var(--ud-btn-fg, #e6e6e6);
  font:
    600 12px/1 ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    "Liberation Mono",
    monospace;
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    background 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease;
}

.hex-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9aa7bd;
  position: relative;
}

/* States */
.hex-status.building {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.hex-status.building .dot {
  background: #f1c40f;
}
.hex-status.building .dot::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 2px dashed rgba(241, 196, 15, 0.6);
  animation: spin 1s linear infinite;
}
.hex-status.ready {
  opacity: 1;
  transform: translateY(0) scale(1);
  color: #c8ffdd;
  border-color: rgba(46, 204, 113, 0.4);
  background: rgba(46, 204, 113, 0.08);
  animation: pulseGlow 1.8s ease-out 2;
}
.hex-status.ready .dot {
  background: #2ecc71;
}
.hex-status.ready .dot::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(46, 204, 113, 0.6);
  animation: ring 1.8s ease-out 2;
}
.hex-status.error {
  opacity: 1;
  transform: translateY(0) scale(1);
  color: #ffd6d6;
  border-color: rgba(231, 76, 60, 0.5);
  background: rgba(231, 76, 60, 0.08);
}
.hex-status.error .dot {
  background: #e74c3c;
}

/* HEX-статус прямо в строке файла (список файлов) */
.file-actions .hex-status {
  cursor: default;
}

.file-actions .hex-status.download-ready {
  cursor: pointer;
}

.file-actions .hex-status.download-ready:hover {
  background: rgba(26, 188, 156, 0.15);
}

/* Button micro-animation when ready */
#hexDownloadBtn.ready {
  animation: bump 0.35s ease;
}

/* Shared file context menu for file actions */
.file-context-menu {
  position: fixed;
  z-index: 2000;
  min-width: 160px;
  background: var(--dark-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
  padding: 4px;
  display: none;
}

.file-context-menu button {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 6px 10px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-color);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}

.file-context-menu button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-color);
}

.file-context-menu button:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Keyframes */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes ring {
  from {
    transform: scale(0.5);
    opacity: 0.8;
  }
  to {
    transform: scale(1.5);
    opacity: 0;
  }
}
@keyframes pulseGlow {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(46, 204, 113, 0);
  }
  50% {
    box-shadow: 0 0 32px rgba(46, 204, 113, 0.18);
  }
}
@keyframes bump {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
  }
}

.secondary-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-color);
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--primary-hover);
}

.warning-btn {
  background: #d35400;
}

.warning-btn:hover {
  background: #e67e22;
}

.uart-section .connection-panel {
  min-width: 0;
}

.canvas-updi-target {
  min-width: 240px;
}

.canvas-updi-target select {
  min-width: 240px;
  max-width: 240px;
}

.canvas-updi-note {
  color: #ffd28c;
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  margin-left: auto;
  white-space: normal;
  text-align: right;
}

.canvas-updi-section {
  margin-top: 0;
}

.canvas-updi-section[hidden] {
  display: none !important;
}

.updi-layout {
  display: grid;
  grid-template-columns: minmax(300px, 1.25fr) minmax(260px, 1fr);
  gap: 18px;
}

.updi-pane-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.updi-pane {
  min-width: 0;
}

.updi-pane-header {
  margin-bottom: 8px;
  gap: 12px;
}

.updi-pane-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.updi-pane-body {
  background: var(--dark-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 14px;
}

.updi-pane-body-textarea {
  overflow: hidden;
  padding: 0;
}

.updi-pane-body:focus-within {
  border-color: var(--primary-hover);
}

.updi-status-inline {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted-text);
}

.updi-status-inline.disconnected {
  color: var(--muted-text);
}

.updi-status-inline.connected {
  color: var(--success-color);
}

.updi-status-inline.working {
  color: var(--warning-color);
}

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

.upload-label,
.divider-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted-text);
  font-size: 13px;
  font-weight: 600;
}

#hexFileInput {
  width: 100%;
  margin-bottom: 0;
  color: var(--text-color);
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

#hexFileInput::file-selector-button {
  margin-right: 12px;
  padding: 9px 14px;
  border: none;
  border-radius: 6px;
  background: var(--primary-color);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 120ms ease,
    background 120ms ease,
    opacity 120ms ease;
}

#hexFileInput::file-selector-button:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

#hexFileInput::-webkit-file-upload-button {
  margin-right: 12px;
  padding: 9px 14px;
  border: none;
  border-radius: 6px;
  background: var(--primary-color);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 120ms ease,
    background 120ms ease,
    opacity 120ms ease;
}

#hexFileInput::-webkit-file-upload-button:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.hex-textarea {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-height: 260px;
  resize: none;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text-color);
  padding: 14px;
  font:
    13px/1.45 ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    "Liberation Mono",
    monospace;
}

.hex-textarea:focus {
  outline: none;
}

.hex-textarea::-webkit-scrollbar,
.probe-log::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.hex-textarea::-webkit-scrollbar-track,
.probe-log::-webkit-scrollbar-track {
  background: var(--dark-bg);
}

.hex-textarea::-webkit-scrollbar-thumb,
.probe-log::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

.hex-textarea,
.probe-log {
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) var(--dark-bg);
}

.action-btn {
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  background: var(--primary-color);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 120ms ease,
    background 120ms ease,
    opacity 120ms ease;
}

.action-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.action-btn:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.ghost-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-color);
}

.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--primary-hover);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  margin: 0;
}

.summary-grid div {
  min-width: 0;
}

.summary-grid dt {
  margin: 0 0 4px;
  color: var(--muted-text);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.summary-grid dd {
  margin: 0;
  font:
    600 13px/1.4 ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    "Liberation Mono",
    monospace;
  word-break: break-word;
}

.summary-note {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted-text);
  font-size: 13px;
}

.summary-note.ok {
  color: #c8ffdd;
  background: rgba(39, 174, 96, 0.14);
}

.summary-note.error {
  color: #ffd6d6;
  background: rgba(231, 76, 60, 0.14);
}

.sib-box {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--dark-bg);
  color: #d7f4ff;
  font:
    13px/1.5 ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    "Liberation Mono",
    monospace;
  word-break: break-word;
}

.updi-log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 12px;
  gap: 12px;
}

.probe-log {
  margin: 0;
  min-height: 240px;
  max-height: 420px;
  overflow: auto;
  padding: 14px;
  border-radius: 4px;
  background: var(--dark-bg);
  border: 1px solid var(--border-color);
  color: #d7f4ff;
  font:
    13px/1.5 ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    "Liberation Mono",
    monospace;
  white-space: pre-wrap;
}

@media (max-width: 980px) {
  .updi-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .canvas-updi-note {
    width: 100%;
    margin-left: 0;
  }

  .updi-pane-header {
    align-items: stretch;
    flex-direction: column;
  }

  .updi-pane-actions {
    width: 100%;
  }

  .updi-log-header {
    align-items: stretch;
    flex-direction: column;
  }
}
