* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;

  --bg: #081017;
  --panel: #0b141c;
  --panel2: #101b25;
  --border: #22303c;

  --text: #e6edf3;
  --muted: #8795a1;

  --green: #18d6a3;
  --blue: #278cff;
  --purple: #9b5cff;
  --yellow: #e5c500;
  --red: #f85149;

  /* Verbindliche Node-Palette für Legende, Graph und Minimap. */
  --node-target: #278cff;
  --node-action: #18d6a3;
  --node-service: #9b5cff;
  --node-application: #ff8f3d;
  --node-finding: #e5c500;
  --node-vulnerability: #f85149;
  --node-info: #20c4d9;

  --color-focus: #6ee7c8;
  --color-info: #67adff;
  --color-success: #18d6a3;
  --color-warning: #e5c500;
  --color-danger: #f85149;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --control-height-sm: 28px;
  --control-height-md: 32px;
  --toolbar-height: 48px;
  --icon-size-sm: 16px;
  --icon-size-md: 20px;
  --transition-fast: 0.15s ease;
  --font-size-xs: 12px;
  --font-size-sm: 12px;
  --font-size-md: 13px;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --form-label-color: #c8d1d8;
  --form-label-size: 12px;
  --form-label-weight: 600;
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--color-focus);
  --sidebar-width: 260px;
  --inspector-width: 360px;
  --scrollbar-size: 12px;
  --scrollbar-track: #0a151c;
  --scrollbar-thumb: #4d6677;
  --scrollbar-thumb-hover: #688396;
  --scrollbar-thumb-active: #7d99aa;
}

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

  font-family: Inter, system-ui, sans-serif;

  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

/* Low-specificity defaults keep every native control in the dark theme while
   still allowing component styles to override them. */
:where(
  input:not([type]),
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  input[type="url"],
  input[type="number"],
  input[type="tel"],
  input[type="date"],
  input[type="datetime-local"],
  select,
  textarea
) {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #081017;
  color: var(--text);
}

:where(input, textarea)::placeholder {
  color: #7f909b;
  opacity: 1;
}

select,
select option,
select optgroup {
  background-color: #081017;
  color: var(--text);
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--green);
}

button {
  border: 1px solid #263844;
  border-radius: 5px;
  background: #0d1a23;
  color: #bac7d0;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

button:active {
  transform: translateY(1px);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 0;
  box-shadow: var(--focus-ring);
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 10000;
  padding: 8px 12px;
  transform: translateY(-160%);
  border-radius: 6px;
  background: var(--green);
  color: #02100c;
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

.node-relations {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.node-relations-empty {
  margin: 0;
  color: var(--muted);
  font-size: var(--font-size-xs);
}

.node-relation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.node-relation-open,
.node-relation-unlink {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--panel2);
  color: var(--text);
  font-size: var(--font-size-xs);
}

.finding-summary {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel2);
}

.finding-summary-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.finding-summary-heading > span {
  color: var(--muted);
  font-size: var(--font-size-xs);
}

.finding-summary-heading > button {
  margin-left: auto;
}

.finding-severity {
  padding: 3px 6px;
  border-radius: 999px;
  text-transform: uppercase;
}

.finding-severity-critical,
.finding-severity-high {
  color: #ff8f8f;
}

.finding-severity-medium {
  color: var(--yellow);
}

.finding-severity-low,
.finding-severity-info {
  color: var(--color-info);
}

.finding-summary-field strong {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
}

.finding-summary-field p {
  margin: 3px 0 0;
  white-space: pre-wrap;
}

.finding-summary-missing {
  color: var(--muted);
  font-style: italic;
}

.node-relation-open {
  overflow: hidden;
  padding: 6px 8px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-relation-unlink {
  padding: 6px;
  color: var(--red);
}

.mobile-unsupported {
  display: none;
}

.ui-empty-state,
.pentest-manager-empty,
.graph-search-empty,
.tool-recommendation-empty,
.tool-detail-empty,
.tool-list-empty,
.command-output-empty,
.properties-empty,
.admin-empty {
  color: var(--muted);
  line-height: 1.5;
}

.ui-icon-button,
.property-edit-button,
.property-delete-button,
.property-managed-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ui-status,
.admin-status,
.notes-save-status {
  min-height: 18px;
  color: var(--muted);
  font-size: var(--font-size-sm);
}

.ui-status.success {
  color: var(--color-success);
}
.ui-status.error {
  color: #ff718a;
}

.ui-tooltip {
  position: fixed;
  z-index: 10000;
  max-width: min(280px, calc(100vw - 16px));
  padding: 6px 8px;
  border: 1px solid #314653;
  border-radius: var(--radius-sm);
  background: #111e27;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  color: var(--text);
  font-size: var(--font-size-sm);
  line-height: 1.35;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.ui-tooltip.visible {
  opacity: 1;
  visibility: visible;
}

/* =========================================================
   APP
========================================================= */

.app {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;

  display: grid;

  padding-top: var(--toolbar-height);

  grid-template-columns:
    var(--sidebar-width)
    6px
    minmax(0, 1fr)
    6px
    var(--inspector-width);
}

/* Do not reveal the workspace structure before the backend has confirmed an
   authenticated session. The matching inert/aria-hidden attributes are
   removed only by auth-view after successful authentication. */
body.auth-pending .app,
body.auth-pending .skip-link {
  display: none;
}

.auth-startup-status {
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 100;
  width: min(430px, calc(100vw - 32px));
  padding: 30px 36px 34px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(130, 169, 189, 0.32);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 0, rgba(24, 214, 163, 0.08), transparent 40%),
    #0a131a;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.68);
  text-align: center;
}

.auth-startup-status .auth-brand {
  margin-bottom: 26px;
}

.auth-startup-status h1 {
  margin: 8px 0 0;
  color: #f1f6f8;
  font-size: 26px;
  font-weight: 680;
  letter-spacing: -0.025em;
}

.auth-startup-status p {
  margin: 10px auto 0;
  max-width: 34ch;
  color: #91a2ad;
  font-size: 13px;
  line-height: 1.6;
}

.auth-startup-status.hidden {
  display: none;
}

.panel-resizer {
  position: relative;
  top: calc(-1 * var(--toolbar-height));
  z-index: 150;
  width: 6px;
  height: calc(100% + var(--toolbar-height));
  background: transparent;
  cursor: col-resize;
  touch-action: none;
}

.panel-resizer::after {
  content: "";
  position: absolute;
  inset: 0 2px;
  background: transparent;
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.panel-resizer:hover::after,
.panel-resizer:focus-visible::after,
body.panel-resizing .panel-resizer.active::after {
  background: var(--green);
  box-shadow: 0 0 8px rgba(24, 214, 163, 0.35);
}

.panel-resizer:focus-visible {
  outline: 0;
}
body.panel-resizing {
  cursor: col-resize;
  user-select: none;
}

/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
  padding: 16px 12px;

  overflow-y: auto;

  background: #091219;

  border-right: 1px solid var(--border);
}

.sidebar-title {
  margin-bottom: 12px;

  color: var(--muted);

  font-size: 12px;
  letter-spacing: 0.1em;
}

.phase {
  width: 100%;
  display: flex;
  align-items: center;

  gap: 8px;

  margin-bottom: 5px;

  padding: 7px 8px;

  border-radius: 6px;

  border: 0;
  border-left: 3px solid transparent;

  background: transparent;

  color: var(--muted);

  font: inherit;
  text-align: left;
  cursor: pointer;
  /* Phase selection is navigational state and must switch without the
     previous and next phase looking active at the same time. */
  transition: none;
}

.property-managed-indicator {
  border: 1px solid rgba(130, 169, 189, 0.24);
  background: rgba(130, 169, 189, 0.04);
  color: var(--muted);
  font-size: 12px;
  cursor: help;
}

.phase:hover {
  background: #101d26;
  color: white;
}

.phase:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.phase-count {
  min-width: 22px;
  margin-left: auto;
  padding: 2px 6px;
  border: 1px solid #293b47;
  border-radius: 999px;
  background: #0d1820;
  color: #9eacb7;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.phase-status-summary {
  margin-left: auto;
  color: #79909f;
  font-size: 12px;
  font-weight: 700;
}

.phase-status-summary.has-active {
  color: #67adff;
}

.phase-status-summary + .phase-count {
  margin-left: 0;
}

.phase.active .phase-count {
  border-color: rgba(24, 214, 163, 0.35);
  color: var(--green);
}

.phase.active {
  background: #14232d;

  color: white;

  border-left-color: var(--green);
}

.phase.completed {
  color: var(--green);
}

.sidebar-tools-title {
  margin-top: 26px;
}

.sidebar-module-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.sidebar-module-button:hover,
.sidebar-module-button.active {
  background: #14232d;
  color: white;
}

.sidebar-module-button.active {
  border-left: 3px solid var(--blue);
}

.edge-inspector-detail {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid #18242d;
  color: var(--muted);
  font-size: 12px;
}

.edge-inspector-detail:last-child {
  border-bottom: 0;
}

.edge-inspector-detail strong {
  color: var(--text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

#edge-relation-type {
  border-color: rgba(24, 214, 163, 0.35);
  color: var(--green);
}

#edge-direction-badge {
  border-color: rgba(39, 140, 255, 0.35);
  color: #67adff;
}

.edge-delete-button {
  width: 100%;
  margin-top: 8px;
}

/* =========================================================
   WORKSPACE
========================================================= */

.workspace {
  position: relative;

  container-type: inline-size;

  min-width: 0;
  min-height: 0;

  overflow: hidden;

  display: flex;
  flex-direction: column;

  background-color: #091119;

  background-image: radial-gradient(
    rgba(255, 255, 255, 0.08) 1px,
    transparent 1px
  );

  background-size: 20px 20px;
}

.workspace-progress {
  position: fixed;
  z-index: 1200;
  top: var(--toolbar-height);
  left: 0;
  width: 100%;
  height: 3px;
  overflow: hidden;
  background: rgba(24, 214, 163, 0.14);
}

.workspace-progress::after {
  content: "";
  display: block;
  width: 35%;
  height: 100%;
  background: var(--green);
  animation: workspace-progress 1s ease-in-out infinite;
}

@keyframes workspace-progress {
  from {
    transform: translateX(-110%);
  }
  to {
    transform: translateX(320%);
  }
}

#graph:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: -3px;
}

/* =========================================================
   TOOLBAR
========================================================= */

.toolbar {
  position: fixed;
  inset: 0 0 auto 0;
  width: 100vw;
  height: var(--toolbar-height);

  flex-shrink: 0;

  display: grid;
  grid-template-columns:
    var(--sidebar-width)
    6px
    minmax(0, 1fr)
    6px
    var(--inspector-width);
  align-items: center;

  padding: 0;

  background: rgba(9, 18, 25, 0.96);

  border-bottom: 1px solid var(--border);

  z-index: 100;
}

.toolbar-actions {
  display: flex;
  align-items: center;

  gap: 6px;

  margin-left: auto;
  flex: 0 0 auto;
}

.toolbar-brand {
  grid-column: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-right: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.toolbar-brand span {
  color: var(--green);
}

.toolbar-context-cell {
  grid-column: 3;
  align-self: stretch;
  min-width: 0;
  container-type: inline-size;
}

.toolbar-context {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  overflow: hidden;
  padding-left: 12px;
  background: rgba(9, 18, 25, 0.96);
}

.inspector-toolbar-zone {
  grid-column: 5;
  min-width: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  border-left: 0;
  background: rgba(9, 18, 25, 0.96);
}

.toolbar .header-report-button {
  align-self: center;
  height: var(--control-height-md);
  padding: 0 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.toolbar .header-report-button:hover {
  border-bottom-color: #445866;
  color: var(--text);
}

#pentest-name {
  overflow: hidden;

  min-width: 12ch;

  font-size: 12px;
  font-weight: 700;

  white-space: nowrap;
  text-overflow: ellipsis;
}

.pentest-switch-button {
  display: flex;
  align-items: center;
  gap: 7px;
  height: var(--control-height-md);
  max-width: 260px;
  padding-inline: 8px !important;
  border: 0 !important;
  border-bottom: 2px solid var(--blue) !important;
  border-radius: 0 !important;
  background: transparent !important;
  text-align: left;
}
.pentest-switch-button:hover {
  background: rgba(39, 140, 255, 0.07) !important;
}
.pentest-switch-button > span:first-of-type {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
}
.pentest-switch-button > span:last-of-type {
  color: var(--muted);
}

.view-navigation-button {
  white-space: nowrap;
}

.navigation-label-compact {
  display: none;
}

.project-access-state {
  align-self: center;
  border: 1px solid var(--color-warning);
  border-radius: var(--radius-lg);
  color: var(--color-warning);
  font-size: var(--font-size-xs);
  font-weight: 700;
  padding: 2px 6px;
  text-transform: uppercase;
}
.pentest-manager-dialog {
  width: min(680px, calc(100vw - 32px));
}
.pentest-manager-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: calc(100dvh - 32px);
}
.pentest-manager-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}
.pentest-manager-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.pentest-manager-quota {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}
.pentest-manager-quota.at-limit {
  color: #f6c453;
}
.pentest-manager-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid #22323d;
  border-radius: 7px;
  background: #09131a;
}
.pentest-manager-row.active {
  border-color: rgba(24, 214, 163, 0.5);
  background: rgba(24, 214, 163, 0.045);
}
.pentest-manager-select {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 11px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.pentest-manager-select span {
  color: var(--muted);
  font-size: 12px;
}
.pentest-manager-select small {
  color: #6fa8c8;
  font-size: 12px;
}
.pentest-manager-actions {
  display: flex;
  gap: 4px;
  padding-right: 8px;
}
.pentest-manager-empty {
  padding: 35px 15px;
  color: var(--muted);
  text-align: center;
}
.pentest-editor-form {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 0;
  border: 1px solid rgba(39, 140, 255, 0.35);
  border-radius: 7px;
  background: rgba(39, 140, 255, 0.04);
}
.pentest-editor-form:not(.hidden) {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}
.pentest-editor-form > input[type="hidden"] {
  display: none;
}
.pentest-editor-fields {
  min-height: 0;
  padding: 14px;
  overflow-y: auto;
}
.pentest-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  padding: 10px 14px;
  border-top: 1px solid rgba(39, 140, 255, 0.25);
  background: #0b171f;
}
.pentest-editor-actions .dialog-secondary-button,
.pentest-editor-actions .dialog-primary-button {
  width: auto;
}
.admin-projects-button {
  margin-right: auto;
}
.pentest-manager-dialog .node-dialog-footer {
  flex-wrap: wrap;
}
.pentest-manager-footer {
  justify-content: flex-start;
}
.pentest-manager-footer .dialog-secondary-button,
.pentest-manager-footer .dialog-primary-button {
  min-width: 88px;
}
.pentest-manager-footer #pentest-manager-new {
  margin-left: auto;
}
.pentest-manager-footer #pentest-manager-guided-sample:not(.hidden) {
  margin-left: auto;
}
.pentest-manager-footer
  #pentest-manager-guided-sample:not(.hidden)
  + #pentest-manager-new {
  margin-left: 0;
}
.pentest-import-dialog {
  width: min(540px, calc(100vw - 32px));
}
.pentest-import-summary {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid rgba(24, 214, 163, 0.35);
  border-radius: 7px;
  background: rgba(24, 214, 163, 0.05);
  color: #9cebd5;
}
.report-dialog {
  width: min(1100px, calc(100vw - 32px));
}
.report-dialog[open] {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  height: min(780px, calc(100dvh - 32px));
}
.report-dialog > form {
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.report-dialog-body {
  display: grid;
  min-height: 0;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 12px;
}
.report-controls {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding-right: 4px;
}

.report-controls details textarea {
  min-height: 96px;
}

.report-metadata-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.report-controls label,
.report-controls fieldset {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.report-controls label {
  color: var(--form-label-color);
  font-size: var(--form-label-size);
  font-weight: var(--form-label-weight);
}
.report-controls fieldset label {
  flex-direction: row;
  align-items: center;
}

.report-option-group {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

#report-format,
#report-template,
#graph-search-input,
.graph-search-filters select {
  min-height: var(--control-height-sm);
}
.report-exclusion-summary {
  min-height: 2.8em;
  margin: 0;
  color: var(--muted);
  font-size: var(--font-size-sm);
  line-height: 1.4;
}
.report-preview {
  width: 100%;
  height: 100%;
  border: 1px solid #253641;
  border-radius: 7px;
  background: white;
}
.graph-search-dialog {
  width: min(680px, calc(100vw - 32px));
}
.graph-search-input-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border: 1px solid #29404e;
  border-radius: 7px;
  background: #071016;
}
.graph-search-input-wrap input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}
.graph-search-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.graph-search-filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.graph-search-filters select {
  min-width: 0;
}
.graph-search-results {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: min(55vh, 520px);
  margin-top: 12px;
  overflow-y: auto;
}
.graph-search-result {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid #1d303b;
  border-radius: 6px;
  background: #0a151c;
  color: var(--text);
  text-align: left;
}
.graph-search-result:hover,
.graph-search-result:focus-visible {
  border-color: #278cff;
  background: rgba(39, 140, 255, 0.08);
}
.graph-search-result span {
  color: #76a8c4;
  font-size: 12px;
  text-transform: uppercase;
}
.graph-search-result small {
  color: var(--muted);
}
.graph-search-empty {
  padding: 30px;
  color: var(--muted);
  text-align: center;
}
.property-editor-dialog {
  width: min(860px, calc(100vw - 32px));
}
.property-editor-head,
.property-editor-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 110px minmax(220px, 2fr) 38px;
  gap: 8px;
  align-items: center;
}
.property-editor-head {
  margin: 12px 0 5px;
  color: var(--muted);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
}
.property-editor-rows {
  display: grid;
  gap: 7px;
  margin-bottom: 10px;
}
.property-editor-row input,
.property-editor-row select {
  width: 100%;
  min-width: 0;
}
.property-editor-remove {
  color: var(--danger);
}
.duplicate-nodes-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.duplicate-node-group {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel2);
}
.duplicate-node-group fieldset {
  display: grid;
  gap: 6px;
  margin: 8px 0;
}
.duplicate-node-option {
  display: flex;
  gap: 8px;
  align-items: center;
}
.tool-recommendations {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 9px;
}

