@import url('./base.css');
@import url('./shell-widgets.css');
@import url('./modals.css');
@import url('./chrome.css');
@import url('./links.css');
@import url('./help.css');

.hidden {
  display: none !important;
}

.artifacts-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
  background: var(--bg);
  color: var(--text);
}

.view-only-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--surface-2);
}

.view-only-badge--toolbar {
  margin-left: 0.25rem;
}

.presence-indicators {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: 0.15rem;
  color: var(--text-muted);
}

.presence-indicators[hidden] {
  display: none !important;
}

.presence-item {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  line-height: 1;
  cursor: default;
}

.presence-item[hidden] {
  display: none !important;
}

.presence-item--mcp .presence-icon {
  width: 18px;
  height: 18px;
}

.presence-icon {
  display: block;
  flex-shrink: 0;
  opacity: 0.9;
}

.presence-count {
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text);
}

.connect-hint {
  margin: 0;
  padding: 0.45rem 1.1rem;
  flex-shrink: 0;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
  border-bottom: 1px solid var(--border);
}

.artifacts-stage {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.artifacts-toolbar.canvas-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  min-height: 2.5rem;
  height: auto;
  padding: 0.35rem 0.75rem 0.35rem 0.5rem;
  box-sizing: border-box;
  gap: 0.35rem 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  position: relative;
  z-index: 20;
}

.artifacts-toolbar .canvas-toolbar__actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 0.35rem;
  min-height: 1.8rem;
}

.artifacts-toolbar .btn-sm {
  padding: 0.28rem 0.55rem;
  font-size: 0.72rem;
  min-height: 1.65rem;
}

.artifacts-toolbar .toolbar-dropdown__menu {
  min-width: 9rem;
}

.artifacts-canvas {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  overflow-anchor: none;
  position: relative;
  cursor: grab;
  touch-action: none;
  --zoom-text-boost: 1;
  --zoom-border-boost: 1;
  --grid-cell: 24px;
  --grid-x: 0px;
  --grid-y: 0px;
  background-color: var(--bg);
  background-image: radial-gradient(
    circle at 1px 1px,
    color-mix(in srgb, var(--text-muted) 28%, transparent) 1px,
    transparent 0
  );
  background-size: var(--grid-cell) var(--grid-cell);
  background-position: var(--grid-x) var(--grid-y);
}

.artifacts-canvas.is-panning {
  cursor: grabbing;
}

.artifacts-world {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
  overflow: visible;
}

.artifacts-nodes,
.artifacts-labels {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  min-width: 100%;
  min-height: 100%;
  overflow: visible;
}

.artifacts-labels {
  z-index: 3;
  pointer-events: none;
}

.artifacts-labels .graph-label {
  pointer-events: auto;
}