.recommendation-panel > summary {
  cursor: pointer;
  list-style-position: outside;
}

.recommendation-panel:not([open]) {
  padding-bottom: 12px;
}
.tool-recommendation-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px;
  border: 1px solid #223842;
  border-radius: 6px;
  background: #09141a;
}
.tool-recommendation-card > span {
  color: #75a8c3;
  font-size: 12px;
}
.tool-recommendation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 3px;
}
.tool-recommendation-empty {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.finding-fields {
  display: grid;
  gap: 10px;
  margin: 4px 0 14px;
  padding: 12px;
  border: 1px solid rgba(255, 168, 76, 0.35);
  border-radius: 7px;
}
.finding-fields legend {
  padding: 0 6px;
  color: #ffb361;
  font-size: 12px;
  text-transform: uppercase;
}
.evidence-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 9px;
}
.evidence-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px;
  border: 1px solid #263b46;
  border-radius: 6px;
  background: #081319;
  overflow: hidden;
}
.evidence-card img {
  width: 100%;
  max-height: 180px;
  border-radius: 4px;
  object-fit: contain;
  background: #020609;
}
.evidence-card span {
  color: var(--muted);
  font-size: 12px;
}
.evidence-card strong {
  overflow-wrap: anywhere;
}
.evidence-card code {
  overflow-wrap: anywhere;
  color: #6da5bf;
  font-size: 12px;
}
.evidence-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
}
.evidence-actions a {
  width: auto;
  padding: 5px 8px;
  text-decoration: none;
}

.toolbar button {
  padding: 8px 14px;

  border: 1px solid var(--border);

  border-radius: 5px;

  background: var(--panel);

  color: var(--text);

  cursor: pointer;
}

.toolbar button:hover {
  border-color: var(--green);
}

#add-node-button,
#scan-import-button,
#graph-search-button,
#duplicate-nodes-button,
#report-button,
#add-relation-button,
#delete-relation-button,
#toggle-notes-dock-button,
#toggle-node-content-fullscreen,
.node-actions-menu > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

#add-node-button::before,
#scan-import-button::before,
#graph-search-button::before,
#duplicate-nodes-button::before,
#report-button::before,
#add-relation-button::before,
#delete-relation-button::before,
#toggle-notes-dock-button::before,
#toggle-node-content-fullscreen::before,
.node-actions-menu > summary::before {
  content: "";
  flex: 0 0 auto;
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
  background: currentColor;
  mask: var(--button-icon) center / contain no-repeat;
}

#add-node-button,
#add-relation-button {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5v14M5 12h14' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

#scan-import-button {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 4v11M8 11l4 4 4-4M5 19h14M4 7V4h3M20 7V4h-3' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

#graph-search-button {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='6' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='m16 16 4 4' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

#duplicate-nodes-button {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='4' y='4' width='10' height='10' rx='2' fill='none' stroke='black' stroke-width='2'/%3E%3Crect x='10' y='10' width='10' height='10' rx='2' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E");
}

#report-button {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 3h9l4 4v14H6zM15 3v5h4M9 13h6M9 17h6' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E");
}

#add-relation-button {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 15 15 9M7 17l-1 1a3 3 0 0 1-4-4l4-4a3 3 0 0 1 4 0M17 7l1-1a3 3 0 0 1 4 4l-4 4a3 3 0 0 1-4 0' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

#delete-relation-button {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m9 15 6-6M8 18l-2 2a3 3 0 0 1-4-4l4-4M16 6l2-2a3 3 0 0 1 4 4l-4 4M4 4l16 16' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

#toggle-notes-dock-button {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 5h14v14H5zM5 14h14M9 10l3 3 3-3' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E");
}

#toggle-node-content-fullscreen {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 3H3v5M16 3h5v5M8 21H3v-5M16 21h5v-5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.node-actions-menu > summary {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='5' r='2'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3Ccircle cx='12' cy='19' r='2'/%3E%3C/svg%3E");
  font-size: 0;
}

#toggle-notes-dock-button,
#toggle-node-content-fullscreen {
  width: auto;
  min-width: var(--control-height-sm);
  padding: 0 8px;
  font-size: var(--font-size-xs);
}

@container (max-width: 760px) {
  .toolbar-context {
    gap: 4px;
  }
  .navigation-label-full {
    display: none;
  }
  .navigation-label-compact {
    display: inline;
  }
  .pentest-switch-button {
    max-width: 130px;
    padding-inline: 7px !important;
  }
  .toolbar .view-navigation-button {
    min-width: 56px;
    padding-inline: 6px;
  }
  .toolbar-actions {
    gap: 4px;
  }
  .toolbar-actions button {
    padding-inline: 9px;
  }
  .toolbar-actions kbd {
    display: none;
  }
  .session-controls {
    gap: 5px;
  }
  .account-menu-button {
    padding-inline: 7px !important;
  }
}

@container (max-width: 520px) {
  .toolbar-context {
    gap: 3px;
    padding-left: 4px;
  }
  .pentest-switch-button {
    max-width: 100px;
  }
  .workspace-actions {
    gap: 3px;
    margin-left: 3px;
    padding-left: 3px;
  }
}

@media (max-width: 1100px) {
  :root {
    --sidebar-width: 220px;
    --inspector-width: 300px;
  }

  .toolbar-context {
    gap: 5px;
    padding-left: 7px;
  }

  .pentest-switch-button {
    max-width: 120px;
  }

  .navigation-label-full {
    display: none;
  }

  .navigation-label-compact {
    display: inline;
  }

  .toolbar .view-navigation-button {
    min-width: 52px;
    padding-inline: 6px;
  }

  .toolbar .workspace-action-button {
    padding-inline: 7px;
  }

  .toolbar #add-node-button,
  .toolbar #scan-import-button,
  .toolbar #graph-search-button,
  .toolbar #duplicate-nodes-button {
    width: var(--control-height-md);
    padding-inline: 0;
    font-size: 0;
  }

  .session-controls,
  .account-menu-button {
    max-width: 100%;
    min-width: 0;
  }

  .account-menu-button #current-user-label {
    max-width: 72px;
  }

  .account-menu-button #current-user-role {
    display: none;
  }
}

@media (max-width: 899px) {
  .toolbar-brand {
    padding-inline: 8px;
    font-size: 0;
  }

  .toolbar-brand::before {
    content: "PN";
    color: var(--green);
    font-size: 12px;
    letter-spacing: 0.08em;
  }

  .sidebar {
    padding-inline: 6px;
  }

  .sidebar-title {
    font-size: 12px;
  }

  .phase {
    gap: 5px;
    padding-inline: 5px;
  }

  .phase > span:nth-child(2) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .phase-status-summary {
    display: none;
  }

  .inspector {
    padding-inline: 9px;
  }

  .inspector-toolbar-zone {
    gap: 2px;
    padding-inline: 4px;
  }

  .toolbar .header-report-button {
    width: auto;
    padding: 0 8px;
    font-size: var(--font-size-xs);
  }

  #current-user-role {
    display: none;
  }

  #current-user-label {
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* =========================================================
   RELATION MODE
========================================================= */

.relation-mode-banner {
  flex: 0 0 auto;

  min-height: 42px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;

  padding: 7px 14px;

  background: rgba(39, 140, 255, 0.12);

  border-bottom: 1px solid var(--blue);

  color: #9bcaff;

  font-size: 13px;

  z-index: 90;
}

#relation-mode-text {
  overflow: hidden;

  white-space: nowrap;
  text-overflow: ellipsis;
}

#cancel-relation-button {
  flex: 0 0 auto;

  padding: 6px 10px;

  border: 1px solid var(--blue);

  border-radius: 5px;

  background: rgba(39, 140, 255, 0.08);

  color: #9bcaff;

  cursor: pointer;
}

#cancel-relation-button:hover {
  background: rgba(39, 140, 255, 0.18);

  color: white;
}

/* =========================================================
   GRAPH
========================================================= */

.graph {
  position: relative;

  flex: 1 1 auto;

  width: 100%;

  min-width: 0;
  min-height: 0;

  overflow: hidden;
}

.graph-node-tooltip {
  position: absolute;
  z-index: 20;
  display: grid;
  gap: 3px;
  max-width: 240px;
  padding: 7px 9px;
  transform: translate(-50%, calc(-100% - 16px));
  border: 1px solid #314653;
  border-radius: var(--radius-md);
  background: rgba(7, 15, 21, 0.96);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-size: var(--font-size-sm);
  line-height: 1.35;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.graph-empty-state {
  position: absolute;
  z-index: 15;
  top: 50%;
  left: 50%;
  display: grid;
  gap: 10px;
  width: min(440px, calc(100% - 40px));
  padding: 24px;
  transform: translate(-50%, -50%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(11, 20, 28, 0.96);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.graph-empty-state > span {
  color: var(--muted);
}

.graph-empty-state > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.graph-empty-state button {
  min-height: var(--control-height-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel2);
  color: var(--text);
}

.graph-empty-state button:first-child {
  border-color: var(--green);
}

.graph-view-switch {
  position: absolute;
  z-index: 16;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(5, 12, 17, 0.94);
}

.graph-view-switch button {
  min-height: var(--control-height-md);
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: var(--font-size-sm);
  font-weight: 700;
}

.graph-view-switch button[aria-pressed="true"] {
  border-color: rgba(24, 214, 163, 0.38);
  background: rgba(24, 214, 163, 0.12);
  color: var(--green);
}

.graph-view-switch button:not([aria-pressed="true"]):hover {
  background: var(--panel2);
  color: var(--text);
}

.graph.list-view-active
  :is(
    .graph-node-tooltip,
    .graph-empty-state,
    .graph-controls,
    .graph-minimap,
    .graph-legend
  ) {
  visibility: hidden;
  pointer-events: none;
}

.graph-controls {
  position: absolute;
  z-index: 14;
  right: 12px;
  bottom: 12px;
  display: flex;
  gap: 4px;
}

.graph-controls button {
  min-width: var(--control-height-md);
  height: var(--control-height-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(11, 20, 28, 0.94);
  color: var(--text);
}

.graph-controls button:hover {
  background: var(--panel2);
  color: var(--text);
}
.graph-minimap {
  position: absolute;
  z-index: 13;
  right: 12px;
  bottom: 58px;
  width: 180px;
  height: 110px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(5, 12, 17, 0.9);
  cursor: crosshair;
}
.graph-legend {
  position: absolute;
  z-index: 13;
  bottom: 12px;
  left: 12px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(5, 12, 17, 0.92);
  color: var(--muted);
  font-size: var(--font-size-xs);
}
.graph-legend[open] {
  display: grid;
  max-height: min(45%, 340px);
  gap: 5px;
  overflow-y: auto;
}
.graph-legend-heading {
  margin-top: 4px;
  color: #b6c2cb;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.graph-legend-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  border-radius: 3px;
  outline: 0;
}
.graph-legend-item:hover,
.graph-legend-item:focus-visible {
  color: var(--text);
}
.graph-legend-item:focus-visible {
  box-shadow: var(--focus-ring);
}
.graph-legend i {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border: 2px solid transparent;
  border-radius: 50%;
}
.legend-target {
  background: var(--node-target);
}
.legend-action {
  background: var(--node-action);
}
.legend-service {
  background: var(--node-service);
}
.legend-application {
  background: var(--node-application);
}
.legend-finding {
  background: var(--node-finding);
}
.legend-vulnerability {
  background: var(--node-vulnerability);
}
.legend-info {
  background: var(--node-info);
}
.legend-active {
  border-width: 3px !important;
  border-color: #8795a1 !important;
  background: #13212a;
}
.legend-done {
  background: #8795a1;
  opacity: 0.62;
}
.legend-blocked {
  border-width: 3px !important;
  border-color: #e5c500 !important;
  border-style: dashed !important;
  background: #13212a;
}
.legend-failed {
  border-width: 3px !important;
  border-color: #f85149 !important;
  border-style: double !important;
  background: #13212a;
}
.legend-critical {
  border-radius: 0 !important;
  background: #8795a1;
  transform: rotate(45deg) scale(0.78);
}
.legend-high {
  border-radius: 0 !important;
  background: #8795a1;
  clip-path: polygon(25% 7%, 75% 7%, 100% 50%, 75% 93%, 25% 93%, 0 50%);
}
.graph-bulk-toolbar {
  position: absolute;
  z-index: 16;
  top: 12px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px;
  border: 1px solid var(--green);
  border-radius: var(--radius-md);
  background: rgba(5, 12, 17, 0.96);
  transform: translateX(-50%);
}
.graph-context-menu {
  position: absolute;
  z-index: 30;
  display: grid;
  min-width: 140px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #0b151c;
  box-shadow: var(--shadow-lg);
}
.graph-context-menu button {
  min-height: 30px;
  padding: 6px 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-size: var(--font-size-sm);
  text-align: left;
}
.graph-context-menu button:hover,
.graph-context-menu button:focus-visible {
  background: var(--panel2);
}

.graph-node-tooltip.visible {
  opacity: 1;
  visibility: visible;
}

.graph-node-tooltip.below {
  transform: translate(-50%, 16px);
}

.graph-node-tooltip strong,
.graph-node-tooltip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.graph-node-tooltip span {
  color: var(--muted);
}

/* =========================================================
   NOTES BOTTOM
========================================================= */

.notes-bottom-panel {
  position: relative;

  flex: 0 0 auto;

  width: 100%;
  height: 260px;

  min-height: 180px;

  display: flex;
  flex-direction: column;

  background: #081017;

  border-top: 1px solid var(--border);
}

/* =========================================================
   TOOL KNOWLEDGE BASE
========================================================= */

.tools-view {
  display: none;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  padding: 22px;
  overflow: hidden;
  background: rgba(7, 15, 21, 0.96);
}

.tools-view-active .graph,
.tools-view-active .relation-mode-banner,
.tools-view-active .notes-bottom-panel {
  display: none !important;
}

.tools-view-active .tools-view {
  display: flex;
}

body.tools-view-active .app {
  grid-template-columns: minmax(0, 1fr);
}

body.tools-view-active #workspace {
  grid-column: 1;
}

body.tools-view-active .app > .sidebar,
body.tools-view-active .app > .inspector,
body.tools-view-active .app > .panel-resizer {
  display: none;
}

/* =========================================================
   PROJECT NOTES WORKSPACE
========================================================= */

.notes-workspace-view {
  flex: 1 1 auto;
  min-height: 0;
  padding: 22px;
  overflow: hidden;
  background: rgba(7, 15, 21, 0.98);
}

.notes-workspace-view:not(.hidden) {
  display: flex;
  flex-direction: column;
}

.notes-editor-shell.fullscreen {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: #071017;
  border: 0;
  border-radius: 0;
}

.notes-workspace-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.notes-workspace-header h1 {
  margin: 4px 0 5px;
}

.notes-workspace-header p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.notes-workspace-actions {
  display: flex;
  gap: 8px;
}

.notes-workspace-actions button {
  width: auto;
}

.notes-workspace-layout {
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  flex: 1 1 auto;
  gap: 14px;
  min-height: 0;
}

.notes-editor-shell,
.notes-library {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #0a141c;
}

.notes-editor-shell {
  overflow: hidden;
}

.notes-workspace-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 100%;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.notes-workspace-empty strong {
  color: var(--text);
  font-size: 16px;
}

.notes-editor {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.notes-editor-meta {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.notes-location-summary {
  max-width: 280px;
  overflow: hidden;
  color: #9eb0bb;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-organize-menu,
.notes-more-menu {
  position: relative;
}

.notes-organize-menu > summary,
.notes-more-menu > summary {
  display: grid;
  min-height: 29px;
  place-items: center;
  padding: 0 10px;
  border: 1px solid #263844;
  border-radius: 5px;
  background: #0d1a23;
  color: #bac7d0;
  font-size: 11px;
  cursor: pointer;
  list-style: none;
}

.notes-organize-menu > summary::-webkit-details-marker,
.notes-more-menu > summary::-webkit-details-marker {
  display: none;
}

.notes-organize-menu[open] > summary,
.notes-more-menu[open] > summary {
  border-color: rgba(24, 214, 163, 0.5);
  color: var(--green);
}

.notes-organize-panel,
.notes-more-panel {
  position: absolute;
  z-index: 30;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #2a3d49;
  border-radius: 7px;
  background: #0b1720;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.notes-organize-panel {
  top: calc(100% + 7px);
  right: 0;
  width: min(360px, 80vw);
}

.notes-note-files {
  display: grid;
  gap: 7px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.notes-note-files-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #aebdc6;
  font-size: var(--font-size-xs);
}

.notes-note-files-header button {
  width: auto;
}

.notes-organize-panel label,
.notes-more-panel label {
  display: grid;
  gap: 5px;
  color: #aebdc6;
  font-size: var(--font-size-xs);
  font-weight: 700;
}

.notes-organize-panel select {
  width: 100%;
}

.notes-organize-panel p {
  margin: -3px 0 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.notes-organize-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-top: 3px;
  border-top: 1px solid var(--border);
}

.notes-editor-meta input,
.notes-editor-meta select,
.notes-search-field input {
  min-width: 0;
  height: 36px;
  border: 1px solid #293943;
  border-radius: 5px;
  outline: none;
  background: #071017;
  color: var(--text);
}

.notes-editor-meta input {
  padding: 0 11px;
  font-size: 16px;
  font-weight: 700;
}

.notes-editor-meta select,
.notes-search-field input {
  padding: 0 9px;
  font-size: 12px;
}

.notes-editor-meta input:focus,
.notes-editor-meta select:focus,
.notes-search-field input:focus,
#notes-body:focus {
  border-color: var(--blue);
}

.notes-editor-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: #081119;
}

.notes-format-group,
.notes-document-group,
.notes-mode-switch {
  display: flex;
  align-items: center;
  gap: 4px;
}

.notes-more-panel {
  top: calc(100% + 7px);
  left: 0;
  width: 190px;
  grid-template-columns: 1fr;
}

.notes-more-panel #notes-markdown-help-button {
  grid-column: 1 / -1;
}

.notes-format-group,
.notes-document-group {
  padding-right: 7px;
  border-right: 1px solid var(--border);
}

.notes-mode-switch {
  padding: 2px;
  border: 1px solid #263844;
  border-radius: 6px;
  background: #060d12;
}

.notes-editor-toolbar button,
.notes-library-header button,
.notes-collection-header button,
.notes-attachment button {
  border: 1px solid #263844;
  border-radius: 5px;
  background: #0d1a23;
  color: #bac7d0;
}

.notes-editor-toolbar button {
  height: 29px;
  padding: 0 9px;
  font-size: 11px;
}

.notes-heading-select {
  width: 78px;
  height: 29px;
  padding: 0 7px;
  border: 1px solid #263844;
  border-radius: 5px;
  outline: none;
  background: #0d1a23;
  color: #bac7d0;
  font-size: 11px;
  cursor: pointer;
}

.notes-heading-select:hover,
.notes-heading-select:focus {
  border-color: var(--green);
  color: var(--green);
}

.notes-mode-switch button {
  height: 25px;
  border-color: transparent;
  background: transparent;
}

.notes-mode-switch button[aria-pressed="true"] {
  border-color: rgba(24, 214, 163, 0.35);
  background: rgba(24, 214, 163, 0.12);
  color: var(--green);
}

.notes-preview-auto-update[aria-pressed="true"] {
  border-color: rgba(24, 214, 163, 0.35);
  color: var(--green);
}

.notes-preview-auto-update[aria-pressed="false"] {
  color: var(--muted);
}

.notes-editor-toolbar button:hover,
.notes-library-header button:hover {
  border-color: var(--green);
  color: var(--green);
}

.notes-save-status {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}

.notes-markdown-help {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(135deg, rgba(24, 214, 163, 0.05), transparent 35%), #0a151d;
  color: var(--muted);
  font-size: 11px;
}

.notes-markdown-help-intro {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notes-markdown-badge {
  width: 34px;
  height: 34px;
  display: grid;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid rgba(24, 214, 163, 0.3);
  border-radius: 7px;
  background: rgba(24, 214, 163, 0.08);
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.notes-markdown-help-intro > div {
  display: grid;
  gap: 2px;
}

.notes-markdown-help-intro strong {
  color: var(--text);
  font-size: 12px;
}

.notes-markdown-help-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.2fr 0.9fr;
  gap: 8px;
}

.notes-markdown-help section {
  min-width: 0;
  padding: 10px;
  border: 1px solid #20313c;
  border-radius: 7px;
  background: rgba(3, 10, 15, 0.36);
}

.notes-markdown-help h3 {
  margin: 0 0 8px;
  color: #cbd5db;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.notes-markdown-help dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.notes-markdown-help dl > div {
  min-width: 0;
}

.notes-markdown-help dt {
  margin-bottom: 2px;
  color: #9dacb6;
}

.notes-markdown-help dd {
  margin: 0;
  color: var(--text);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.notes-markdown-help code {
  color: #8bd5ff;
}

.notes-markdown-help p {
  margin: 8px 0 0;
  line-height: 1.45;
}

.notes-save-status[data-tone="success"] {
  color: var(--green);
}

.notes-save-status[data-tone="error"] {
  color: var(--danger);
}

#workspace-notes-conflict {
  margin: 10px 12px 0;
}

.notes-editor-content {
  flex: 1 1 auto;
  min-height: 220px;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
}

.notes-editor-content[data-mode="split"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#notes-body {
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 20px;
  resize: none;
  border: 0;
  outline: none;
  background: #071017;
  color: #d4dde3;
  font:
    14px/1.7 ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace;
  tab-size: 2;
}

.notes-markdown-preview {
  min-width: 0;
  min-height: 0;
  padding: 20px;
  overflow: auto;
  background: #09141c;
  color: #d4dde3;
  line-height: 1.65;
}

.notes-editor-content[data-mode="split"] .notes-markdown-preview {
  border-left: 1px solid var(--border);
}

.notes-markdown-preview > :first-child {
  margin-top: 0;
}

.notes-markdown-preview
  > :where(p, h1, h2, h3, h4, h5, h6, ul, ol, blockquote, pre) {
  max-width: 80ch;
}

.notes-markdown-preview blockquote {
  margin: 16px 0;
  padding: 8px 14px;
  border-left: 3px solid #4e9f8b;
  background: rgba(78, 159, 139, 0.08);
  color: #b9c8d0;
}

.notes-markdown-preview blockquote > :first-child {
  margin-top: 0;
}

.notes-markdown-preview blockquote > :last-child {
  margin-bottom: 0;
}

.notes-markdown-preview ul,
.notes-markdown-preview ol {
  padding-left: 26px;
}

.notes-markdown-preview li > ul,
.notes-markdown-preview li > ol {
  margin: 4px 0 2px;
  padding-left: 24px;
}

.notes-markdown-preview li + li {
  margin-top: 4px;
}

.notes-markdown-preview .task-list-item {
  list-style: none;
}

.notes-markdown-preview .task-list-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0 7px 0 -21px;
  accent-color: var(--green);
  vertical-align: -2px;
}

.notes-markdown-preview hr {
  margin: 24px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.notes-markdown-preview del {
  color: var(--muted);
}

.markdown-table-scroll {
  max-width: 100%;
  margin: 16px 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.markdown-table-scroll:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.notes-markdown-preview table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  font-size: 13px;
}

.notes-markdown-preview th,
.notes-markdown-preview td {
  padding: 9px 11px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.notes-markdown-preview th:last-child,
.notes-markdown-preview td:last-child {
  border-right: 0;
}

.notes-markdown-preview tr:last-child td {
  border-bottom: 0;
}

.notes-markdown-preview th {
  background: #0d1b24;
  color: #e0e8ec;
  font-weight: 650;
}

.markdown-image-button {
  display: block;
  max-width: 100%;
  margin: 12px 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.notes-markdown-preview .markdown-image-button img {
  display: block;
  width: auto;
  max-width: min(100%, 760px);
  max-height: 520px;
  border-radius: 6px;
  object-fit: contain;
}

.notes-editor-content[data-mode="split"]
  .notes-markdown-preview
  .markdown-image-button:not(.expanded)
  img {
  max-height: 360px;
}

.notes-markdown-preview .markdown-image-button.expanded {
  width: 100%;
  cursor: zoom-out;
}

.notes-markdown-preview .markdown-image-button.expanded img {
  width: auto;
  max-width: 100%;
  max-height: none;
}

.markdown-image-button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.notes-markdown-preview pre,
.notes-markdown-preview code {
  border-radius: 4px;
  background: #050c11;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.notes-markdown-preview pre {
  position: relative;
  padding: 12px;
  overflow: auto;
  white-space: pre-wrap;
}

.notes-markdown-preview pre[data-language]::before {
  position: absolute;
  top: 5px;
  right: 7px;
  color: #607583;
  content: attr(data-language);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.markdown-mermaid-diagram {
  display: flex;
  max-width: 100%;
  margin: 16px 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #071017;
}

.markdown-mermaid-image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 720px;
  margin: auto;
  object-fit: contain;
}

.markdown-mermaid-error,
.markdown-mermaid-limit {
  margin: -6px 0 16px;
  padding: 7px 10px;
  border-left: 2px solid var(--danger);
  background: rgba(255, 92, 92, 0.07);
  color: #efb1b1;
  font-size: 12px;
}

.markdown-mermaid-limit {
  border-left-color: var(--amber);
  background: rgba(255, 184, 77, 0.07);
  color: #e8c797;
}

.markdown-citation {
  margin-left: 2px;
  font-size: 0.72em;
  vertical-align: super;
}

.markdown-citation a,
.markdown-reference-backlink {
  color: #71bca9;
  text-decoration: none;
}

.markdown-citation a:hover,
.markdown-citation a:focus-visible,
.markdown-reference-backlink:hover,
.markdown-reference-backlink:focus-visible {
  color: var(--green);
  text-decoration: underline;
}

.markdown-citation.unresolved a {
  color: var(--danger);
  cursor: help;
}

.markdown-references {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.markdown-references h2 {
  margin-bottom: 10px;
  font-size: 16px;
}

.markdown-references ol {
  padding-left: 24px;
  color: var(--muted);
  font-size: 12px;
}

.markdown-references li {
  padding-left: 4px;
  scroll-margin-top: 20px;
}

.markdown-references li:target {
  border-radius: 4px;
  background: rgba(24, 214, 163, 0.08);
  color: var(--text);
}

.markdown-token-comment {
  color: #6f8795;
}

.markdown-token-string {
  color: #a8d87a;
}

.markdown-token-keyword,
.markdown-token-literal {
  color: #cf9cff;
}

.markdown-token-variable,
.markdown-token-key {
  color: #75cfff;
}

.markdown-token-number,
.markdown-token-flag {
  color: #ffbd75;
}

.notes-dropzone {
  margin: 0;
  padding: 9px;
  border: 1px dashed #334955;
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  cursor: pointer;
}

.notes-dropzone.dragging {
  border-color: var(--green);
  background: rgba(24, 214, 163, 0.06);
  color: var(--green);
}

.notes-dropzone.disabled {
  cursor: default;
  opacity: 0.5;
}

.notes-attachments {
  display: grid;
  gap: 8px;
  min-height: 0;
  max-height: 112px;
  padding: 0;
  overflow-y: auto;
}

.notes-attachments:not(:empty) {
  min-height: 96px;
}

.notes-attachment {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  width: 100%;
  gap: 7px;
  padding: 7px;
  border: 1px solid #21323d;
  border-radius: 6px;
  background: #0b1720;
}

.notes-attachment img {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  object-fit: cover;
}

.notes-attachment-preview {
  display: block;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.notes-attachment-preview.expanded {
  width: min(220px, 100%);
  height: auto;
  grid-column: 1 / -1;
  cursor: zoom-out;
}

.notes-attachment-preview.expanded img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 260px;
}

.notes-attachments:has(.notes-attachment-preview.expanded) {
  max-height: 340px;
}

.notes-attachment a {
  overflow: hidden;
  color: var(--blue);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-attachment button {
  padding: 4px 6px;
  font-size: 10px;
}

.notes-attachment-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 4px;
}

.notes-attachment .notes-attachment-remove {
  color: #ed9696;
}

.notes-library {
  display: flex;
  flex-direction: column;
  padding: 12px;
  overflow: hidden;
}

.notes-scope-switch {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  margin-bottom: 12px;
  padding: 4px;
  border: 1px solid #1c2b35;
  border-radius: 7px;
  background: #071017;
}

.notes-scope-switch button {
  min-width: 0;
  padding: 7px 5px;
  border: 0;
  background: #0b1720;
  color: var(--muted);
  font-size: var(--font-size-xs);
  white-space: normal;
}

.notes-scope-switch button:hover:not(:disabled) {
  background: #11232f;
  color: var(--text);
}

.notes-scope-switch button[aria-pressed="true"] {
  background: rgba(24, 214, 163, 0.12);
  color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(24, 214, 163, 0.3);
}

.notes-location-filter {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--form-label-color);
  font-size: var(--form-label-size);
  font-weight: var(--form-label-weight);
}

.notes-location-filter select {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 9px;
  border-radius: 5px;
  font-size: var(--font-size-sm);
}

.notes-library-header,
.notes-collection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.notes-library-header > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notes-library-header > div > span {
  color: var(--muted);
  font-size: 11px;
}

.notes-library-header button {
  width: 30px;
  height: 30px;
  font-size: 18px;
}

.notes-search-field {
  margin: 12px 0;
}

.notes-search-field input {
  width: 100%;
}

.notes-collection-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
}

.notes-collection {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 5px;
  border: 1px solid #1c2b35;
  border-radius: 7px;
  background: #081219;
}

.notes-collection-header {
  min-height: 24px;
  color: #9dacb6;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.notes-collection-toggle {
  min-width: 0;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  gap: 6px;
  padding: 3px 4px;
  border: 0;
  background: transparent;
  color: #b8c5cd;
  text-align: left;
  cursor: pointer;
}

.notes-collection-toggle:hover {
  color: var(--text);
}

.notes-collection-chevron {
  width: 12px;
  color: #6f8491;
  font-size: 9px;
}

.notes-collection-toggle strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-collection-notes {
  display: grid;
  gap: 4px;
  padding-left: 10px;
  border-left: 1px solid #20323d;
}

.notes-collection-menu {
  position: relative;
}

.notes-collection-menu summary {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}

.notes-collection-menu summary::-webkit-details-marker {
  display: none;
}

.notes-collection-menu[open] summary,
.notes-collection-menu summary:hover {
  background: #12212b;
  color: var(--text);
}

.notes-collection-menu-actions {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  width: 120px;
  display: grid;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #0d1821;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}

.notes-collection-menu-actions button {
  width: 100%;
  text-align: left;
}

.notes-collection-count {
  margin-left: auto;
  color: var(--muted);
}

.notes-collection-header button {
  width: auto;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  color: var(--muted);
  font-size: 10px;
}

.notes-library-note {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: 9px 10px;
  overflow: hidden;
  border: 1px solid #1f303a;
  border-radius: 6px;
  background: #09131b;
  color: var(--text);
  text-align: left;
}

.notes-library-note.node-documentation {
  flex: 0 0 auto;
}

.notes-library-note:hover,
.notes-library-note.active {
  border-color: rgba(24, 214, 163, 0.55);
  background: rgba(24, 214, 163, 0.055);
}

.notes-library-note.active {
  box-shadow: inset 3px 0 var(--green);
}

.notes-library-note strong,
.notes-library-note span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-library-note .notes-access-badge {
  align-self: flex-start;
  padding: 2px 5px;
  border: 1px solid #334652;
  border-radius: 999px;
  color: #aebbc3;
  font-size: var(--font-size-xs);
  font-weight: 700;
  line-height: 1.2;
}

.notes-library-note .notes-access-badge.project {
  border-color: rgba(67, 156, 255, 0.45);
  color: #8fc1ff;
}

.notes-library-note strong {
  font-size: 12px;
}

.notes-library-note span {
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 800px) {
  .notes-workspace-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(180px, 0.5fr) minmax(360px, 1fr);
  }
  .notes-editor-meta {
    grid-template-columns: 1fr auto;
  }
  .notes-editor-content[data-mode="split"] {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(2, minmax(220px, 1fr));
    overflow: auto;
  }
  .notes-editor-content[data-mode="split"] .notes-markdown-preview {
    border-top: 1px solid var(--border);
    border-left: 0;
  }
  .notes-markdown-help-grid {
    grid-template-columns: 1fr;
  }
}

.tools-view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.tools-view-kicker {
  color: var(--blue);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.14em;
}

.tools-view-header h1,
.tool-detail-header h2 {
  margin: 4px 0 5px;
}

.tools-view-header p,
.tool-detail-header p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.tools-view-header .dialog-secondary-button {
  width: auto;
  flex: 0 0 auto;
}

.knowledge-tabs {
  display: flex;
  gap: 6px;
  margin: -6px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.knowledge-tabs button {
  padding: 7px 11px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.knowledge-tabs button:hover,
.knowledge-tabs button.active {
  border-color: rgba(39, 140, 255, 0.45);
  background: rgba(39, 140, 255, 0.09);
  color: #8dc2ff;
}

.knowledge-tab-panel {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.knowledge-tab-panel.dragging {
  outline: 2px solid var(--green);
  outline-offset: -2px;
}

.knowledge-entry-filters {
  grid-template-columns: minmax(220px, 2fr) repeat(2, minmax(140px, 1fr));
}

.asset-library-filters {
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(140px, 1fr));
}

.asset-library-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.asset-library-list-header .tool-result-count {
  margin: 0;
}

.asset-library-list-header .dialog-secondary-button {
  width: auto;
}

.asset-library-list-header > div:last-child {
  display: flex;
  gap: 5px;
}

.asset-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.asset-card > img,
.asset-file-icon {
  width: 52px;
  height: 42px;
  border: 1px solid #263844;
  border-radius: 5px;
  background: #071017;
}

.asset-card > img {
  object-fit: contain;
}

.asset-file-icon {
  display: grid;
  place-items: center;
  color: #8fa2ae;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.asset-card-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.asset-detail-preview {
  display: grid;
  min-height: 220px;
  max-height: 46vh;
  place-items: center;
  margin: 18px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #071017;
}

.asset-detail-preview img {
  display: block;
  max-width: 100%;
  max-height: 44vh;
  object-fit: contain;
}

.asset-text-preview {
  width: 100%;
  min-height: 218px;
  padding: 16px;
  margin: 0;
  overflow: auto;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.asset-pdf-preview {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.asset-file-icon.large {
  width: 96px;
  height: 76px;
  font-size: 12px;
}

.asset-collection-rows {
  display: grid;
  gap: 6px;
}

.asset-picker-dialog {
  width: min(900px, calc(100vw - 32px));
  height: min(720px, calc(100vh - 32px));
}

.asset-picker-dialog > form {
  height: 100%;
}

.asset-picker-body {
  display: flex;
  min-height: 0;
  flex-direction: column;
}

.asset-picker-filters {
  grid-template-columns: minmax(220px, 2fr) repeat(2, minmax(140px, 1fr));
  margin-bottom: 10px;
}

.asset-picker-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  min-height: 0;
  overflow-y: auto;
}

.asset-picker-upload {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.asset-picker-upload label {
  display: grid;
  gap: 5px;
  color: var(--form-label-color);
  font-size: var(--form-label-size);
  font-weight: var(--form-label-weight);
}

.asset-picker-upload .dialog-secondary-button {
  width: auto;
}

@media (max-width: 1000px) {
  .asset-library-filters,
  .asset-picker-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .asset-picker-list {
    grid-template-columns: 1fr;
  }
}

.node-inventory-favorite-filter {
  width: 100%;
  height: 36px;
  min-height: 36px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #263844;
  border-radius: 6px;
  background: #0d1a23;
  color: var(--muted);
  font: inherit;
  white-space: nowrap;
  cursor: pointer;
}

.node-inventory-favorite-field {
  min-width: 0;
  display: grid;
}

.node-inventory-favorite-filter:hover,
.node-inventory-favorite-filter:focus-visible {
  border-color: var(--green);
  color: var(--text);
}

.node-inventory-favorite-filter[aria-pressed="true"] {
  border-color: rgba(229, 197, 0, 0.55);
  background: rgba(229, 197, 0, 0.08);
  color: #e8d968;
}

.node-inventory-favorite-filter [data-favorite-icon] {
  font-size: 16px;
  line-height: 1;
}

.node-inventory-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.tool-filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) repeat(4, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0b151d;
}

.tool-filter-bar.node-inventory-filters {
  grid-template-columns: minmax(180px, 2fr) repeat(4, minmax(110px, 1fr)) auto;
}

.tool-filter-bar label > span,
.tool-filter-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tool-filter-bar input,
.tool-filter-bar select {
  width: 100%;
  height: 36px;
  padding: 0 9px;
  border: 1px solid #293943;
  border-radius: 5px;
  outline: none;
  background: #071017;
  color: var(--text);
  font-size: 12px;
}

.tool-filter-bar input:focus,
.tool-filter-bar select:focus {
  border-color: var(--blue);
}

.tools-view-content {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: clamp(280px, 24vw, 360px) minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
}

.split-view-detail-column {
  display: flex;
  min-width: 0;
  min-height: 0;
}

.split-view-back-button {
  display: none;
}

.tool-results-column,
.tool-detail {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0a141c;
}

.tool-results-column {
  padding: 14px;
}

.tool-result-count {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.tool-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.tool-card {
  width: 100%;
  padding: 11px;
  border: 1px solid #21313c;
  border-radius: 7px;
  background: #0a141c;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.tool-card:hover,
.tool-card.active {
  border-color: rgba(39, 140, 255, 0.6);
  background: rgba(39, 140, 255, 0.07);
}

.tool-card-name,
.tool-card-category,
.tool-card-description {
  display: block;
}

.tool-card-name {
  font-size: 13px;
  font-weight: 700;
}
.tool-card-category {
  margin-top: 2px;
  color: #6facf5;
  font-size: 12px;
  text-transform: uppercase;
}
.tool-card-description {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.tool-card-tags,
.tool-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.tool-tag,
.tool-phase-tag {
  padding: 3px 6px;
  border: 1px solid #2a3a45;
  border-radius: 999px;
  color: #9eacb7;
  font-size: 12px;
}

.tool-phase-tag {
  border-color: rgba(24, 214, 163, 0.32);
  color: var(--green);
}

.tool-detail {
  flex: 1 1 auto;
  padding: 14px;
}

.tool-detail-empty,
.tool-list-empty {
  padding: 28px 12px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.tool-detail-section {
  margin-top: 22px;
}

.node-inventory-detail-header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  background: #0a141c;
}

.linked-note-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-inventory-properties {
  max-width: 90ch;
}

.tool-list-empty p {
  margin: 0 0 10px;
}

.tool-list-empty .dialog-secondary-button {
  width: auto;
}
.tool-detail-section h3 {
  margin: 0 0 9px;
  color: #d5bd58;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tool-detail-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}
.tool-detail-section-header h3 {
  margin: 0;
}

.tool-detail-help {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.tool-command-card {
  margin-bottom: 8px;
  padding: 11px;
  border: 1px solid #1d2d37;
  border-radius: 6px;
  background: #071017;
}
.tool-command-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}
.tool-command-card-actions {
  display: flex;
  gap: 5px;
}
.tool-command-card pre {
  margin: 9px 0 0;
  padding: 9px;
  overflow: auto;
  border-radius: 4px;
  background: #03090d;
  color: #79d9be;
  font:
    10px/1.5 "JetBrains Mono",
    Consolas,
    monospace;
  white-space: pre-wrap;
}
.tool-command-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.tool-command-annotations {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid #1a2a34;
}
.tool-command-annotations > div {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) minmax(180px, 1.7fr);
  gap: 9px;
  align-items: start;
  font-size: 12px;
}
.tool-command-annotations code {
  color: #d8c35d;
  overflow-wrap: anywhere;
}
.tool-command-annotations span {
  color: #aebbc5;
  line-height: 1.45;
}
.tool-copy-button {
  padding: 5px 8px;
  border: 1px solid #31434f;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.tool-copy-button:hover {
  border-color: var(--green);
  color: var(--green);
}
.tool-command-graph-button {
  padding: 5px 8px;
  border: 1px solid rgba(24, 214, 163, 0.45);
  border-radius: 4px;
  background: rgba(24, 214, 163, 0.06);
  color: var(--green);
  font-size: 12px;
  cursor: pointer;
}
.tool-command-graph-button:hover {
  background: rgba(24, 214, 163, 0.14);
}
.tool-reference-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.knowledge-version-list {
  display: grid;
  gap: 8px;
}

.knowledge-version-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
}
.tool-load-more {
  width: 100%;
  margin-top: 8px;
}
.tool-reference-list a {
  padding: 7px 9px;
  border: 1px solid #294055;
  border-radius: 5px;
  color: #70b1ff;
  font-size: 12px;
  text-decoration: none;
}
.tool-reference-list a:hover {
  background: rgba(39, 140, 255, 0.09);
}

.knowledge-detail-grid {
  display: grid;
  grid-template-columns: minmax(110px, 0.45fr) minmax(180px, 1.55fr);
  margin: 0;
  border-top: 1px solid #1d2d37;
}

.knowledge-detail-grid dt,
.knowledge-detail-grid dd {
  margin: 0;
  padding: 8px 6px;
  border-bottom: 1px solid #1d2d37;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.knowledge-detail-grid dt {
  color: var(--muted);
}

.knowledge-detail-grid dd {
  color: var(--text);
}

.knowledge-detail-notes {
  margin: 0;
  padding: 11px;
  border: 1px solid #1d2d37;
  border-radius: 6px;
  background: #071017;
  color: #aebbc5;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.knowledge-kind-fields {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.knowledge-switch-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  margin-top: 20px;
  color: var(--text);
  font-size: 12px;
}

.knowledge-switch-field input {
  position: absolute;
  opacity: 0;
}

.knowledge-switch-control {
  position: relative;
  width: 34px;
  height: 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel2);
  transition: background 120ms ease;
}

.knowledge-switch-control::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 120ms ease;
}

.knowledge-switch-field input:checked + .knowledge-switch-control {
  border-color: var(--color-success);
  background: color-mix(in srgb, var(--color-success) 28%, transparent);
}

.knowledge-switch-field input:checked + .knowledge-switch-control::after {
  transform: translateX(16px);
  background: var(--color-success);
}

.knowledge-switch-field input:focus-visible + .knowledge-switch-control {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.knowledge-advanced-fields {
  margin: 4px 0 16px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel2);
}

.knowledge-advanced-fields summary {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.knowledge-chip-editor {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: var(--control-height-md);
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
}

.knowledge-chip-list {
  display: contents;
}

.knowledge-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border: 1px solid color-mix(in srgb, var(--color-info) 45%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-info) 13%, transparent);
  color: var(--text);
  font-size: 11px;
}

.knowledge-chip button {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.knowledge-chip-editor > input {
  flex: 1 1 130px;
  min-width: 110px;
  padding: 2px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.linked-note-list {
  display: grid;
  gap: 7px;
}

.linked-note-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel2);
  font-size: 11px;
}

.linked-note-open,
.linked-note-remove {
  min-width: 0;
  padding: 3px 6px;
}

.linked-note-open {
  overflow: hidden;
  color: var(--color-info);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.linked-note-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

@media (max-width: 1100px) {
  .tools-view {
    padding: 14px;
  }
  .tools-view-header {
    margin-bottom: 12px;
  }
  .knowledge-tabs {
    margin-bottom: 10px;
    padding-bottom: 8px;
    overflow-x: auto;
  }
  .tool-filter-bar {
    gap: 8px;
    margin-bottom: 10px;
    padding: 9px;
  }
  .tools-view-content {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .split-view-detail-column {
    display: none;
    flex-direction: column;
    gap: 8px;
  }
  .tools-view-content[data-active-pane="detail"] > .tool-results-column {
    display: none;
  }
  .tools-view-content[data-active-pane="detail"] > .split-view-detail-column {
    display: flex;
  }
  .knowledge-tab-panel:has(> .tools-view-content[data-active-pane="detail"])
    > .tool-filter-bar,
  .tools-view:has(> .tools-view-content[data-active-pane="detail"])
    > .tool-filter-bar {
    display: none;
  }
  .split-view-back-button {
    display: inline-flex;
    align-self: flex-start;
    width: auto;
    min-height: 32px;
    padding: 5px 9px;
  }
}

@media (max-width: 820px) {
  .tool-filter-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .tool-filter-bar.node-inventory-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-height: 800px) {
  .tools-view {
    padding-block: 12px;
  }
  .tools-view-header {
    margin-bottom: 10px;
  }
  .tools-view-header h1 {
    margin-block: 2px 3px;
  }
  .knowledge-tabs {
    margin-bottom: 8px;
    padding-bottom: 7px;
  }
  .tool-filter-bar {
    margin-bottom: 9px;
    padding: 8px;
  }
  .tool-filter-bar label > span,
  .tool-filter-label {
    margin-bottom: 3px;
  }
  .tool-filter-bar input,
  .tool-filter-bar select {
    height: 32px;
  }
  .node-inventory-favorite-filter {
    height: 32px;
    min-height: 32px;
  }
  .tool-results-column,
  .tool-detail {
    padding: 11px;
  }
  .tool-detail-section {
    margin-top: 16px;
  }
}

@media (min-width: 1800px) {
  .knowledge-detail-grid {
    grid-template-columns:
      minmax(110px, 180px) minmax(240px, 1fr) minmax(110px, 180px)
      minmax(240px, 1fr);
  }
  .knowledge-detail-grid.node-inventory-properties {
    grid-template-columns: minmax(110px, 180px) minmax(240px, 1fr);
  }
}

.notes-resize-handle {
  position: absolute;

  top: -4px;
  left: 0;

  width: 100%;
  height: 8px;

  cursor: ns-resize;

  z-index: 20;
}

.notes-resize-handle::after {
  content: "";

  position: absolute;

  top: 3px;
  left: 50%;

  width: 60px;
  height: 2px;

  transform: translateX(-50%);

  border-radius: 2px;

  background: #30414e;
}

.notes-resize-handle:hover::after {
  background: var(--green);
}

.notes-bottom-header {
  height: 36px;

  flex: 0 0 36px;

  display: flex;
  align-items: center;
  justify-content: flex-start;

  padding: 0 14px;

  border-bottom: 1px solid #18242d;

  color: #d5bd58;

  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.notes-bottom-content {
  flex: 1 1 auto;

  min-height: 0;

  padding: 10px;
}

.notes-bottom-content #node-notes {
  width: 100%;
  height: 100%;

  min-height: 160px;

  resize: none;
}

/* =========================================================
   INSPECTOR
========================================================= */

.inspector {
  min-width: 0;

  padding: 14px;

  overflow-y: auto;

  background: var(--panel);

  border-left: 1px solid var(--border);
}

.inspector-overview-button {
  width: 100%;
  margin-bottom: 10px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel2);
  color: var(--muted);
  text-align: left;
}

.inspector-overview-button:hover,
.inspector-overview-button:focus-visible {
  border-color: var(--color-info);
  color: var(--text);
}

.hidden {
  display: none !important;
}

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

.empty-inspector {
  color: var(--muted);
}

.empty-inspector h2 {
  margin-top: 0;

  color: var(--text);

  font-size: var(--font-size-lg);
}

.continue-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.continue-summary button {
  display: grid;
  gap: 3px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  font-size: var(--font-size-sm);
}

.continue-summary button:hover,
.continue-summary button:focus-visible {
  border-color: var(--accent);
  color: var(--text);
}

.continue-summary strong {
  color: var(--text);
  font-size: var(--font-size-lg);
}

.node-id-line {
  display: none;
}

/* =========================================================
   INSPECTOR BLOCKS
========================================================= */

.inspector-block {
  padding: 12px 0;

  border-bottom: 1px solid #18242d;
}

.inspector-block:first-child {
  padding-top: 2px;
}

.inspector-block:last-child {
  border-bottom: 0;
}

/* =========================================================
   NODE HEADER
========================================================= */

.inspector-node-heading {
  margin-bottom: 9px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.inspector-node-heading h2 {
  margin: 0;

  color: var(--text);

  font-size: 19px;
  line-height: 1.3;

  overflow-wrap: anywhere;
}

.node-id-line {
  margin-top: 5px;

  color: var(--muted);

  font-size: 12px;
}

.node-id-line span {
  color: #aebbc5;

  font-family: "JetBrains Mono", Consolas, monospace;
}

.node-actions-menu {
  position: relative;
  flex: 0 0 auto;
  margin-left: auto;
}
.node-actions-menu > summary {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  font-size: 18px;
}
.node-actions-menu > summary::-webkit-details-marker {
  display: none;
}
.node-actions-menu > summary:hover,
.node-actions-menu[open] > summary {
  border-color: var(--border);
  background: #101d26;
  color: var(--text);
}
.node-actions-menu-panel {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 160;
  width: 155px;
  padding: 5px;
  border: 1px solid #2a3e4a;
  border-radius: 6px;
  background: #0a151c;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}
.node-menu-action {
  width: 100%;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #bfd0da;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.node-menu-action:hover {
  background: #13232d;
  color: var(--text);
}
.node-menu-action.danger {
  color: #e27b76;
}
.node-menu-action.danger:hover {
  background: rgba(248, 81, 73, 0.1);
  color: var(--red);
}
.node-menu-action kbd {
  color: #687d89;
  font-size: 12px;
}

/* =========================================================
   BADGES
========================================================= */

.badges {
  display: flex;
  flex-wrap: wrap;

  gap: 5px;
}

.badges span,
.badges select {
  padding: 3px 7px;

  border: 1px solid #233540;

  border-radius: 4px;

  background: #101b25;

  color: #b7c3cc;

  font-size: 12px;
  font-weight: 700;

  letter-spacing: 0.04em;

  text-transform: uppercase;
}

.badges select {
  appearance: auto;
  cursor: pointer;
  font-family: inherit;
}

.badges select:disabled {
  cursor: wait;
  opacity: 0.65;
}

#node-type {
  border-color: rgba(24, 214, 163, 0.35);

  color: var(--green);
}

#node-phase {
  border-color: rgba(39, 140, 255, 0.35);

  color: #67adff;
}

#node-status {
  border-color: rgba(155, 92, 255, 0.35);

  color: #c4a4ff;
}
#node-status[data-status="done"] {
  border-color: rgba(24, 214, 163, 0.55);
  color: #18d6a3;
}
#node-status[data-status="active"] {
  border-color: rgba(39, 140, 255, 0.55);
  color: #67adff;
}
#node-status[data-status="blocked"] {
  border-color: rgba(255, 159, 67, 0.6);
  color: #ffb36b;
}
#node-status[data-status="failed"] {
  border-color: rgba(255, 77, 109, 0.6);
  color: #ff718b;
}

/* =========================================================
   INSPECTOR ACTION BUTTONS
========================================================= */

.node-primary-actions,
.relation-actions {
  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: 6px;

  margin-top: 8px;
}

.edit-node-button,
.delete-node-button.compact,
.relation-button,
.delete-relation-button {
  width: 100%;
  height: 28px;

  margin: 0;
  padding: 0 8px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 4px;

  font-size: 12px;
  font-weight: 600;

  line-height: 1;

  white-space: nowrap;

  cursor: pointer;
}

/* ---------------------------------------------------------
   EDIT NODE
--------------------------------------------------------- */

.edit-node-button {
  border: 1px solid rgba(39, 140, 255, 0.38);

  background: rgba(39, 140, 255, 0.035);

  color: #73b5ff;
}

.edit-node-button:hover {
  border-color: rgba(39, 140, 255, 0.65);

  background: rgba(39, 140, 255, 0.1);
}

.follow-up-button {
  grid-column: 1 / -1;
}

.relation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.relation-actions .relation-button,
.relation-actions .delete-relation-button {
  flex: 0 1 auto;
  width: auto;
  height: 24px;
  padding: 0 7px;
  font-size: 12px;
}

/* ---------------------------------------------------------
   DELETE NODE
--------------------------------------------------------- */

.delete-node-button.compact {
  border: 1px solid rgba(248, 81, 73, 0.35);

  background: rgba(248, 81, 73, 0.025);

  color: #df6a65;
}

.delete-node-button.compact:hover {
  border-color: rgba(248, 81, 73, 0.6);

  background: rgba(248, 81, 73, 0.09);

  color: var(--red);
}

/* ---------------------------------------------------------
   ADD RELATION
--------------------------------------------------------- */

.relation-button {
  border: 1px solid rgba(39, 140, 255, 0.35);

  background: rgba(39, 140, 255, 0.03);

  color: #73b5ff;
}

.relation-button:hover {
  border-color: rgba(39, 140, 255, 0.6);

  background: rgba(39, 140, 255, 0.09);
}

/* ---------------------------------------------------------
   DELETE RELATION
--------------------------------------------------------- */

.delete-relation-button {
  border: 1px solid rgba(229, 197, 0, 0.32);

  background: rgba(229, 197, 0, 0.025);

  color: #baaa52;
}

.delete-relation-button:hover {
  border-color: rgba(229, 197, 0, 0.58);

  background: rgba(229, 197, 0, 0.09);

  color: #e0ca4f;
}

/* =========================================================
   SECTION HEADER
========================================================= */

.inspector-section-header,
.notes-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 10px;

  margin-bottom: 8px;
}

.section-title {
  margin: 0;

  color: #d5bd58;

  font-size: 12px;
  font-weight: 700;

  letter-spacing: 0.1em;

  text-transform: uppercase;
}

/* =========================================================
   PROPERTIES
========================================================= */

.property-add-button {
  height: 26px;

  padding: 0 8px;

  border: 1px solid #2a3945;

  border-radius: 4px;

  background: transparent;

  color: #9eabb5;

  font-size: 12px;
  font-weight: 600;

  cursor: pointer;
}

.property-add-button:hover {
  border-color: rgba(24, 214, 163, 0.55);

  color: var(--green);

  background: rgba(24, 214, 163, 0.04);
}

.properties-table-header {
  display: grid;

  grid-template-columns:
    minmax(70px, 0.8fr)
    minmax(90px, 1.2fr)
    58px;

  gap: 6px;

  padding: 6px 7px;

  border: 1px solid #1a2731;

  border-radius: 5px 5px 0 0;

  background: #0f1a23;

  color: var(--muted);

  font-size: 12px;
  font-weight: 700;

  letter-spacing: 0.05em;

  text-transform: uppercase;
}

.property-row {
  display: grid;

  grid-template-columns:
    minmax(70px, 0.8fr)
    minmax(90px, 1.2fr)
    58px;

  gap: 6px;

  align-items: center;

  min-height: 34px;

  padding: 6px 7px;

  border-left: 1px solid #1a2731;

  border-right: 1px solid #1a2731;

  border-bottom: 1px solid #1a2731;

  background: #0a131b;

  font-size: 12px;
}

.property-row:last-child {
  border-radius: 0 0 5px 5px;
}

.property-row:hover {
  background: #0d1821;
}

.property-header {
  min-width: 0;

  overflow: hidden;

  color: #aebcc6;

  font-weight: 600;

  white-space: nowrap;
  text-overflow: ellipsis;
}

.property-value {
  min-width: 0;

  overflow-wrap: anywhere;

  color: var(--text);
}

.property-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;

  gap: 3px;
}

.property-edit-button,
.property-delete-button {
  width: 24px;
  height: 22px;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;

  border-radius: 3px;

  font-size: 12px;

  cursor: pointer;
}

.property-edit-button {
  border: 1px solid rgba(39, 140, 255, 0.35);

  background: rgba(39, 140, 255, 0.03);

  color: #58a6ff;
}

.property-edit-button:hover {
  background: rgba(39, 140, 255, 0.1);
}

.property-delete-button {
  border: 1px solid rgba(248, 81, 73, 0.35);

  background: rgba(248, 81, 73, 0.025);

  color: #d16762;
}

.property-delete-button:hover {
  background: rgba(248, 81, 73, 0.09);

  color: var(--red);
}

.properties-empty {
  padding: 11px 9px;

  border: 1px solid #1a2731;

  border-top: 0;

  border-radius: 0 0 5px 5px;

  background: #0a131b;

  color: var(--muted);

  font-size: 12px;

  text-align: center;
}

/* =========================================================
   NOTES
========================================================= */

.notes-right-container {
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.node-markdown-toolbar {
  display: flex;
  flex-wrap: wrap;
}

.node-markdown-editor-content {
  flex: 0 0 auto;
  min-height: 260px;
  border: 0;
  overflow: visible;
}

.node-linked-notes {
  scroll-margin-block: var(--space-4);
}

.node-linked-notes .inspector-section-header {
  align-items: flex-start;
}

.node-linked-notes .linked-note-actions {
  justify-content: flex-end;
  margin-top: 0;
}

.node-linked-notes .linked-note-list {
  max-height: 210px;
  overflow-y: auto;
}

.inspector-tabs {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 0;
  overflow-x: auto;
}

.node-content-header {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid #1a2731;
}

.inspector-tab {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 1px;
  white-space: nowrap;
  height: 33px;
  min-height: var(--control-height-sm);
  padding: 7px 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: normal;
  cursor: pointer;
}

.inspector-tab:hover {
  color: var(--text);
}
.inspector-tab.active {
  border-bottom-color: var(--green);
  color: var(--green);
}

#command-output-count {
  display: inline-flex;
  min-width: 17px;
  height: 17px;
  margin-left: 0;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: #182631;
  color: #aebbc5;
  font-size: 12px;
}

.node-content-view-toolbar {
  min-height: 30px;
  flex: 1 0 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
}

.node-content-toggle {
  min-height: var(--control-height-sm);
  padding: 4px 7px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.node-content-toggle:hover,
.node-content-toggle:focus-visible {
  outline: 0;
  background: #14232d;
  color: var(--text);
}

.node-content-fullscreen {
  position: fixed;
  inset: 16px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  margin: 0 !important;
  padding: 18px !important;
  overflow: auto !important;
  border: 1px solid #3c5665;
  border-radius: 8px;
  background: #091219;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
}

.node-content-fullscreen .node-markdown-toolbar,
#notes-bottom-content .node-markdown-toolbar {
  display: flex;
  flex: 0 0 auto;
  padding-inline: 0;
  border-top: 1px solid var(--border);
  background: transparent;
}

.node-content-fullscreen .node-markdown-editor-content,
#notes-bottom-content .node-markdown-editor-content {
  flex: 1 1 auto;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: 5px;
  overflow: hidden;
}