.artifacts-minimap {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  z-index: 9;
  width: 168px;
  height: 112px;
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  cursor: grab;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

.artifacts-minimap:active {
  cursor: grabbing;
}

.artifacts-minimap[hidden] {
  display: none !important;
}

.artifacts-minimap canvas {
  display: block;
  width: 168px;
  height: 112px;
}

.artifacts-links {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
  color: color-mix(in srgb, var(--text-muted) 85%, var(--primary));
}

.artifact-link-path {
  fill: none;
  stroke: currentColor;
  stroke-width: calc(1.75px * var(--zoom-border-boost, 1));
  opacity: 0.85;
}

.artifact-link-path.artifact-link-path--row-link {
  stroke-dasharray: 4 3;
  stroke-width: calc(1.2px * var(--zoom-border-boost, 1));
  opacity: 0.55;
  color: color-mix(in srgb, var(--text-muted) 60%, var(--border));
}

.artifact-link-path.is-link-highlighted {
  stroke-width: calc(3px * var(--zoom-border-boost, 1)) !important;
  opacity: 1 !important;
  color: var(--primary) !important;
  stroke-dasharray: none !important;
  filter: drop-shadow(0 0 3px color-mix(in srgb, var(--primary) 70%, transparent));
}

.artifacts-canvas.is-zoomed-out .artifact-link-path {
  opacity: 1;
}

.artifacts-canvas.is-zoomed-out .artifact-link-path.artifact-link-path--row-link {
  opacity: 0.8;
}

.artifact-link-note {
  fill: var(--text-muted);
  font-size: 11px;
  font-family: var(--font);
}

.artifacts-empty {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  padding: 2rem;
  max-width: none;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
}

.artifacts-empty.hidden {
  display: none !important;
}

.artifacts-empty h2 {
  margin: 0;
  font-size: 1.25rem;
}

.artifacts-empty p {
  margin: 0 0 0.75rem;
  max-width: 28rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.artifacts-empty .empty-state__actions {
  width: min(100%, 16rem);
}

/* Nodes */
.artifact-node {
  position: absolute;
  width: 220px;
  box-sizing: border-box;
  padding: 0.65rem 0.7rem 0.55rem;
  border-radius: 12px;
  border-style: solid;
  border-width: calc(1px * var(--zoom-border-boost, 1));
  border-color: var(--border);
  background: var(--surface);
  box-shadow: var(--card-shadow);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.artifact-node.is-dragging {
  cursor: grabbing;
  box-shadow: var(--card-shadow-hover);
  z-index: 5;
}

.artifact-node--document {
  border-color: color-mix(in srgb, #8b5cf6 45%, var(--border));
}

.artifact-node--document.artifact-node--format-doc {
  border-color: color-mix(in srgb, #3b82f6 55%, var(--border));
}

.artifact-node--document.artifact-node--format-xls {
  border-color: color-mix(in srgb, #22c55e 55%, var(--border));
}

.artifact-node--document.artifact-node--format-other {
  border-color: color-mix(in srgb, #8b5cf6 55%, var(--border));
}

.artifact-node--planned {
  border-style: dashed;
  opacity: 0.55;
}

.artifact-node--note {
  border-color: color-mix(in srgb, #f59e0b 45%, var(--border));
  background: color-mix(in srgb, #f59e0b 6%, var(--surface));
}

.artifact-node--package {
  border-color: color-mix(in srgb, #8b5cf6 45%, var(--border));
}

.artifact-node--registry {
  border-color: color-mix(in srgb, #06b6d4 50%, var(--border));
  background: color-mix(in srgb, #06b6d4 3%, var(--surface));
  min-width: 240px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
}

.artifact-node--registry .artifact-node__footer {
  margin-top: auto;
}

.artifact-node.is-resizing {
  user-select: none;
  box-shadow: var(--card-shadow-hover);
  z-index: 6;
}

.artifact-node__resizer {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  opacity: 0.4;
  border-bottom-right-radius: 4px;
  touch-action: none;
}

.artifact-node:hover .artifact-node__resizer {
  opacity: 0.85;
}

/* Registry table styling */
.artifact-registry-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 0.45rem 0 0.5rem;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: 6px;
  background: var(--surface);
  cursor: default;
}

.artifact-registry-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  line-height: 1.35;
  text-align: left;
}

.artifact-registry-row {
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  transition: background 0.15s ease;
  cursor: pointer;
}

.artifact-registry-row:hover {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}

.artifact-registry-row.is-row-selected {
  background: color-mix(in srgb, var(--primary) 22%, var(--surface)) !important;
  box-shadow: inset 3px 0 0 var(--primary);
}

.artifacts-connect-mode .artifact-registry-row:hover {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  cursor: pointer;
}

.artifact-registry-row--header {
  background: color-mix(in srgb, var(--text-muted) 12%, var(--surface));
  font-weight: 600;
  border-bottom: 2px solid var(--border);
}

.artifact-registry-table th,
.artifact-registry-table td {
  padding: 0.35rem 0.5rem;
  border-right: 1px solid color-mix(in srgb, var(--border) 45%, transparent);
  white-space: pre-wrap;
  word-break: break-word;
}

.artifact-registry-table th:last-child,
.artifact-registry-table td:last-child {
  border-right: none;
}

.artifact-registry-cell-text {
  display: inline-block;
  min-height: 1.1em;
}

.artifacts-canvas.is-zoomed-out .artifact-node--document.artifact-node--format-doc {
  border-color: color-mix(in srgb, #3b82f6 88%, var(--border));
}

.artifacts-canvas.is-zoomed-out .artifact-node--document.artifact-node--format-xls {
  border-color: color-mix(in srgb, #22c55e 88%, var(--border));
}

.artifacts-canvas.is-zoomed-out .artifact-node--document.artifact-node--format-other,
.artifacts-canvas.is-zoomed-out .artifact-node--document,
.artifacts-canvas.is-zoomed-out .artifact-node--package {
  border-color: color-mix(in srgb, #8b5cf6 88%, var(--border));
}

.artifacts-canvas.is-zoomed-out .artifact-node--note {
  border-color: color-mix(in srgb, #f59e0b 88%, var(--border));
}

.artifacts-canvas.is-zoomed-out .artifact-node__desc,
.artifacts-canvas.is-zoomed-out .artifact-node__footer,
.artifacts-canvas.is-zoomed-out .artifact-node__badge,
.artifacts-canvas.is-zoomed-out .graph-label__actions {
  display: none;
}

.artifacts-canvas.is-zoomed-far .artifact-node__icon {
  display: none;
}

.artifacts-add-float {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 8;
  width: max-content;
  margin: 0;
}

.artifacts-add-float > .btn {
  box-shadow: var(--card-shadow);
}

.artifacts-canvas.is-empty .artifacts-add-float {
  display: none;
}

.view-only .artifacts-add-float {
  display: none;
}

.artifacts-add-float .toolbar-dropdown__menu,
#empty-add-dropdown .toolbar-dropdown__menu {
  min-width: 9rem;
}

#empty-add-dropdown {
  position: relative;
}

#node-connections-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

#node-connections-list .modal-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.artifact-node__chrome {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}

.artifact-node__icon {
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1.3;
}

.artifact-node__titles {
  min-width: 0;
  flex: 1;
}

.artifact-node__title-row {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  min-width: 0;
}

.artifact-node__name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: calc(0.88rem * var(--zoom-text-boost, 1));
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.artifacts-canvas.is-zoomed-out .artifact-node__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifacts-canvas.is-zoomed-out .artifact-node {
  padding: calc(0.45rem * var(--zoom-text-boost, 1)) calc(0.55rem * var(--zoom-text-boost, 1));
}

.artifacts-canvas.is-zoomed-out .artifact-node__icon {
  font-size: calc(1rem * var(--zoom-text-boost, 1));
}

.artifact-node__badge {
  flex-shrink: 0;
  margin-top: 0.12rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.artifact-node__desc {
  margin: 0.4rem 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--text-muted);
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.artifact-node__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-top: 0.55rem;
  min-height: 1.4rem;
}

.artifact-node__link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.artifact-node__link-icon {
  display: block;
}

.artifact-node__link:hover {
  text-decoration: none;
  opacity: 0.85;
}

.artifact-node__actions,
.graph-label__actions {
  display: flex;
  gap: 0.15rem;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.artifact-node__chrome .artifact-node__actions {
  margin-left: auto;
  align-self: flex-start;
}

.artifact-node:hover .artifact-node__actions,
.graph-label:hover .graph-label__actions {
  opacity: 1;
}

.artifact-node__actions button,
.graph-label__actions button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

.artifact-node__actions button:hover,
.graph-label__actions button:hover {
  background: var(--surface-2);
  color: var(--text);
}

.view-only .artifact-node__actions,
.view-only .graph-label__actions {
  display: none;
}

/* Labels */
.graph-label {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: min(22rem, 70vw);
  padding: 0.25rem 0.45rem;
  border-radius: 6px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.graph-label.is-dragging {
  cursor: grabbing;
  z-index: 6;
}

.graph-label__text {
  font-size: calc(0.95rem * var(--zoom-text-boost, 1));
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  letter-spacing: 0.01em;
  text-shadow: 0 1px 0 color-mix(in srgb, var(--bg) 80%, transparent);
  max-width: calc(16rem * var(--zoom-text-boost, 1));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifacts-connect-mode .artifact-node {
  cursor: crosshair;
}

.artifacts-connect-mode .graph-label {
  pointer-events: none;
  opacity: 0.55;
}

body.artifacts-connect-mode {
  cursor: crosshair;
}

body.artifacts-connect-mode .artifacts-canvas {
  cursor: crosshair;
}

body.artifacts-connect-mode .artifacts-canvas.is-panning {
  cursor: grabbing;
}

.view-only #history-dropdown,
.history-preview-mode .artifacts-empty .empty-state__actions {
  display: none !important;
}

.history-preview-mode .artifacts-add-float {
  display: none !important;
}

.history-preview-mode #share-dropdown {
  pointer-events: none;
  opacity: 0.55;
}

.history-preview-mode #btn-new {
  pointer-events: none;
  opacity: 0.55;
}

/* —— Right artifacts list panel —— */
.artifacts-body {
  display: flex;
  flex: 1;
  min-height: 0;
  min-width: 0;
  position: relative;
}

.artifacts-list-panel {
  --artifacts-list-panel-width: min(320px, 38vw);
  width: var(--artifacts-list-panel-width);
  max-width: 50vw;
  min-width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  border-left: 1px solid var(--border);
  background: var(--surface);
  z-index: 12;
}

.artifacts-body.artifacts-list-panel--collapsed .artifacts-list-panel {
  display: none;
}

.artifacts-list-panel__width-resizer {
  position: absolute;
  top: 0;
  left: -3px;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  z-index: 2;
  background: transparent;
  transition: background 0.15s ease;
}

.artifacts-list-panel__width-resizer:hover,
.artifacts-list-panel__width-resizer.is-dragging {
  background: color-mix(in srgb, var(--primary) 35%, transparent);
}

.artifacts-list-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-shrink: 0;
  padding: 0.45rem 0.55rem 0.45rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.artifacts-list-panel__title {
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex: 1;
  min-width: 0;
}

.artifacts-list-panel__collapse,
.artifacts-list-panel-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.artifacts-list-panel__collapse:hover,
.artifacts-list-panel-toggle:hover {
  border-color: var(--primary);
  color: var(--text);
  background: color-mix(in srgb, var(--primary) 8%, var(--surface-2));
}

.artifacts-list-panel-toggle--expand {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  width: auto;
  min-height: 1.65rem;
  height: auto;
  padding: 0.28rem 0.65rem;
  white-space: nowrap;
}

.artifacts-list-panel-toggle--expand[hidden] {
  display: none !important;
}

.artifacts-list-panel-toggle__icon {
  display: block;
  flex-shrink: 0;
}

.artifacts-list-panel__filters {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex-shrink: 0;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.artifacts-list-panel__search {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 0.82rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}

.artifacts-list-panel__search:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.artifacts-list-panel__chips-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.55rem;
}

.artifacts-list-panel__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
}

.artifacts-list-panel__groupby-wrap {
  flex: 0 0 auto;
  margin-left: auto;
}

.artifacts-list-panel__groupby {
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.28rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  max-width: 9.5rem;
  cursor: pointer;
}

.artifacts-list-panel__groupby:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.artifacts-list-chip {
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.28rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
}

.artifacts-list-chip:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
}

.artifacts-list-chip.is-active {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
}

.artifacts-list-panel__list {
  list-style: none;
  margin: 0;
  padding: 0.35rem;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.artifacts-list-panel__list > li,
.artifacts-list-group__items > li,
.artifacts-list-tree__node {
  list-style: none;
}

.artifacts-list-item-row {
  display: flex;
  align-items: flex-start;
  gap: 0.15rem;
}

.artifacts-list-item {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  flex: 1;
  min-width: 0;
  text-align: left;
  padding: 0.5rem 0.45rem;
  margin: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.artifacts-list-item:hover {
  background: var(--surface-2);
}

.artifacts-list-item__icon {
  flex-shrink: 0;
  line-height: 1.35;
}

.artifacts-list-item__body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.artifacts-list-item__title-row {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  min-width: 0;
}

.artifacts-list-item__name {
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
  white-space: normal;
}

.artifacts-list-item__status {
  flex-shrink: 0;
  margin-top: 0.1rem;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--primary);
}

.artifacts-list-item__desc {
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.artifacts-list-item__link {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-top: 0.35rem;
  border-radius: 6px;
  color: var(--primary);
  text-decoration: none;
}

.artifacts-list-item__link:hover {
  background: var(--surface-2);
  opacity: 0.9;
}

.artifacts-list-item__link-icon {
  display: block;
}

/* Modal sizing */
#node-modal {
  max-width: 580px;
}

#node-modal form {
  max-width: 100%;
}

/* Registry modal editor */
.registry-fieldset {
  margin: 0.5rem 0;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.registry-editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.registry-header-checkbox-label {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  cursor: pointer;
  margin: 0;
}

.registry-editor-btn-group {
  display: flex;
  gap: 0.35rem;
}

.registry-editor-table-wrap {
  max-height: 240px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  box-sizing: border-box;
}

.registry-editor-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  table-layout: fixed;
}

.registry-editor-col-corner {
  display: none;
}

.registry-editor-th {
  width: 160px;
  min-width: 160px;
  padding: 0.35rem 0.45rem;
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  box-sizing: border-box;
}

.registry-editor-th__content {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.registry-editor-th__input {
  flex: 1;
  width: 100%;
  min-width: 80px;
  padding: 0.25rem 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  box-sizing: border-box;
}

.registry-editor-th__input:focus {
  border-color: var(--primary);
  background: var(--surface);
  outline: none;
}

.registry-editor-col-action {
  display: none;
}

.registry-editor-tr {
  border-bottom: 1px solid var(--border);
}

.registry-editor-tr--header {
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
  font-weight: 600;
}

.registry-editor-td-num {
  display: none;
}

.registry-editor-td {
  width: 160px;
  min-width: 160px;
  padding: 0.25rem 0.45rem;
  border-right: 1px solid var(--border);
  box-sizing: border-box;
}

.registry-editor-td:last-child,
.registry-editor-th:last-child {
  border-right: none;
}

.registry-editor-cell__input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.3rem 0.45rem;
  font-size: 0.82rem;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
}

.registry-editor-cell__input:focus {
  border-color: var(--primary);
  background: var(--surface);
  outline: none;
}

.registry-editor-cell__input--header {
  font-weight: 600;
}

.registry-editor-td-action {
  display: none;
}

.registry-editor-remove-btn {
  display: none;
}

.artifacts-list-group {
  margin: 0 0 0.45rem;
}

.artifacts-list-group__title {
  padding: 0.35rem 0.5rem 0.2rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.artifacts-list-group__items,
.artifacts-list-tree {
  list-style: none;
  margin: 0;
  padding: 0;
}

.artifacts-list-tree {
  margin-left: 0.85rem;
  padding-left: 0.55rem;
  border-left: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
}

.artifacts-list-mark {
  background: color-mix(in srgb, var(--primary) 28%, transparent);
  color: inherit;
  border-radius: 2px;
  padding: 0 0.05em;
}

.artifacts-list-panel__empty {
  margin: 0;
  padding: 0.75rem 1rem 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.artifact-node.is-list-focused {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: var(--card-shadow-hover);
  z-index: 6;
}

.artifact-node.is-link-highlighted {
  outline: 2.5px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 12px color-mix(in srgb, var(--primary) 40%, transparent), var(--card-shadow-hover);
  border-color: var(--primary) !important;
  z-index: 5;
}