/*
 * The workspace is normally a query container, which also creates a stacking
 * context. When the node content is docked below the graph, that context would
 * trap the fixed full-screen panel underneath the body backdrop and make all
 * of its controls unclickable.
 */
body.node-content-fullscreen-active .workspace {
  container-type: normal;
}

body.node-content-fullscreen-active .inspector,
body.node-content-fullscreen-active .sidebar {
  overflow: hidden;
}

body.node-content-fullscreen-active::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 490;
  background: rgba(2, 7, 10, 0.82);
}

.node-content-fullscreen .notes-right-container {
  flex: 1 1 auto;
}

.node-content-fullscreen #notes-tab-panel:not(.hidden) {
  min-height: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
}

.node-content-fullscreen #node-notes {
  min-height: 0;
}

#notes-bottom-content #node-content-section {
  height: 100%;
  margin: 0;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#notes-bottom-content #notes-tab-panel:not(.hidden) {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  height: auto;
  min-height: 120px;
  overflow: hidden;
}

#notes-bottom-content #command-outputs-panel:not(.hidden),
#notes-bottom-content #evidence-panel:not(.hidden),
#notes-bottom-content #history-panel:not(.hidden) {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#notes-bottom-content .node-content-header,
#notes-bottom-content .command-output-toolbar,
#notes-bottom-content .evidence-dropzone,
#notes-bottom-content .history-explanation {
  flex: 0 0 auto;
}

#notes-bottom-content #command-output-list,
#notes-bottom-content #evidence-list,
#notes-bottom-content #history-list {
  flex: 1 1 auto;
  min-height: 0;
  padding-right: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#notes-bottom-content .notes-right-container {
  height: 100%;
  min-height: 120px;
}

#node-content-right-container .node-markdown-editor-content[data-mode="split"] {
  height: min(520px, calc(100vh - 180px));
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  overflow: hidden;
}

#node-content-right-container
  .node-markdown-editor-content[data-mode="split"]
  .notes-markdown-preview {
  border-top: 1px solid var(--border);
  border-left: 0;
}

#node-content-right-container
  .node-markdown-editor-content[data-mode="preview"] {
  height: min(520px, calc(100vh - 180px));
  overflow: hidden;
}
#notes-bottom-content #node-notes {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}

.node-content-fullscreen #node-notes,
#notes-bottom-content #node-notes {
  padding: 20px;
  resize: none;
  border: 0;
  border-radius: 0;
  font-size: 14px;
  line-height: 1.7;
  tab-size: 2;
}

.command-output-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.artifact-load-more {
  display: block;
  margin: 12px auto;
}

.command-output-empty {
  padding: 14px 10px;
  border: 1px dashed #263642;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.evidence-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin-bottom: 10px;
  padding: 18px 12px;
  border: 1px dashed #385364;
  border-radius: 6px;
  background: rgba(39, 140, 255, 0.035);
  color: #bdd0db;
  font-size: 12px;
  text-align: center;
  cursor: pointer;
}

.evidence-dropzone span {
  color: var(--muted);
  font-size: 12px;
}
.evidence-dropzone:hover,
.evidence-dropzone:focus-visible,
.evidence-dropzone.dragging {
  border-color: var(--green);
  background: rgba(24, 214, 163, 0.08);
  outline: 0;
}
.evidence-dropzone.uploading {
  opacity: 0.6;
  pointer-events: none;
}
.evidence-preview-toggle {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.evidence-preview-toggle.expanded {
  cursor: zoom-out;
}

.evidence-preview-toggle.expanded img {
  max-height: none;
}

.evidence-preview-toggle:focus-visible,
.notes-attachment-preview:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.command-output-card {
  margin-bottom: 7px;
  border: 1px solid #24333e;
  border-radius: 6px;
  background: #0a131b;
  overflow: hidden;
}

.command-output-card summary {
  padding: 10px;
  cursor: pointer;
  list-style-position: outside;
}

.command-output-heading,
.command-output-subtitle {
  display: block;
  margin-left: 3px;
}
.command-output-heading {
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
}
.command-output-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.command-output-body {
  padding: 0 10px 10px;
  border-top: 1px solid #17242d;
}
.command-output-label {
  margin: 10px 0 5px;
  color: #d5bd58;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.command-output-command,
.command-output-text {
  max-height: 280px;
  margin: 0;
  padding: 9px;
  overflow: auto;
  border: 1px solid #1b2b36;
  border-radius: 4px;
  background: #071017;
  color: #cbd5dc;
  font:
    10px/1.5 "JetBrains Mono",
    Consolas,
    monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.command-output-command {
  color: #77dabf;
}
.command-output-exit {
  margin-top: 9px;
  font-size: 12px;
  font-weight: 700;
}
.command-output-exit.success {
  color: var(--green);
}
.command-output-exit.failure {
  color: var(--red);
}
.command-output-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 10px;
}
.command-output-actions .dialog-secondary-button,
.command-output-actions .dialog-danger-button,
.evidence-actions .dialog-secondary-button,
.evidence-actions .dialog-danger-button {
  min-width: 0;
  height: var(--control-height-md);
  min-height: var(--control-height-md);
  padding: 0 9px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.command-output-delete-button {
  height: var(--control-height-md);
  min-height: var(--control-height-md);
  padding: 0 9px;
  border: 1px solid rgba(235, 91, 91, 0.42);
  border-radius: var(--radius-md);
  background: rgba(235, 91, 91, 0.04);
  color: #e78b8b;
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
}

.command-output-delete-button:hover {
  background: rgba(235, 91, 91, 0.12);
}

.notes-save-status {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 2px;
  color: var(--muted);

  font-size: 12px;
  font-weight: 600;

  letter-spacing: 0.04em;

  white-space: nowrap;
}

.notes-save-status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.notes-save-status[data-state="saved"] {
  color: var(--green);
}

.notes-save-status[data-state="saving"] {
  color: var(--blue);
}

.notes-save-status[data-state="dirty"] {
  color: var(--yellow);
}

.notes-save-status[data-state="error"] {
  color: var(--red);
}

.notes-conflict {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
  padding: 10px;
  border: 1px solid rgba(229, 197, 0, 0.45);
  border-radius: 6px;
  background: rgba(229, 197, 0, 0.08);
  color: #e8d968;
  font-size: var(--font-size-sm);
  line-height: 1.4;
}

.notes-conflict > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.notes-conflict button {
  padding: 5px 8px;
  border: 1px solid currentColor;
  border-radius: 5px;
  color: inherit;
  background: transparent;
  font-weight: 700;
}

#node-notes {
  width: 100%;

  min-height: 260px;

  padding: 10px;

  resize: vertical;

  border: 1px solid var(--border);

  border-radius: 5px;

  outline: none;

  background: #081017;

  color: #cdd7de;

  font-family: var(--font-mono);

  font-size: 12px;
  line-height: 1.5;
}

#node-notes:focus {
  border-color: var(--green);

  box-shadow: 0 0 0 2px rgba(24, 214, 163, 0.07);
}

/* =========================================================
   DIALOG BASE
========================================================= */

.node-dialog,
.app-dialog {
  width: min(560px, calc(100vw - 40px));

  max-height: calc(100vh - 60px);

  padding: 0;

  overflow: hidden;

  border: 1px solid #2b3a46;

  border-radius: 10px;

  background: #0b141c;

  color: var(--text);

  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.node-dialog::backdrop,
.app-dialog::backdrop {
  background: rgba(2, 7, 11, 0.72);

  backdrop-filter: blur(3px);
}

#node-dialog-form,
#command-output-dialog-form,
#app-dialog-form {
  display: flex;
  flex-direction: column;

  max-height: calc(100vh - 60px);
}

/* =========================================================
   DIALOG HEADER
========================================================= */

.node-dialog-header,
.app-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  gap: 20px;

  padding: 20px 22px 16px;

  border-bottom: 1px solid #1d2a34;

  background: #0d1821;
}

.node-dialog-header h2,
.app-dialog-header h2 {
  margin: 3px 0 0;

  font-size: 20px;
  font-weight: 650;
}

.node-dialog-kicker,
.app-dialog-kicker {
  color: var(--green);

  font-size: 12px;
  font-weight: 700;

  letter-spacing: 0.14em;
}

.node-dialog-close,
.app-dialog-close {
  width: 34px;
  height: 34px;

  flex: 0 0 34px;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;

  border: 1px solid transparent;

  border-radius: 6px;

  background: transparent;

  color: var(--muted);

  font-size: 24px;

  cursor: pointer;
}

.node-dialog-close:hover,
.app-dialog-close:hover {
  border-color: var(--border);

  background: #14212b;

  color: var(--text);
}

/* =========================================================
   DIALOG BODY
========================================================= */

.node-dialog-body,
.app-dialog-body {
  padding: 20px 22px;

  overflow-y: auto;
}

/* =========================================================
   FORM
========================================================= */

.form-field {
  margin-bottom: 18px;
}

.form-field:last-child {
  margin-bottom: 0;
}

.form-field label {
  display: block;

  margin-bottom: 7px;

  color: var(--form-label-color);

  font-size: var(--form-label-size);
  font-weight: var(--form-label-weight);
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;

  border: 1px solid var(--border);

  border-radius: 6px;

  outline: none;

  background: #081017;

  color: var(--text);
}

.command-output-dialog {
  width: min(760px, calc(100vw - 32px));
}
.command-output-meta-fields {
  display: grid;
  grid-template-columns: 2fr 1fr 90px;
  gap: 12px;
}
.command-output-content-input {
  min-height: 240px;
}

@media (max-width: 620px) {
  .command-output-meta-fields {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.form-field input,
.form-field select {
  height: 42px;

  padding: 0 12px;
}

.form-field textarea {
  min-height: 110px;

  padding: 11px 12px;

  resize: vertical;

  font-family: "JetBrains Mono", Consolas, monospace;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--green);

  box-shadow: 0 0 0 2px rgba(24, 214, 163, 0.08);
}

.field-help {
  margin-top: 8px;

  padding: 9px 11px;

  border-left: 2px solid var(--blue);

  border-radius: 0 5px 5px 0;

  background: rgba(39, 140, 255, 0.07);

  color: #9aa9b5;

  font-size: 12px;
  line-height: 1.45;
}

/* =========================================================
   DIALOG FOOTER
========================================================= */

.node-dialog-footer,
.app-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;

  gap: 9px;

  padding: 15px 22px;

  border-top: 1px solid #1d2a34;

  background: #0d1821;
}

.dialog-secondary-button,
.dialog-primary-button,
.dialog-warning-button,
.dialog-danger-button {
  min-width: 110px;

  padding: 9px 15px;

  border-radius: 6px;

  font-size: 13px;
  font-weight: 600;

  cursor: pointer;
}

.dialog-warning-button {
  border: 1px solid color-mix(in srgb, var(--color-warning) 55%, transparent);
  background: color-mix(in srgb, var(--color-warning) 7%, transparent);
  color: #e8d974;
}

.dialog-warning-button:hover {
  border-color: var(--color-warning);
  background: color-mix(in srgb, var(--color-warning) 14%, transparent);
}

.dialog-secondary-button {
  border: 1px solid var(--border);

  background: transparent;

  color: var(--muted);
}

.dialog-secondary-button:hover {
  background: #14212b;

  color: var(--text);
}

.dialog-primary-button {
  border: 1px solid var(--green);

  background: rgba(24, 214, 163, 0.12);

  color: var(--green);
}

.dialog-primary-button:hover {
  background: rgba(24, 214, 163, 0.22);
}

.dialog-danger-button {
  border: 1px solid rgba(248, 81, 73, 0.48);
  background: rgba(248, 81, 73, 0.06);
  color: #ed9696;
}

.dialog-danger-button:hover {
  border-color: rgba(248, 81, 73, 0.7);
  background: rgba(248, 81, 73, 0.14);
  color: #ffaaa5;
}

.compact-action-button,
.admin-compact-button.dialog-primary-button,
.admin-compact-button.dialog-secondary-button,
.admin-compact-button.dialog-warning-button,
.admin-compact-button.dialog-danger-button {
  width: auto;
  min-width: 0;
  height: var(--control-height-md);
  min-height: var(--control-height-md);
  padding: 0 9px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
}

/* =========================================================
   APP DIALOG
========================================================= */

.app-dialog-message {
  margin-bottom: 18px;

  color: #c8d1d8;

  font-size: 13px;
  line-height: 1.55;

  white-space: pre-line;
}

.relation-preview {
  display: flex;
  flex-direction: column;
  align-items: center;

  gap: 8px;

  margin-bottom: 20px;

  padding: 16px;

  border: 1px solid var(--border);

  border-radius: 8px;

  background: #081017;
}

.relation-preview-node {
  width: 100%;

  padding: 10px 12px;

  border: 1px solid #2d3d49;

  border-radius: 6px;

  background: #101b25;

  color: var(--text);

  text-align: center;

  font-size: 13px;
  font-weight: 600;
}

.relation-preview-arrow {
  color: var(--blue);

  font-size: 18px;
}

.app-dialog-options {
  margin-bottom: 18px;
}

.app-dialog-options-label {
  margin-bottom: 8px;

  color: #c8d1d8;

  font-size: 12px;
  font-weight: 600;
}

.app-dialog-options-list {
  display: flex;
  flex-direction: column;

  gap: 8px;
}

.app-dialog-option {
  display: flex;
  align-items: flex-start;

  gap: 10px;

  padding: 11px 12px;

  border: 1px solid var(--border);

  border-radius: 6px;

  background: #081017;

  cursor: pointer;
}

.app-dialog-option:hover {
  border-color: var(--blue);

  background: rgba(39, 140, 255, 0.06);
}

.app-dialog-option input {
  margin-top: 3px;

  accent-color: var(--blue);
}

.app-dialog-option-title {
  color: var(--text);

  font-size: 13px;
  font-weight: 600;
}

.app-dialog-option-description {
  margin-top: 3px;

  color: var(--muted);

  font-size: 12px;
}

.app-dialog-warning {
  margin-top: 14px;

  padding: 11px 12px;

  border: 1px solid rgba(229, 197, 0, 0.35);

  border-radius: 6px;

  background: rgba(229, 197, 0, 0.07);

  color: #e8d968;

  font-size: 12px;

  white-space: pre-line;
}

.dialog-inline-error {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 99, 115, 0.55);
  border-radius: 6px;
  background: rgba(255, 99, 115, 0.09);
  color: #ff9aa6;
  font-size: var(--font-size-sm);
  line-height: 1.45;
}

.dialog-inline-error[data-tone="warning"] {
  border-color: rgba(229, 197, 0, 0.4);
  background: rgba(229, 197, 0, 0.07);
  color: #e8d968;
}

/* =========================================================
   DIALOG MODES
========================================================= */

.app-dialog.mode-danger {
  border-color: rgba(248, 81, 73, 0.5);
}

.app-dialog.mode-danger .app-dialog-kicker {
  color: var(--red);
}

.app-dialog.mode-danger .dialog-primary-button {
  border-color: var(--red);

  background: rgba(248, 81, 73, 0.1);

  color: var(--red);
}

.app-dialog.mode-warning {
  border-color: rgba(229, 197, 0, 0.45);
}

.app-dialog.mode-warning .app-dialog-kicker {
  color: var(--yellow);
}

.app-dialog.mode-warning .dialog-primary-button {
  border-color: var(--yellow);

  background: rgba(229, 197, 0, 0.1);

  color: var(--yellow);
}

.app-dialog.mode-relation {
  border-color: rgba(39, 140, 255, 0.45);
}

.app-dialog.mode-relation .app-dialog-kicker {
  color: var(--blue);
}

.app-dialog.mode-success {
  border-color: rgba(24, 214, 163, 0.45);
}

.app-dialog.mode-success .app-dialog-kicker {
  color: var(--green);
}

/* =========================================================
   TOOL NAVIGATION AND MANAGEMENT
========================================================= */

.view-navigation {
  align-self: stretch;
  display: flex;
  align-items: center;
}
.toolbar .view-navigation-button {
  min-width: 68px;
  height: var(--control-height-md);
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.toolbar .view-navigation-button:hover {
  border-bottom-color: #445866;
  color: var(--text);
}
.toolbar .view-navigation-button.active {
  border-bottom-color: var(--green);
  color: var(--green);
}
.workspace-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: 7px;
  padding-left: 7px;
  border-left: 1px solid var(--border);
}

.workspace-actions.view-actions-unavailable {
  visibility: hidden;
  pointer-events: none;
}
.toolbar .workspace-action-button {
  height: var(--control-height-md);
  padding-inline: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
}
.toolbar #add-node-button.workspace-action-button {
  border-color: color-mix(in srgb, var(--green) 55%, var(--border));
  background: color-mix(in srgb, var(--green) 13%, var(--panel));
  color: var(--green);
}
@container (max-width: 960px) {
  .toolbar-context-cell #add-node-button,
  .toolbar-context-cell #scan-import-button,
  .toolbar-context-cell #graph-search-button,
  .toolbar-context-cell #duplicate-nodes-button {
    width: var(--control-height-md);
    padding-inline: 0;
    font-size: 0;
  }
}
@container (max-width: 520px) {
  .toolbar-context-cell .view-navigation-button {
    flex: 0 0 46px;
    min-width: 0;
    padding-inline: 2px;
    font-size: 9px;
  }
}
.tools-header-actions,
.tool-management-actions {
  display: flex;
  gap: 7px;
}
.tools-view-header .dialog-secondary-button,
.tools-view-header .dialog-primary-button {
  width: auto;
  flex: 0 0 auto;
}
.tool-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.tool-management-actions .dialog-primary-button,
.tool-management-actions .dialog-secondary-button,
.tool-management-actions .dialog-warning-button,
.tool-management-actions .dialog-danger-button,
.tool-management-actions .command-output-delete-button {
  min-width: 0;
  height: var(--control-height-md);
  min-height: var(--control-height-md);
  padding: 0 9px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
}
.knowledge-graph-warning {
  margin: 0 0 16px;
  padding: 10px;
  border: 1px solid rgba(229, 197, 0, 0.4);
  border-radius: 6px;
  background: rgba(229, 197, 0, 0.06);
  color: #e8d974;
  font-size: 12px;
  line-height: 1.5;
}
.tool-metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 12px;
  padding: 8px 9px;
  border: 1px solid #1b2a34;
  border-radius: 5px;
  color: var(--muted);
  font-size: 12px;
}
.tool-flag-list {
  border: 1px solid #1d2d37;
  border-radius: 6px;
  overflow: hidden;
}
.tool-flag-row {
  display: grid;
  grid-template-columns: minmax(100px, 0.8fr) minmax(180px, 2fr) minmax(
      80px,
      0.7fr
    );
  gap: 10px;
  padding: 8px 9px;
  border-bottom: 1px solid #172630;
  align-items: start;
  font-size: 12px;
}
.tool-flag-row:last-child {
  border-bottom: 0;
}
.tool-flag-row > code:first-child {
  color: #79d9be;
  overflow-wrap: anywhere;
}
.tool-flag-row > span {
  color: #b6c1c9;
  line-height: 1.45;
}
.tool-flag-placeholder {
  color: #d8c35d;
}
.tool-detail-empty.compact {
  padding: 12px;
}
.tool-editor-dialog {
  width: min(800px, calc(100vw - 32px));
}
.tool-import-dialog {
  width: min(720px, calc(100vw - 32px));
}
#tool-editor-form,
#tool-import-form,
#knowledge-entry-editor-form {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px);
}
.tool-editor-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 12px;
}
.tool-editor-grid.two-columns {
  grid-template-columns: 1fr 1fr;
}
.tool-phase-fieldset {
  margin: 0 0 18px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.tool-phase-fieldset legend {
  padding: 0 5px;
  color: #c8d1d8;
  font-size: 12px;
  font-weight: 600;
}
.tool-choice-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.tool-choice-chip {
  width: auto;
  min-width: 0;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel2);
  color: var(--muted);
  font-size: 12px;
}
.tool-choice-chip[aria-pressed="true"] {
  border-color: var(--color-info);
  background: color-mix(in srgb, var(--color-info) 15%, transparent);
  color: var(--text);
}
.tool-phase-fieldset > .knowledge-chip-editor {
  margin-top: 2px;
}
.tool-stacked-chip-editor {
  display: grid;
  align-items: stretch;
  gap: 7px;
  padding: 0;
  border: 0;
  background: transparent;
}
.tool-stacked-chip-editor > .knowledge-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tool-stacked-chip-editor > .knowledge-chip-list:empty {
  display: none;
}
.tool-stacked-chip-editor > input {
  width: 100%;
  min-height: var(--control-height-md);
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
}
.structured-text-field textarea {
  min-height: 125px;
}
.tool-help-assistant {
  margin: 0 0 18px;
  padding: 11px;
  border: 1px solid rgba(39, 140, 255, 0.35);
  border-radius: 6px;
  background: rgba(39, 140, 255, 0.04);
}
.tool-help-assistant summary {
  color: #76b6ff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.tool-help-assistant p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.tool-help-assistant textarea {
  width: 100%;
  min-height: 140px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #071017;
  color: var(--text);
  font:
    10px/1.45 "JetBrains Mono",
    Consolas,
    monospace;
  resize: vertical;
}
.tool-help-assistant button {
  width: auto;
  min-width: 0;
  margin-top: 8px;
  padding: 6px 9px;
  font-size: 12px;
}
#tool-help-result {
  margin-left: 9px;
  color: var(--green);
  font-size: 12px;
}
.tool-import-intro {
  margin: 0 0 15px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.tool-catalog-actions {
  display: flex;
  margin-bottom: 14px;
}
.tool-catalog-actions .dialog-secondary-button {
  width: auto;
}
.tool-import-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 24px 16px;
  border: 1px dashed #3a5365;
  border-radius: 7px;
  background: rgba(39, 140, 255, 0.04);
  color: #c9d3da;
  text-align: center;
  cursor: pointer;
}
.tool-import-dropzone:hover,
.tool-import-dropzone.dragging {
  border-color: var(--blue);
  background: rgba(39, 140, 255, 0.1);
}
.tool-import-dropzone span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.tool-import-dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}
.tool-import-file-name {
  margin: 7px 0 14px;
  color: #78b8ff;
  font-size: 12px;
  text-align: center;
}
.tool-import-advanced {
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid #22333e;
  border-radius: 6px;
}
.tool-import-advanced summary {
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.tool-import-advanced p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.tool-import-advanced .dialog-secondary-button {
  width: auto;
  min-width: 0;
  padding: 6px 9px;
  font-size: 12px;
}
.tool-import-json {
  min-height: 220px;
}
.tool-import-preview {
  margin-bottom: 14px;
  padding: 11px;
  border: 1px solid rgba(24, 214, 163, 0.32);
  border-radius: 6px;
  background: rgba(24, 214, 163, 0.035);
}
#tool-import-preview-summary {
  margin: 7px 0;
  color: #c7d1d8;
  font-size: 12px;
}
#tool-import-preview-list {
  max-height: 150px;
  margin: 0;
  padding-left: 19px;
  overflow: auto;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.dialog-primary-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.tool-import-update-option {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #c3cdd5;
  font-size: 12px;
}
.tool-import-error {
  margin-top: 12px;
  padding: 9px;
  border: 1px solid rgba(248, 81, 73, 0.4);
  border-radius: 5px;
  color: #f28b86;
  font-size: 12px;
}
.tool-action-dialog {
  width: min(700px, calc(100vw - 32px));
}
#tool-action-form {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px);
}
.tool-action-context {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px;
  border: 1px solid rgba(39, 140, 255, 0.3);
  border-radius: 6px;
  background: rgba(39, 140, 255, 0.05);
}

.scan-import-text {
  min-height: 280px;
  font-family: var(--font-mono);
}

.scan-import-preview {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
}

.scan-import-preview[data-state="ready"] {
  border-color: var(--green);
  color: var(--green);
}

.scan-import-preview[data-state="error"] {
  border-color: var(--red);
  color: var(--red);
}
.tool-action-context strong {
  color: #79baff;
}
.tool-action-context span {
  color: var(--muted);
  font-size: 12px;
}
.tool-action-placeholders {
  margin-bottom: 18px;
  padding: 11px;
  border: 1px solid #263844;
  border-radius: 6px;
}
.tool-action-placeholders .section-title {
  margin-bottom: 9px;
}
#tool-action-placeholder-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 10px;
}
.tool-custom-os-field {
  margin: 12px 0 0;
}
.tool-command-editor-section {
  margin-bottom: 18px;
}
.tool-command-editor-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tool-command-editor-row {
  display: grid;
  grid-template-columns:
    minmax(120px, 0.7fr) minmax(220px, 1.5fr) minmax(180px, 1fr)
    auto;
  gap: 7px;
  align-items: stretch;
  padding: 9px;
  border: 1px solid #22343f;
  border-radius: 6px;
  background: #081119;
}
.tool-command-editor-row input,
.tool-command-editor-row textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 9px;
  border: 1px solid var(--border);
  border-radius: 5px;
  outline: none;
  background: #050c11;
  color: var(--text);
  font-size: 12px;
  resize: vertical;
}
.tool-command-editor-row textarea {
  font-family: "JetBrains Mono", Consolas, monospace;
}
.tool-command-editor-row input:focus,
.tool-command-editor-row textarea:focus {
  border-color: var(--green);
}
.tool-command-editor-row .command-output-delete-button {
  align-self: center;
  white-space: nowrap;
}
.tool-command-editor-empty {
  padding: 14px;
  border: 1px dashed #263642;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.tool-command-annotation-editor {
  grid-column: 1 / -1;
  padding-top: 8px;
  border-top: 1px solid #1d2c36;
}
.tool-command-annotation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  color: #d5bd58;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.tool-command-annotation-header .property-add-button {
  flex: 0 0 auto;
}
.tool-command-annotation-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.tool-command-annotation-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.7fr) minmax(220px, 1.7fr) 28px;
  gap: 6px;
}
.tool-command-annotation-row input {
  min-height: 32px;
}
.tool-command-annotation-row .property-delete-button {
  width: 28px;
  height: 32px;
}

@media (max-width: 720px) {
  .tool-editor-grid,
  .tool-editor-grid.two-columns {
    grid-template-columns: 1fr;
  }
  .tool-flag-row {
    grid-template-columns: 1fr;
  }
  .tool-command-editor-row {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   SCROLLBARS
========================================================= */

.sidebar,
.inspector,
.node-dialog-body,
.app-dialog-body,
.admin-center-content,
.admin-navigation,
.account-session-list,
.graph-search-results,
.graph-list-items,
.tool-list,
.knowledge-entry-list,
.node-inventory-list,
.command-palette-results {
  overscroll-behavior: contain;
}

* {
  scrollbar-width: auto;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}

*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

*::-webkit-scrollbar-thumb {
  min-height: 36px;
  border: 2px solid var(--scrollbar-track);
  border-radius: 999px;
  background: var(--scrollbar-thumb);
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:active {
  background: var(--scrollbar-thumb-active);
  background-clip: padding-box;
}

*::-webkit-scrollbar-corner {
  background: var(--scrollbar-track);
}

/* =========================================================
   RESPONSIVE
========================================================= */

.login-dialog {
  width: min(430px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  border-color: rgba(130, 169, 189, 0.32);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 0, rgba(24, 214, 163, 0.08), transparent 38%),
    #0a131a;
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.68),
    0 0 0 1px rgba(255, 255, 255, 0.025);
}

.login-dialog::backdrop {
  background:
    radial-gradient(circle at 50% 35%, rgba(18, 50, 59, 0.36), transparent 45%),
    rgba(2, 7, 11, 0.92);
  backdrop-filter: blur(10px);
}

.login-form {
  display: grid;
  max-height: calc(100dvh - 32px);
  grid-template-rows: auto minmax(0, 1fr);
}

.auth-header {
  padding: 30px 36px 12px;
  text-align: center;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 26px;
  color: #dce7ec;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.025em;
}

.auth-brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(24, 214, 163, 0.5);
  border-radius: 9px;
  background: rgba(24, 214, 163, 0.09);
  color: var(--green);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.auth-header .node-dialog-kicker {
  margin-bottom: 7px;
  font-size: 12px;
  letter-spacing: 0.17em;
}

.auth-header h2 {
  margin: 0;
  color: #f1f6f8;
  font-size: 26px;
  font-weight: 680;
  letter-spacing: -0.025em;
}

.auth-mode-description {
  margin: 8px 0 0;
  color: #81929d;
  font-size: 12px;
  line-height: 1.5;
}

.login-dialog-body {
  display: grid;
  gap: 9px;
  padding: 18px 36px 30px;
  overscroll-behavior: contain;
}

.login-dialog-body input {
  width: 100%;
  height: 46px;
  border-color: #2a3b46;
  border-radius: 8px;
  background: #071017;
  color: #f2f7fa;
  caret-color: var(--green);
  font-size: 13px;
}

.login-dialog-body input::placeholder {
  color: #91a2ad;
  opacity: 1;
}

.login-dialog-body input:-webkit-autofill,
.login-dialog-body input:-webkit-autofill:hover,
.login-dialog-body input:-webkit-autofill:focus {
  -webkit-text-fill-color: #f2f7fa;
  caret-color: var(--green);
  box-shadow: 0 0 0 1000px #071017 inset;
}

.login-dialog-body input:hover {
  border-color: #3a505e;
}

.login-dialog-body input:focus {
  border-color: rgba(24, 214, 163, 0.75);
  box-shadow: 0 0 0 3px rgba(24, 214, 163, 0.09);
}

.login-dialog-body > label {
  margin-top: 4px;
  color: #c3ced4;
  font-size: 12px;
  font-weight: 650;
}

#auth-submit.dialog-primary-button {
  width: 100%;
  min-height: 46px;
  margin-top: 3px;
  border-color: #20d8a8;
  border-radius: 8px;
  background: #19c99d;
  color: #04100d;
  font-size: 13px;
  font-weight: 760;
  box-shadow: 0 8px 24px rgba(24, 214, 163, 0.13);
}

#auth-submit.dialog-primary-button:hover {
  border-color: #47e7bd;
  background: #25d9aa;
}

#auth-submit.dialog-primary-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.login-error {
  min-height: 0;
  margin: 1px 0;
  color: #ff718a;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.login-error:empty {
  display: none;
}

.login-status {
  min-height: 0;
  margin: 1px 0;
  color: #74e6bf;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.login-status:empty {
  display: none;
}

.auth-provider-options {
  display: grid;
  gap: 10px;
  margin-top: 7px;
}

.auth-provider-options > span {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.auth-provider-options > span::before,
.auth-provider-options > span::after {
  height: 1px;
  flex: 1;
  background: #21313b;
  content: "";
}

.auth-provider-options > div {
  display: grid;
  gap: 6px;
}

.auth-provider-options .dialog-secondary-button {
  width: 100%;
  min-height: 43px;
  border-color: #2a3d49;
  background: rgba(255, 255, 255, 0.018);
  color: #cdd9df;
  font-weight: 650;
}

.auth-help {
  margin: 0 0 6px;
  padding: 10px 11px;
  border: 1px solid rgba(103, 173, 255, 0.16);
  border-radius: 7px;
  background: rgba(39, 140, 255, 0.045);
  color: #9db2c0;
  font-size: 12px;
  line-height: 1.45;
}

.auth-test-result {
  display: grid;
  gap: 14px;
  color: #9db2c0;
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

.auth-test-result p {
  margin: 0;
}

.auth-test-result .dialog-primary-button {
  width: 100%;
  min-height: 46px;
}

.auth-method-actions,
.auth-support-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-method-actions:empty,
.auth-support-actions:empty {
  display: none;
}

.auth-method-actions .dialog-secondary-button {
  width: 100%;
  min-height: 42px;
  border-color: #293c48;
  color: #b9c7ce;
}

.auth-support-actions .dialog-secondary-button,
.auth-account-switch .dialog-secondary-button {
  width: auto;
  min-width: 0;
  padding: 4px;
  border: 0;
  background: transparent;
  color: #71bca9;
  font-size: 12px;
  font-weight: 650;
}

.auth-support-actions .dialog-secondary-button:hover,
.auth-account-switch .dialog-secondary-button:hover {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-account-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 30px;
  margin-top: 4px;
  padding-top: 13px;
  border-top: 1px solid #1c2b34;
  color: #778993;
  font-size: 12px;
}

.auth-account-switch:has(#auth-mode-toggle.hidden) {
  display: none;
}

.registration-consent {
  display: grid;
  gap: 7px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

@media (max-height: 680px) {
  .auth-header {
    padding-top: 20px;
  }

  .auth-brand {
    margin-bottom: 14px;
  }

  .login-dialog-body {
    padding-bottom: 20px;
  }
}

.registration-consent.hidden {
  display: none;
}

.registration-consent label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 1.45;
}

.registration-consent input[type="checkbox"] {
  appearance: none;
  width: 16px;
  min-width: 16px;
  height: 16px;
  margin: 0;
  border: 1px solid #526775;
  border-radius: 3px;
  background: #081017;
}

.registration-consent input[type="checkbox"]:checked {
  border-color: var(--green);
  background: var(--green);
  box-shadow: inset 0 0 0 3px #081017;
}

.registration-consent input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.registration-consent a {
  color: var(--green);
}

.turnstile-container {
  min-height: 65px;
}

.turnstile-container.hidden {
  display: none;
}

.session-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 0;
  border-left: 0;
  color: var(--text-muted, #9badb9);
  font-size: 12px;
  flex: 0 0 auto;
}

.account-menu-button {
  min-width: 0;
  height: var(--control-height-md);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  font-size: 12px;
}

.account-menu-button:hover,
.account-menu-button:focus-visible {
  border-color: #314550 !important;
  background: #101c24 !important;
}

.account-menu-button #current-user-label {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-chevron {
  color: var(--muted);
  font-size: 12px;
}

.account-menu-popover {
  position: fixed;
  inset: 52px 12px auto auto;
  width: min(250px, calc(100vw - 24px));
  margin: 0;
  padding: 6px;
  border: 1px solid #2b3a46;
  border-radius: 8px;
  background: #0b141c;
  color: var(--text);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
}

.account-menu-popover:popover-open {
  display: grid;
  gap: 3px;
}

.account-menu-popover::backdrop {
  background: transparent;
}

.account-tenant-context {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.account-tenant-context label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.account-tenant-context select {
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel2);
  color: var(--text);
  font: inherit;
}

.account-tenant-context button {
  width: 100%;
  min-height: 30px;
  padding: 5px 8px;
  font-size: 11px;
}

.account-menu-popover .account-menu-item {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 9px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  text-align: left;
  text-decoration: none;
}

.account-menu-popover .account-menu-item:hover,
.account-menu-popover .account-menu-item:focus-visible {
  outline: 0;
  background: #14232d;
}

.account-menu-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.account-menu-popover .account-menu-signout {
  margin-top: 3px;
  border-top: 1px solid #22303c;
  border-radius: 0 0 5px 5px;
  color: var(--muted);
}

.auth-legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 8px;
}

.auth-legal-button {
  padding: 3px 5px;
  border: 0;
  background: transparent;
  color: #778993;
  font-size: 11px;
  text-decoration: none;
}

.auth-legal-button:hover,
.auth-legal-button:focus-visible {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.product-sources-dialog {
  width: min(880px, calc(100vw - 32px));
  max-height: min(820px, calc(100vh - 32px));
}

.product-sources-dialog[open] {
  height: min(820px, calc(100dvh - 32px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.product-sources-body {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 18px;
  min-height: 0;
  overflow: hidden;
}

.product-sources-intro,
.product-source-description,
.product-source-summary p,
.product-source-row p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.product-sbom-download {
  justify-self: start;
  color: #71bca9;
  font-size: 12px;
  font-weight: 700;
}

.product-source-summary,
.product-source-section {
  display: grid;
  gap: 9px;
}

#product-sources-content {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 18px;
  padding-right: 7px;
  overflow-y: auto;
}

.product-source-summary {
  padding: 14px;
  border: 1px solid rgba(103, 173, 255, 0.2);
  border-radius: var(--radius-md);
  background: rgba(39, 140, 255, 0.045);
}

.product-source-summary h3,
.product-source-section h3 {
  margin: 0;
  font-size: 14px;
}

.product-source-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.product-source-row {
  display: grid;
  grid-template-columns: minmax(170px, 0.8fr) minmax(150px, 0.65fr) minmax(
      220px,
      1.2fr
    );
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 9px 11px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.018);
}

.product-source-row:last-child {
  border-bottom: 0;
}

.product-source-row:nth-child(even) {
  background: rgba(255, 255, 255, 0.035);
}

.product-source-heading {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.product-source-metadata {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.product-source-heading strong {
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-source-heading code,
.product-source-license {
  color: #a9bac4;
  font-size: 11px;
}

.product-source-heading code {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
}

.product-source-license {
  min-width: 0;
  overflow-wrap: anywhere;
}

.product-source-metadata a {
  flex: 0 0 auto;
  color: #71bca9;
  font-size: 11px;
  font-weight: 650;
}

.product-source-row .product-source-note {
  min-width: 0;
  font-size: 11px;
}

@media (max-width: 720px) {
  .product-source-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
}

.product-sources-footer {
  justify-content: space-between;
}

.product-sources-footer span {
  color: var(--muted);
  font-size: 11px;
}

.user-role-badge {
  padding: 2px 5px;
  border: 1px solid #314550;
  border-radius: 999px;
  color: #82a9bd;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.2;
  text-transform: uppercase;
}

.admin-dialog {
  width: min(980px, calc(100vw - 32px));
}

.admin-dialog[open] {
  height: min(780px, calc(100vh - 32px));
  max-height: calc(100vh - 32px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.admin-dialog-body {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.admin-navigation {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 10px;
  border-right: 1px solid #1d2a34;
  background: #081118;
  overflow-y: auto;
}

.admin-navigation-button {
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--muted);
  font-size: var(--font-size-sm);
  text-align: left;
  cursor: pointer;
}

.admin-navigation-button:hover,
.admin-navigation-button:focus-visible {
  border-color: var(--border);
  outline: 0;
  color: var(--text);
}

.admin-navigation-button.active {
  border-color: rgba(24, 214, 163, 0.25);
  background: rgba(24, 214, 163, 0.08);
  color: var(--green);
}

.admin-center-content {
  min-width: 0;
  min-height: 0;
  padding: 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.admin-center-panel {
  display: grid;
  gap: 14px;
}

.admin-center-panel.hidden {
  display: none;
}

.admin-section {
  min-width: 0;
  padding: 14px;
  border: 1px solid #22323d;
  border-radius: 7px;
  background: #09131a;
}

.admin-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.admin-section h3,
.admin-section-heading h3 {
  margin: 0 0 4px;
  font-size: 14px;
}

.admin-section p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.admin-section select,
.admin-user-form input,
.admin-user-form select,
.admin-project-form input,
.admin-project-form select,
.admin-project-form textarea,
.admin-catalog-toolbar select,
.admin-catalog-form input,
.admin-catalog-row input {
  min-width: 0;
  height: var(--control-height-md);
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: 0;
  background: #081017;
  color: var(--text);
}

.admin-project-form textarea {
  min-height: 70px;
  padding: 8px 9px;
  resize: vertical;
}

.admin-section-heading select {
  max-width: 160px;
}

.admin-user-list,
.admin-membership-list,
.admin-project-list,
.admin-catalog-list {
  display: grid;
  gap: 5px;
}

.admin-project-row,
.admin-catalog-row {
  min-width: 0;
  display: grid;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid #1d303b;
  border-radius: 5px;
  background: #0a151c;
}

.admin-project-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.admin-project-row.archived {
  border-style: dashed;
  opacity: 0.72;
}

.admin-project-identity {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.admin-project-identity strong,
.admin-project-identity span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-project-identity span {
  color: var(--muted);
  font-size: var(--font-size-xs);
}

.admin-project-actions {
  display: flex;
  gap: 5px;
}

.admin-project-form {
  display: grid;
  gap: 10px;
}

.admin-project-form > .dialog-primary-button {
  width: auto;
  justify-self: end;
}

.admin-project-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.admin-project-fields label,
.admin-catalog-toolbar label,
.admin-catalog-form label {
  display: grid;
  gap: 5px;
  color: var(--form-label-color);
  font-size: var(--form-label-size);
  font-weight: var(--form-label-weight);
}

.admin-project-wide {
  grid-column: 1 / -1;
}

.admin-catalog-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.admin-catalog-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.admin-catalog-form .dialog-primary-button {
  width: auto;
  min-width: 0;
}

.admin-catalog-row {
  grid-template-columns: minmax(0, 1fr) auto auto auto;
}

.admin-catalog-scope {
  padding: 3px 6px;
  border: 1px solid #2b414e;
  border-radius: 999px;
  color: #82a9bd;
  font-size: var(--font-size-xs);
  text-transform: uppercase;
}

.admin-user-row,
.admin-membership-row {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid #1d303b;
  border-radius: 5px;
  background: #0a151c;
}

.admin-user-row {
  min-height: 0;
  display: grid;
  gap: 12px;
  padding: 12px;
  border-radius: 7px;
}

.admin-user-row.disabled {
  border-style: dashed;
}

.admin-user-identity {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.admin-user-identity-text {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.admin-user-identity-text strong {
  color: var(--text);
  font-size: var(--font-size-md);
}

.admin-user-badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-user-state {
  padding: 2px 7px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.admin-user-state.active {
  color: var(--color-success);
}
.admin-user-state.disabled {
  color: var(--muted);
}

.admin-user-source {
  padding: 2px 5px;
  border: 1px solid #253945;
  border-radius: 999px;
  color: #82a9bd;
  font-size: 12px;
  text-transform: uppercase;
}

.admin-user-email {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-email.verified {
  color: #82a9bd;
}

.admin-email-state {
  width: fit-content;
  padding: 2px 6px;
  border: 1px solid #3f4c55;
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.admin-email-state.verified {
  border-color: #2d6b5a;
  color: #82c9ae;
}

.admin-email-state.pending,
.admin-user-state.pending {
  border-color: #725e2d;
  color: #d4b768;
}

.admin-user-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid #1d303b;
}

.admin-user-access-controls,
.admin-user-management-actions {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-user-management-actions {
  justify-content: flex-end;
}

.admin-user-role-control {
  display: grid;
  gap: 4px;
  color: var(--form-label-color);
  font-size: var(--form-label-size);
  font-weight: var(--form-label-weight);
}

.admin-user-actions select {
  width: 132px;
  height: var(--control-height-sm);
  padding-inline: 7px;
  font-size: var(--font-size-sm);
}

.admin-user-action.dialog-secondary-button,
.admin-user-action.dialog-warning-button,
.admin-user-action.dialog-danger-button {
  width: auto;
  min-width: 0;
  height: var(--control-height-md);
  min-height: var(--control-height-sm);
  padding: 0 9px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  font-weight: 600;
}

.admin-user-actions .property-delete-button {
  width: var(--control-height-sm);
  height: var(--control-height-sm);
  margin-left: auto;
}

.admin-user-more {
  position: relative;
}

.admin-user-more summary {
  min-height: var(--control-height-sm);
  display: flex;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--muted);
  font-size: var(--font-size-xs);
  list-style: none;
  cursor: pointer;
}

.admin-user-more summary::-webkit-details-marker {
  display: none;
}

.admin-user-more-actions {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  min-width: 170px;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #0d1821;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.admin-user-more-actions button {
  width: 100%;
  justify-content: flex-start;
}

.admin-membership-toggle span {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-membership-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(360px, 2fr);
}

.admin-membership-toggle {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.admin-project-role-options {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin: 0;
  padding: 0;
  border: 0;
}

.admin-project-role-option {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 6px;
  border: 1px solid #2b414e;
  border-radius: var(--radius-md);
  background: #081017;
  cursor: pointer;
}

.admin-project-role-option:has(input:checked) {
  border-color: var(--green);
  background: rgba(24, 214, 163, 0.08);
}

.admin-project-role-option:has(input:focus-visible) {
  outline: 2px solid var(--color-focus);
  outline-offset: 1px;
}

.admin-project-role-option:has(input:disabled) {
  opacity: 0.45;
  cursor: not-allowed;
}

.admin-project-role-option input {
  flex: 0 0 auto;
  margin: 2px 0 0;
}

.admin-project-role-option span,
.admin-project-role-option strong,
.admin-project-role-option small {
  min-width: 0;
  display: block;
}

.admin-project-role-option strong {
  color: var(--text);
  font-size: var(--font-size-xs);
}

.admin-project-role-option small {
  margin-top: 2px;
  color: #82a9bd;
  font-size: 12px;
  line-height: 1.25;
}

.admin-user-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.admin-form-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.admin-form-heading span {
  color: var(--muted);
  font-size: var(--font-size-xs);
}

.admin-user-search {
  width: min(220px, 42%);
  height: var(--control-height-md);
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text);
}

.admin-user-toolbar {
  min-width: 0;
  flex: 1 1 360px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.admin-users-sync-state {
  max-width: 250px;
  color: var(--muted);
  font-size: var(--font-size-xs);
  line-height: 1.35;
  text-align: right;
}

.admin-users-sync-state.error {
  color: #ff718a;
}

.admin-user-toolbar .admin-user-search {
  width: min(220px, 100%);
}

[data-admin-panel="users"] > .admin-section-heading {
  flex-wrap: wrap;
}

.admin-user-form label {
  display: grid;
  gap: 4px;
  color: var(--form-label-color);
  font-size: var(--form-label-size);
  font-weight: var(--form-label-weight);
}

.admin-user-form label small,
.admin-oidc-form > label small {
  color: var(--muted);
  font-weight: 400;
}

.admin-user-form button,
#admin-membership-save {
  width: auto;
  min-width: 0;
  margin-top: 8px;
}

.admin-user-form button {
  grid-column: 1 / -1;
  justify-self: end;
}

.admin-invite-state {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 184, 77, 0.35);
  border-radius: var(--radius-md);
  background: rgba(255, 184, 77, 0.06);
  color: #ffd397;
  font-size: var(--font-size-xs);
}

.dirty-dialog-warning {
  max-width: 360px;
  margin-right: auto;
  color: #ffd397;
  font-size: var(--font-size-xs);
  line-height: 1.4;
}

.admin-membership-list {
  min-height: 122px;
}

.admin-membership-row {
  cursor: default;
}

.admin-membership-row input {
  accent-color: var(--green);
}

.admin-status {
  position: sticky;
  bottom: -18px;
  z-index: 5;
  min-height: 18px;
  margin: 0 -18px -18px;
  padding: 8px 18px;
  background: #0b141c;
  color: var(--muted);
  font-size: 12px;
}

.admin-status.success {
  color: var(--green);
}

.admin-status.error {
  color: #ff718a;
}

.shortcut-dialog {
  width: min(620px, calc(100vw - 32px));
}

.shortcut-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-xs);
}

.shortcut-table th,
.shortcut-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.admin-empty {
  padding: 28px 10px;
  text-align: center;
}

.admin-registration-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-registration-form,
.admin-registration-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-security-dialog {
  width: min(860px, calc(100vw - 32px));
}

.account-security-body {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
}

.account-security-body > .ui-status {
  grid-column: 1 / -1;
}

.account-activity-section {
  grid-column: 1 / -1;
}

.account-password-form {
  display: grid;
  gap: 10px;
}

.account-password-form label {
  display: grid;
  gap: 4px;
  color: var(--form-label-color);
  font-size: var(--form-label-size);
  font-weight: var(--form-label-weight);
}

.account-password-form input {
  height: var(--control-height-md);
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text);
}

.account-password-form .dialog-primary-button {
  width: auto;
  justify-self: end;
}

.account-access-warning {
  margin-top: 7px;
  padding-left: 9px;
  border-left: 2px solid #b88b45;
  color: #cfbd9b !important;
}

.account-security-refresh.dialog-secondary-button {
  width: auto;
}

.account-danger-zone {
  border-color: color-mix(in srgb, var(--color-danger) 45%, var(--border));
}

.account-data-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-session-list {
  display: grid;
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
}

.account-session-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid #1d303b;
  border-radius: var(--radius-md);
  background: #0a151c;
}

.account-session-row > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.account-session-row strong {
  font-size: 12px;
}
.account-session-row span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.admin-registration-toggle {
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}

.admin-registration-toggle input {
  accent-color: var(--green);
}

.admin-registration-form .dialog-primary-button {
  width: auto;
  min-width: 0;
}

.account-data-actions :is(.dialog-secondary-button, .dialog-danger-button),
.report-metadata-actions .dialog-secondary-button,
.admin-platform-actions .dialog-primary-button,
.admin-registration-form .dialog-primary-button {
  flex: 0 0 auto;
  height: 38px;
  min-height: 38px;
  white-space: nowrap;
}

.admin-branding-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 110px minmax(220px, 1.5fr) auto;
  gap: 10px;
  align-items: end;
}

.admin-provider-state {
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: var(--font-size-xs);
}

.admin-provider-state.enabled {
  border-color: rgba(24, 214, 163, 0.32);
  color: var(--green);
}

.admin-oidc-form {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(260px, 1.4fr);
  gap: 10px;
}

.admin-oidc-form > label {
  display: grid;
  gap: 5px;
  color: var(--form-label-color);
  font-size: var(--form-label-size);
  font-weight: var(--form-label-weight);
}

.admin-oidc-form input:not([type="checkbox"]),
.admin-oidc-form textarea {
  min-width: 0;
  height: var(--control-height-md);
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text);
}

.admin-oidc-form textarea {
  min-height: 118px;
  height: auto;
  padding: 9px;
  resize: vertical;
  font-family: var(--font-mono);
  line-height: 1.45;
}

.admin-oidc-form input[readonly] {
  color: #83a6b8;
}

.admin-oidc-callback,
.admin-oidc-toggles,
.admin-oidc-actions,
.admin-provider-guidance,
.admin-provider-test-fields {
  grid-column: 1 / -1;
}

.admin-provider-test-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 2px;
}

.admin-provider-test-fields label {
  display: grid;
  gap: 5px;
  color: var(--form-label-color);
  font-size: var(--form-label-size);
  font-weight: var(--form-label-weight);
}

.admin-oidc-callback small {
  color: var(--muted);
}

.admin-oidc-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
}

.admin-provider-guidance {
  margin: 0;
  color: var(--muted);
  font-size: var(--font-size-xs);
  line-height: 1.45;
}

.admin-oidc-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.admin-oidc-actions .dialog-primary-button,
.admin-oidc-actions .dialog-secondary-button {
  width: auto;
  min-width: 0;
}

.admin-branding-form label {
  display: grid;
  gap: 6px;
  color: var(--form-label-color);
  font-size: var(--form-label-size);
  font-weight: var(--form-label-weight);
}

.admin-branding-form input:not([type="color"]) {
  min-width: 0;
  height: var(--control-height-md);
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text);
}

.admin-branding-form input[type="color"] {
  width: 100%;
  min-height: 38px;
  padding: 3px;
}

@media (max-width: 900px) {
  .admin-branding-form {
    grid-template-columns: minmax(0, 1fr) 90px;
  }

  .admin-branding-footer,
  .admin-branding-form > .dialog-primary-button {
    grid-column: 1 / -1;
  }

  .admin-branding-form > .dialog-primary-button {
    width: auto;
    justify-self: end;
  }

  .admin-registration-section {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-registration-form {
    width: 100%;
    flex-wrap: wrap;
  }
}

.admin-overview-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.admin-overview-heading h3 {
  margin: 5px 0;
  font-size: 22px;
}

.admin-overview-heading p,
.admin-scope-note p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: var(--font-size-sm);
  line-height: 1.5;
}

.admin-plan-badge {
  padding: 5px 8px;
  border: 1px solid rgba(24, 214, 163, 0.3);
  border-radius: 999px;
  color: var(--green);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
}

.admin-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.admin-overview-grid article,
.admin-scope-note {
  padding: 15px;
  border: 1px solid #22323d;
  border-radius: var(--radius-lg);
  background: #09131a;
}

.admin-overview-grid span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: var(--font-size-xs);
}

.admin-overview-grid strong {
  font-size: 18px;
}

.admin-scope-note strong {
  display: block;
  margin-bottom: 5px;
}

.admin-project-access-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-project-access-footer small {
  color: var(--muted);
}

.admin-workspace-panel {
  align-content: start;
}

@media (max-width: 760px) {
  .account-security-body {
    grid-template-columns: 1fr;
  }

  .admin-dialog-body {
    grid-template-columns: 1fr;
  }

  .admin-navigation {
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid #1d2a34;
  }

  .admin-navigation-button {
    flex: 0 0 auto;
  }

  .admin-user-row {
    grid-template-columns: 1fr;
  }

  .admin-user-identity,
  .admin-user-actions {
    grid-template-columns: 1fr;
  }

  .admin-user-badges,
  .admin-user-management-actions {
    justify-content: flex-start;
  }

  .admin-user-form {
    grid-template-columns: 1fr;
  }

  .admin-membership-row {
    grid-template-columns: 1fr;
  }

  .admin-project-row,
  .admin-catalog-row,
  .admin-catalog-form,
  .admin-project-fields,
  .admin-catalog-toolbar {
    grid-template-columns: 1fr;
  }

  .admin-project-actions {
    flex-wrap: wrap;
  }

  .admin-overview-grid {
    grid-template-columns: 1fr;
  }

  .admin-registration-section,
  .admin-registration-form {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-oidc-form {
    grid-template-columns: 1fr;
  }

  .admin-provider-test-fields {
    grid-template-columns: 1fr;
  }
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-explanation {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.history-card {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--border, #263844);
  border-radius: 10px;
  background: rgba(10, 19, 25, 0.72);
}

.history-not-restorable {
  color: var(--muted);
  font-size: 12px;
}

.recently-deleted-panel {
  margin-top: 16px;
  padding: 12px 0 0;
  border-top: 1px solid var(--border);
}

.recently-deleted-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: var(--text);
  font-weight: 700;
}

.recently-deleted-panel > summary span {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  text-align: center;
}

.recently-deleted-panel > p,
.recently-deleted-state {
  color: var(--muted);
  font-size: var(--font-size-sm);
  line-height: 1.45;
}

.recently-deleted-panel .history-list {
  margin-top: 10px;
}

.deletion-undo-toast {
  position: fixed;
  z-index: 1500;
  right: 22px;
  bottom: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  width: min(520px, calc(100vw - 32px));
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(24, 214, 163, 0.5);
  border-radius: 10px;
  background: #0d1b22;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  color: var(--text);
  font-size: var(--font-size-md);
}

.deletion-undo-toast button {
  min-height: var(--control-height-md);
  padding: 5px 10px;
  border: 1px solid var(--green);
  border-radius: 7px;
  color: var(--green);
  background: transparent;
  font-weight: 700;
}

.deletion-undo-toast .deletion-undo-dismiss {
  min-width: 34px;
  padding: 4px;
  border-color: transparent;
  color: var(--muted);
  font-size: 20px;
}

.app-toast-region {
  position: fixed;
  z-index: 1490;
  right: 22px;
  bottom: 86px;
  display: grid;
  width: min(460px, calc(100vw - 32px));
  gap: 10px;
  pointer-events: none;
}

.app-toast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid rgba(114, 147, 166, 0.55);
  border-radius: 10px;
  background: #0d1b22;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  color: var(--text);
  font-size: var(--font-size-md);
  pointer-events: auto;
}

.app-toast[data-tone="success"] {
  border-color: rgba(24, 214, 163, 0.55);
}

.app-toast[data-tone="error"] {
  border-color: rgba(255, 99, 115, 0.72);
}

.app-toast button {
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--green);
  border-radius: 7px;
  color: var(--green);
  background: transparent;
  font-weight: 700;
}

.app-toast .app-toast-dismiss {
  min-width: 32px;
  padding: 3px;
  border-color: transparent;
  color: var(--muted);
  font-size: 20px;
}

@media (max-width: 600px) {
  .node-primary-actions,
  .relation-actions {
    grid-template-columns: 1fr;
  }

  .node-dialog,
  .app-dialog {
    width: calc(100vw - 20px);
  }

  .properties-table-header,
  .property-row {
    grid-template-columns:
      minmax(60px, 0.8fr)
      minmax(70px, 1.2fr)
      58px;
  }

  .node-dialog-footer,
  .app-dialog-footer {
    flex-direction: column-reverse;

    align-items: stretch;
  }

  .dialog-secondary-button,
  .dialog-primary-button,
  .dialog-warning-button,
  .dialog-danger-button {
    width: 100%;
  }
}

@media (max-width: 767px) {
  html,
  body {
    min-height: 100%;
  }

  .mobile-unsupported {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px;
    color: var(--text);
    text-align: center;
  }

  .mobile-unsupported strong {
    color: var(--green);
    font-size: 18px;
  }

  .mobile-unsupported span {
    max-width: 48ch;
    color: var(--muted);
    line-height: 1.5;
  }

  .app,
  .auth-startup-status,
  body > dialog {
    display: none !important;
  }
}
.admin-platform-form,
.admin-agent-list,
.admin-agent-form {
  display: grid;
  gap: 12px;
}

.admin-platform-preset {
  display: grid;
  gap: 4px;
  color: var(--form-label-color);
  font-size: var(--form-label-size);
  font-weight: var(--form-label-weight);
}

.admin-platform-preset select {
  min-width: 150px;
  height: var(--control-height-md);
}

.admin-platform-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}

.admin-platform-options > label,
.admin-agent-option-list > label {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  cursor: pointer;
}

.admin-platform-options > label:has(input:checked),
.admin-agent-option-list > label:has(input:checked) {
  border-color: rgba(24, 214, 163, 0.52);
  background: rgba(24, 214, 163, 0.07);
}

.admin-platform-options > label:has(input:focus-visible),
.admin-agent-option-list > label:has(input:focus-visible) {
  outline: 2px solid var(--color-focus);
  outline-offset: 1px;
}

.admin-platform-options > label:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.55;
}

.admin-platform-options input,
.admin-agent-option-list input {
  flex: 0 0 auto;
  margin-top: 2px;
  accent-color: var(--green);
}

.admin-platform-options span,
.admin-platform-options strong,
.admin-platform-options small {
  min-width: 0;
  display: block;
}

.admin-platform-options strong {
  color: var(--text);
  font-size: var(--font-size-sm);
}

.admin-platform-options small {
  margin-top: 3px;
  color: var(--muted);
  font-size: var(--font-size-xs);
}

.admin-auth-options small.configured {
  color: var(--green);
}

.admin-platform-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-platform-actions p {
  margin: 0;
  color: var(--muted);
  font-size: var(--font-size-xs);
}

.admin-platform-actions .dialog-primary-button {
  width: auto;
}

.admin-agent-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-agent-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
}

.admin-agent-identity {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.admin-agent-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.admin-agent-identity > span,
.admin-agent-identity > small {
  overflow: hidden;
  color: var(--muted);
  font-size: var(--font-size-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-agent-form {
  grid-template-columns: minmax(180px, 0.75fr) minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}

.admin-agent-form .admin-form-heading,
.admin-agent-form > button {
  grid-column: 1 / -1;
}

.admin-agent-form > button {
  width: auto;
  justify-self: end;
}

.admin-agent-name {
  display: grid;
  gap: 5px;
  color: var(--form-label-color);
  font-size: var(--form-label-size);
  font-weight: var(--form-label-weight);
}

.admin-agent-name input {
  height: var(--control-height-md);
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text);
}

.admin-agent-scope {
  min-width: 0;
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.admin-agent-scope legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: var(--font-size-xs);
}

.admin-agent-option-list {
  display: grid;
  gap: 5px;
  max-height: 155px;
  overflow-y: auto;
}

.admin-agent-option-list > label {
  padding: 6px 7px;
  color: var(--text);
  font-size: var(--font-size-xs);
}

#admin-agent-token {
  width: 100%;
  resize: vertical;
  font-family: monospace;
}

@media (max-width: 1050px) {
  .admin-agent-form,
  .admin-agent-list {
    grid-template-columns: 1fr;
  }
}

.graph-accessible-list {
  --graph-list-data-columns: minmax(180px, 2fr) minmax(86px, 0.7fr)
    minmax(124px, 1fr) minmax(82px, 0.7fr) 64px 52px 108px;
  position: absolute;
  inset: 0;
  z-index: 14;
  display: flex;
  overflow: hidden;
  flex-direction: column;
  padding: 58px var(--space-4) var(--space-4);
  background: var(--panel);
  container-name: graph-list;
  container-type: inline-size;
}

.graph-list-heading {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 0 0 var(--space-3);
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.graph-list-summary {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.graph-list-summary > span {
  color: var(--muted);
  font-size: var(--font-size-xs);
}

.graph-list-tools {
  display: flex;
  align-items: end;
  gap: var(--space-2);
}

.graph-list-search input {
  width: min(240px, 26vw);
  height: var(--control-height-md);
  padding: 0 9px;
}

.graph-list-sort-field {
  display: grid;
  grid-template-columns: auto minmax(130px, 1fr);
  align-items: center;
  gap: 6px;
  color: var(--form-label-color);
  font-size: var(--form-label-size);
  font-weight: var(--form-label-weight);
}

.graph-list-sort-field select {
  height: var(--control-height-md);
  padding: 0 24px 0 8px;
}

.graph-list-columns {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: var(--graph-list-data-columns) 56px;
  gap: var(--space-2);
  padding: 10px 9px 7px;
  color: var(--muted);
  font-size: var(--font-size-xs);
  font-weight: 700;
}

.graph-list-items {
  display: grid;
  min-height: 0;
  overflow: auto;
  align-content: start;
  border-top: 1px solid var(--border);
}

.graph-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px;
  align-items: stretch;
  gap: var(--space-2);
  width: 100%;
  min-height: 43px;
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
  border-left: 2px solid transparent;
  background: transparent;
  color: inherit;
}

.graph-list-item:hover {
  background: rgba(39, 140, 255, 0.05);
}

.graph-list-item.selected {
  border-left-color: var(--green);
  background: rgba(24, 214, 163, 0.08);
}

.graph-list-select {
  display: grid;
  grid-template-columns: var(--graph-list-data-columns);
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.graph-list-select:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.graph-list-select > * {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.graph-list-title {
  font-size: var(--font-size-md);
}

.graph-list-type {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #b9c6ce;
}

.graph-list-type::before {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}

.graph-list-type[data-node-type="target"]::before {
  background: var(--node-target);
}

.graph-list-type[data-node-type="action"]::before {
  background: var(--node-action);
}

.graph-list-type[data-node-type="service"]::before {
  background: var(--node-service);
}

.graph-list-type[data-node-type="application"]::before {
  background: var(--node-application);
}

.graph-list-type[data-node-type="finding"]::before {
  background: var(--node-finding);
}

.graph-list-type[data-node-type="vulnerability"]::before {
  background: var(--node-vulnerability);
}

.graph-list-type[data-node-type="info"]::before {
  background: var(--node-info);
}

.graph-list-phase,
.graph-list-relations,
.graph-list-notes,
.graph-list-updated {
  color: var(--muted);
  font-size: var(--font-size-xs);
}

.graph-list-status {
  color: #aebbc4;
  font-size: var(--font-size-xs);
  font-weight: 700;
}

.graph-list-status.status-active,
.graph-list-status.status-done {
  color: var(--green);
}

.graph-list-status.status-blocked {
  color: var(--yellow);
}

.graph-list-status.status-failed {
  color: var(--red);
}

.graph-list-notes.has-notes {
  color: var(--color-info);
}

.graph-list-edit {
  align-self: center;
  min-height: var(--control-height-sm);
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: var(--font-size-xs);
  font-weight: 700;
}

.graph-list-item:hover .graph-list-edit,
.graph-list-edit:focus-visible {
  border-color: var(--border);
  background: var(--panel2);
  color: var(--text);
}

.graph-list-empty {
  padding: 32px 16px;
  color: var(--muted);
  text-align: center;
}

@container graph-list (max-width: 940px) {
  .graph-list-columns,
  .graph-list-select {
    --graph-list-data-columns: minmax(170px, 2fr) minmax(82px, 0.7fr)
      minmax(112px, 1fr) minmax(78px, 0.7fr) 56px 48px;
  }

  .graph-list-columns > :nth-child(7),
  .graph-list-updated {
    display: none;
  }
}

@container graph-list (max-width: 760px) {
  .graph-list-columns,
  .graph-list-select {
    --graph-list-data-columns: minmax(160px, 2fr) minmax(82px, 0.7fr)
      minmax(108px, 1fr) minmax(74px, 0.7fr) 56px;
  }

  .graph-list-columns > :nth-child(6),
  .graph-list-notes {
    display: none;
  }

  .graph-list-sort-field > span {
    display: none;
  }

  .graph-list-sort-field select {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@container graph-list (max-width: 620px) {
  .graph-accessible-list {
    padding-inline: var(--space-3);
  }

  .graph-list-heading {
    align-items: stretch;
    flex-direction: column;
    gap: var(--space-2);
  }

  .graph-list-tools,
  .graph-list-search,
  .graph-list-search input,
  .graph-list-sort-field {
    width: 100%;
  }

  .graph-list-tools {
    align-items: center;
  }

  .graph-list-columns {
    display: none;
  }

  .graph-list-items {
    margin-top: var(--space-3);
  }

  .graph-list-item {
    grid-template-columns: minmax(0, 1fr) 48px;
    min-height: 62px;
  }

  .graph-list-select {
    grid-template-columns: minmax(76px, 0.8fr) minmax(110px, 1.2fr) 72px 40px;
    align-content: center;
    row-gap: 5px;
  }

  .graph-list-title {
    grid-column: 1 / -1;
  }

  .graph-list-relations::after {
    content: " rel.";
  }
}

.command-palette-dialog {
  width: min(42rem, calc(100vw - 2rem));
}

#command-palette-input {
  width: 100%;
  font-size: 1rem;
}

.command-palette-results {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.command-palette-empty,
.finding-list-group {
  margin: 0;
  padding: 0.6rem 0.25rem 0.25rem;
  color: var(--muted);
  font-size: var(--font-size-sm);
}

.command-palette-result {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 0.75rem;
  text-align: left;
}

/* Dialog geometry: headers and actions remain visible while only the content
   pane scrolls. This also prevents tall forms from being clipped by the
   dialog's outer overflow boundary. */
dialog.node-dialog:not(.login-dialog) > form,
dialog.app-dialog > form {
  display: flex;
  min-height: 0;
  max-height: calc(100dvh - 60px);
  flex-direction: column;
}

#tool-editor-form,
#tool-import-form,
#knowledge-entry-editor-form,
#tool-action-form {
  min-height: 0;
  max-height: calc(100dvh - 60px);
}

dialog.node-dialog:not(.login-dialog) > form > .node-dialog-header,
dialog.node-dialog:not(.login-dialog) > form > .node-dialog-footer,
dialog.app-dialog > form > .app-dialog-header,
dialog.app-dialog > form > .app-dialog-footer {
  flex: 0 0 auto;
}

dialog.node-dialog:not(.login-dialog) > form > .node-dialog-body,
dialog.app-dialog > form > .app-dialog-body {
  min-height: 0;
  flex: 1 1 auto;
}

dialog.node-dialog.report-dialog {
  width: min(1100px, calc(100vw - 32px));
}

dialog.node-dialog.report-dialog > form {
  display: grid;
  height: 100%;
  max-height: none;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

dialog.node-dialog.report-dialog .report-dialog-body {
  overflow: hidden;
}

dialog.node-dialog.pentest-manager-dialog {
  width: min(680px, calc(100vw - 32px));
}

dialog.node-dialog.graph-search-dialog {
  width: min(680px, calc(100vw - 32px));
}

dialog.node-dialog.property-editor-dialog {
  width: min(860px, calc(100vw - 32px));
}

dialog.node-dialog.pentest-import-dialog {
  width: min(540px, calc(100vw - 32px));
}

.graph-search-dialog[open],
.shortcut-dialog[open],
.account-security-dialog[open],
.command-palette-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.account-security-dialog[open] {
  height: min(780px, calc(100dvh - 32px));
}
