:root{
  --bg:#0b0f16;
  --panel:#0f1723;
  --card:#121a26;
  --graph-bg:#08101c;
  --surface-soft:#08101c;
  --surface-strong:#0b1726;
  --surface-elevated:#0d1420;
  --muted:#9fb0c3;
  --text:#e7eef7;
  --line:#223044;
  --accent:#6ee7ff;
  --accent2:#9b7bff;
  --focus-ring:rgba(110,231,255,.18);
  --stack-gap:20px;
  --danger:#ff8f8f;
}

*{ box-sizing:border-box; font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial; }

body,
#sidebar,
#view,
.list,
.out,
#debug-drawer,
.eventList,
.edgeInspector,
textarea{
  scrollbar-width:thin;
  scrollbar-color:rgba(159,176,195,.22) transparent;
}

body::-webkit-scrollbar,
#sidebar::-webkit-scrollbar,
#view::-webkit-scrollbar,
.list::-webkit-scrollbar,
.out::-webkit-scrollbar,
#debug-drawer::-webkit-scrollbar,
.eventList::-webkit-scrollbar,
.edgeInspector::-webkit-scrollbar,
textarea::-webkit-scrollbar{
  width:8px;
  height:8px;
}

body::-webkit-scrollbar-track,
#sidebar::-webkit-scrollbar-track,
#view::-webkit-scrollbar-track,
.list::-webkit-scrollbar-track,
.out::-webkit-scrollbar-track,
#debug-drawer::-webkit-scrollbar-track,
.eventList::-webkit-scrollbar-track,
.edgeInspector::-webkit-scrollbar-track,
textarea::-webkit-scrollbar-track{
  background:transparent;
}

body::-webkit-scrollbar-thumb,
#sidebar::-webkit-scrollbar-thumb,
#view::-webkit-scrollbar-thumb,
.list::-webkit-scrollbar-thumb,
.out::-webkit-scrollbar-thumb,
#debug-drawer::-webkit-scrollbar-thumb,
.eventList::-webkit-scrollbar-thumb,
.edgeInspector::-webkit-scrollbar-thumb,
textarea::-webkit-scrollbar-thumb{
  background:rgba(159,176,195,.18);
  border:2px solid transparent;
  border-radius:999px;
  background-clip:padding-box;
}

body::-webkit-scrollbar-thumb:hover,
#sidebar::-webkit-scrollbar-thumb:hover,
#view::-webkit-scrollbar-thumb:hover,
.list::-webkit-scrollbar-thumb:hover,
.out::-webkit-scrollbar-thumb:hover,
#debug-drawer::-webkit-scrollbar-thumb:hover,
.eventList::-webkit-scrollbar-thumb:hover,
.edgeInspector::-webkit-scrollbar-thumb:hover,
textarea::-webkit-scrollbar-thumb:hover{
  background:rgba(159,176,195,.28);
  background-clip:padding-box;
}

body{ margin:0;
      background: radial-gradient(1200px 600px at 80% 100%, rgba(120,160,255,0.16), transparent 60%),
                  radial-gradient(900px 500px at 20% 50%, rgba(120,255,190,0.10), transparent 60%),
                  var(--bg);
      color:var(--text); }

.nx-modal-backdrop{
  position:fixed;
  inset:0;
  z-index:1200;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:rgba(7, 11, 18, .68);
  backdrop-filter:blur(8px);
}

.nx-modal{
  width:min(100%, 460px);
  max-height:calc(100vh - 48px);
  overflow:auto;
  padding:18px;
  border-radius:20px;
  border:1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(18,26,38,.98), rgba(12,18,28,.98)),
    linear-gradient(135deg, rgba(110,231,255,.05), rgba(155,123,255,.04));
  box-shadow:0 26px 80px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.03);
}

.nx-modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:8px;
}

.nx-modal-head h3{
  margin:0;
}

.nx-modal-close{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:38px;
  height:38px;
  border-radius:12px;
  padding:0;
  font-size:22px;
  line-height:0;
}

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

.nx-modal-error{
  color:var(--danger);
  min-height:18px;
  margin-top:10px;
}

.brand{
  display:grid;
  grid-template-columns:44px minmax(0,1fr);
  gap:12px;
  align-items:center;
  min-height:44px;
}

.brand-copy{
  min-width:0;
  overflow:hidden;
  max-width:220px;
  opacity:1;
  transform:translateX(0);
  transition:opacity .5s ease, transform .5s ease, max-width .5s ease;
}

#app-shell[data-sidebar-collapsed="true"] .brand{
  grid-template-columns:44px 0fr;
  gap:0;
}

#app-shell[data-sidebar-collapsed="true"] .brand-copy{
  opacity:0;
  transform:translateX(-6px);
  max-width:0;
  pointer-events:none;
}

.logo{
  width:44px;
  height:44px;
  border-radius:12px;
  flex:0 0 44px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:radial-gradient(circle at 30% 30%, var(--accent), transparent 55%),
             radial-gradient(circle at 70% 70%, var(--accent2), transparent 55%),
             #182235;
  border:1px solid #2b3a56;
  font-weight:800;
}

.title{ font-size:16px; font-weight:800; letter-spacing:.06em; }
.subtitle{ font-size:11px; line-height:1.2; color:var(--muted); white-space:nowrap; }

#app-shell{ display:flex; height:100vh; min-width:0; }

#sidebar{
  width:260px;
  min-width:0;
  flex:0 0 260px;
  padding:14px;
  background:var(--panel);
  border-right:1px solid var(--line);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  gap:14px;
  transition:width .58s cubic-bezier(.22,.8,.2,1), flex-basis .58s cubic-bezier(.22,.8,.2,1), padding .58s cubic-bezier(.22,.8,.2,1), border-color .58s ease, transform .58s ease, opacity .58s ease;
}

#app-shell[data-sidebar-collapsed="true"] #sidebar{
  width:72px;
  flex-basis:72px;
  padding:14px;
}

.sidebar-nav-shell{
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  min-height:0;
  flex:1;
}

.sidebar-nav{
  min-height:0;
  overflow:auto;
  padding-bottom:6px;
  scrollbar-width:none;
  -ms-overflow-style:none;
}

.sidebar-nav::-webkit-scrollbar{ display:none; }

.sidebar-scroll-indicator{
  display:flex;
  align-items:center;
  justify-content:center;
  height:28px;
  width:100%;
  padding:0;
  border:none;
  border-radius:12px;
  background:linear-gradient(180deg, rgba(15,23,35,.92), rgba(15,23,35,.15));
  color:var(--muted);
  cursor:pointer;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:opacity .2s ease, color .2s ease;
}

.sidebar-scroll-indicator[data-visible="true"]{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
}

.sidebar-scroll-indicator svg{
  width:16px;
  height:16px;
}

.sidebar-scroll-up{ margin-bottom:6px; }

.sidebar-scroll-down{
  margin-top:6px;
  background:linear-gradient(0deg, rgba(15,23,35,.92), rgba(15,23,35,.15));
}

.sidebar-scroll-indicator:hover{ color:var(--text); }

#sidebar h4{ margin:14px 0 8px; font-size:12px; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); }
#app-shell[data-sidebar-collapsed="true"] #sidebar h4{
  opacity:0;
  visibility:hidden;
}

#sidebar a{ display:flex; align-items:center; gap:12px; padding:10px 10px; border-radius:10px; border:1px solid transparent; color:var(--text); text-decoration:none; white-space:nowrap; overflow:hidden;}
#sidebar a:hover{ background:#132033; }
#sidebar a.is-active{
  background:linear-gradient(90deg, rgba(110,231,255,.14), rgba(155,123,255,.10));
  border-color:rgba(110,231,255,.18);
  font-weight:700;
}

.sidebar-link-icon{
  width:20px;
  height:20px;
  flex:0 0 20px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:var(--muted);
}

.sidebar-link-icon svg{
  width:20px;
  height:20px;
  display:block;
}

.sidebar-link-label{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  transition:opacity .22s ease, transform .22s ease, max-width .22s ease;
}

#sidebar a.is-active .sidebar-link-icon,
#sidebar a:hover .sidebar-link-icon{
  color:var(--text);
}

#app-shell[data-sidebar-collapsed="true"] #sidebar a{
  justify-content:flex-start;
  padding:10px 8px;
  gap:0;
}

#app-shell[data-sidebar-collapsed="true"] .sidebar-link-label{
  opacity:0;
  max-width:0;
  transform:translateX(-6px);
  pointer-events:none;
}

#main{ flex:1; min-width:0; display:flex; flex-direction:column; }

#topbar{
  height:56px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:16px 18px;
  border-bottom:1px solid var(--line);
  background:rgba(10,14,22,.65);
  backdrop-filter:blur(10px);
  position:sticky;
  top:0;
  z-index:10;
}

.topbar-left,
.topbar-right{
  display:flex;
  gap:12px;
  align-items:center;
}

.icon-button{
  width:38px;
  height:38px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0;
  border-radius:12px;
}

.icon-button svg{
  width:20px;
  height:20px;
  display:block;
}

.topbar-icon-button{
  background:linear-gradient(180deg,#162235,#0e1726);
  border:1px solid #2a3a55;
  color:var(--text);
  text-decoration:none;
}

.sidebar-toggle-button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:20px;
  height:20px;
  padding:0;
  border:none;
  background:transparent;
  color:var(--text);
  cursor:pointer;
}

.sidebar-toggle-button svg{
  width:20px;
  height:20px;
  display:block;
}

#view{ padding:18px; overflow:auto; min-width:0; }
#view > *{ max-width:100%; }
#graphPageBlocks{ margin-top:var(--stack-gap); display:grid; }
.small{ color:var(--muted); font-size:12px; }

.card{
  background:linear-gradient(180deg, rgba(18,26,38,.9), rgba(12,18,28,.9));
  border:1px solid var(--line);
  border-radius:16px;
  padding:14px;
  min-width:0;
  box-shadow:0 8px 30px rgba(0,0,0,.25);
}

.card + .card{ margin-top:var(--stack-gap); }
.card h2{ margin:0 0 10px; font-size:14px; letter-spacing:.03em; }
.card h3{ margin:10px 0 8px; font-size:13px; color:var(--muted); font-weight:700; }

.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:14px;
  background:linear-gradient(180deg, rgba(8,16,28,.9), rgba(10,16,24,.95));
}

.table th,
.table td{
  padding:12px 14px;
  text-align:left;
  vertical-align:top;
  border-bottom:1px solid rgba(34,48,68,.8);
  font-size:12px;
  color:var(--text);
}

.table thead th{
  color:var(--muted);
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.06em;
  background:rgba(255,255,255,.02);
}

.table tbody tr:hover{
  background:rgba(110,231,255,.04);
}

.table tbody tr:last-child td{
  border-bottom:none;
}

.mm-bundle-report{
  max-height:220px;
}

.mm-kind-filters{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.mm-kind-filter-btn{
  display:inline-flex;
  gap:8px;
  align-items:center;
  justify-content:center;
  min-height:36px;
  padding:8px 12px;
  border-radius:999px;
  font-size:12px;
}

.mm-kind-count{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:22px;
  height:22px;
  padding:0 6px;
  border-radius:999px;
  background:rgba(255,255,255,.12);
  font-size:11px;
  font-weight:700;
}

.mm-kind-filter-btn.is-active{
  box-shadow:0 0 0 3px rgba(255,255,255,.06);
}

.mm-kind-all{
  border-color:#36506c;
  background:linear-gradient(180deg,#162235,#0e1726);
}

.out.mm-def-card{
  border:2px solid #39506f;
  background:linear-gradient(180deg, rgba(12,18,28,.92), rgba(12,18,28,.92));
  max-height:none;
  overflow:visible;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.02);
  transition:border-color .18s ease, transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.out.mm-def-card:hover{
  transform:translateY(-1px);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.05), 0 10px 24px rgba(0,0,0,.18), 0 0 0 1px rgba(255,255,255,.04);
}

.out.mm-def-card.is-selected{
  background:linear-gradient(180deg, rgba(17,24,36,.98), rgba(14,20,31,.98));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04);
}

.out.mm-def-card.is-active{
  background:linear-gradient(180deg, rgba(20,29,42,.98), rgba(15,22,34,.98));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05);
}

.out.mm-def-card.mm-kind-entity_def{
  border-color:rgba(78,205,196,.92);
}

.mm-kind-filter-btn.mm-kind-entity_def{
  border-color:rgba(78,205,196,.45);
  background:linear-gradient(180deg, rgba(16,66,68,.92), rgba(10,30,36,.98));
}

.out.mm-def-card.mm-kind-relation_def{
  border-color:rgba(246,189,96,.92);
}

.mm-kind-filter-btn.mm-kind-relation_def{
  border-color:rgba(246,189,96,.45);
  background:linear-gradient(180deg, rgba(88,63,16,.92), rgba(39,28,10,.98));
}

.out.mm-def-card.mm-kind-process_def{
  border-color:rgba(124,181,255,.94);
}

.mm-kind-filter-btn.mm-kind-process_def{
  border-color:rgba(124,181,255,.45);
  background:linear-gradient(180deg, rgba(24,58,104,.92), rgba(12,28,51,.98));
}

.out.mm-def-card.mm-kind-action_def{
  border-color:rgba(255,123,172,.96);
}

.mm-kind-filter-btn.mm-kind-action_def{
  border-color:rgba(255,123,172,.45);
  background:linear-gradient(180deg, rgba(98,26,64,.92), rgba(40,14,29,.98));
}

.out.mm-def-card.mm-kind-gui_template{
  border-color:rgba(170,139,255,.94);
}

.mm-kind-filter-btn.mm-kind-gui_template{
  border-color:rgba(170,139,255,.45);
  background:linear-gradient(180deg, rgba(63,40,110,.92), rgba(28,17,50,.98));
}

.out.mm-def-card.mm-kind-presentation_def{
  border-color:rgba(170,139,255,.94);
}

.mm-kind-filter-btn.mm-kind-presentation_def{
  border-color:rgba(170,139,255,.45);
  background:linear-gradient(180deg, rgba(63,40,110,.92), rgba(28,17,50,.98));
}

.out.mm-def-card.mm-kind-capability_def{
  border-color:rgba(194,165,114,.94);
}

.mm-kind-filter-btn.mm-kind-capability_def{
  border-color:rgba(194,165,114,.45);
  background:linear-gradient(180deg, rgba(90,70,35,.92), rgba(43,33,18,.98));
}

.mm-editor-modal{
  width:min(100%, 1100px);
  max-height:calc(100vh - 40px);
}

.mm-instance-modal{
  width:min(100%, 760px);
  max-height:calc(100vh - 40px);
}

.mm-edit-def-btn{
  min-width:38px;
  width:38px;
  height:38px;
  padding:0;
  border-radius:12px;
  font-size:16px;
  line-height:1;
}

.mm-instance-def-btn{
  min-width:38px;
  width:38px;
  height:38px;
  padding:0;
  border-radius:12px;
  font-size:18px;
  line-height:1;
}

.mm-clone-def-btn{
  min-width:38px;
  width:38px;
  height:38px;
  padding:0;
  border-radius:12px;
  font-size:15px;
  line-height:1;
}

.mm-delete-def-btn{
  min-width:38px;
  width:38px;
  height:38px;
  padding:0;
  border-radius:12px;
  font-size:15px;
  line-height:1;
}

.mm-toolbar-icon-btn{
  min-width:38px;
  width:38px;
  height:38px;
  padding:0;
  border-radius:12px;
  font-size:18px;
  line-height:1;
  margin-left:auto;
}

.mm-list-actions{
  min-width:0;
}

.mm-graph-stage{
  position:relative;
}

.mm-graph-panel{
  position:absolute;
  top:12px;
  right:12px;
  width:min(340px, calc(100% - 24px));
  max-height:calc(100% - 24px);
  overflow:auto;
  padding:12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:rgba(8,16,28,.96);
  box-shadow:0 18px 40px rgba(0,0,0,.35);
  z-index:3;
}

.mm-graph-panel.is-hidden{
  display:none;
}

.mm-graph-panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}

.mm-rel-graph-wrap,
.mm-selected-graph-wrap{
  min-height:360px;
}

.row{ display:grid; grid-template-columns:110px 1fr; gap:10px; align-items:center; margin:8px 0; }
.row label{ color:var(--muted); font-size:12px; }

input, textarea, select{
  width:100%;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid var(--line);
  background:var(--surface-elevated);
  color:var(--text);
}

input::placeholder,
textarea::placeholder{
  color:color-mix(in srgb, var(--muted) 88%, transparent);
}

input:focus,
textarea:focus,
select:focus{
  outline:none;
  border-color:var(--accent);
  box-shadow:0 0 0 3px var(--focus-ring);
}

textarea{ resize:vertical; }

select{
  -webkit-appearance:none;
  -moz-appearance:none;
  appearance:none;
  padding-right:40px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 7.5 10 12.5 15 7.5' fill='none' stroke='%239fb0c3' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position:calc(100% - 14px) 50%;
  background-size:18px 18px;
  background-repeat:no-repeat;
  cursor:pointer;
}

select::-ms-expand{ display:none; }
select::-webkit-list-button{ display:none; }
select option{ background:#0d1420; color:var(--text); }

.gui-multi-select{
  position:relative;
  width:100%;
  overflow:visible;
  font-size:13.3333px;
}

.gui-multi-select > summary::-webkit-details-marker{
  display:none;
}

.gui-multi-select-summary{
  list-style:none;
  cursor:pointer;
  width:100%;
  max-width:100%;
  padding:8px 40px 8px 10px;
  text-align:left;
  user-select:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  position:relative;
  min-height:35.2px;
  border-radius:10px;
  border:1px solid var(--line);
  background:var(--surface-elevated);
  color:var(--text);
  overflow:hidden;
}

.gui-multi-select[open] > .gui-multi-select-summary{
  border-color:var(--accent);
  box-shadow:0 0 0 3px var(--focus-ring);
}

.gui-multi-select-summary-text{
  min-width:0;
  flex:1 1 auto;
  display:block;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  text-align:left;
}

.gui-multi-select-caret{
  position:absolute;
  top:50%;
  right:14px;
  width:18px;
  height:18px;
  transform:translateY(-50%);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 7.5 10 12.5 15 7.5' fill='none' stroke='%239fb0c3' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position:center;
  background-size:18px 18px;
  background-repeat:no-repeat;
  pointer-events:none;
}

.gui-multi-select[open] .gui-multi-select-caret{
  transform:translateY(-50%) rotate(180deg);
}

.gui-multi-select-options{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:6px;
  position:absolute;
  top:calc(100% + 6px);
  left:0;
  right:0;
  z-index:30;
  padding:10px;
  text-align:left;
  max-height:220px;
  overflow:auto;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--surface-elevated);
  box-shadow:0 12px 28px rgba(0,0,0,.14);
}

.gui-multi-select-option{
  display:grid;
  grid-template-columns:16px minmax(0, 1fr);
  width:100%;
  align-items:center;
  justify-items:start;
  column-gap:8px;
  text-align:left;
}

.gui-multi-select-option span{
  text-align:left;
  justify-self:start;
}

input[type="file"]{ padding:6px; }

input[type="file"]::file-selector-button,
input[type="file"]::-webkit-file-upload-button{
  margin-right:12px;
  padding:9px 12px;
  border-radius:10px;
  border:1px solid #2a3a55;
  background:linear-gradient(180deg,#162235,#0e1726);
  color:var(--text);
  cursor:pointer;
}

input[type="file"]::file-selector-button:hover,
input[type="file"]::-webkit-file-upload-button:hover{
  border-color:#3a557a;
}

button{
  padding:9px 12px;
  border-radius:12px;
  border:1px solid #2a3a55;
  background:linear-gradient(180deg,#162235,#0e1726);
  color:var(--text);
  cursor:pointer;
}

button:hover{ border-color:#3a557a; }

button.secondary{
  background:transparent;
  color:var(--muted);
}

button:focus-visible,
.user-menu-link:focus-visible,
.debugLink:focus-visible,
#sidebar a:focus-visible{
  outline:none;
  box-shadow:0 0 0 3px var(--focus-ring);
}

.out{
  margin:10px 0 0;
  padding:10px;
  border-radius:12px;
  border:1px solid var(--line);
  background:var(--surface-soft);
  color:#cfe3ff;
  overflow:auto;
  max-height:260px;
  font-size:12px;
  line-height:1.35;
}

.out.big{ max-height:520px; }

.toolbar{ display:flex; gap:8px; margin:8px 0; }
.split{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }

.list{
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--surface-soft);
  padding:8px;
  max-height:420px;
  overflow:auto;
}

.item{
  padding:8px;
  border-radius:10px;
  border:1px solid color-mix(in srgb, var(--line) 78%, transparent);
  margin:6px 0;
  cursor:pointer;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  background:linear-gradient(180deg, color-mix(in srgb, var(--surface-elevated) 94%, white 6%), color-mix(in srgb, var(--surface-strong) 92%, white 8%));
  box-shadow:0 1px 0 rgba(255,255,255,.04) inset;
}

.item:hover{ border-color:color-mix(in srgb, var(--accent) 28%, var(--line) 72%); background:linear-gradient(180deg, color-mix(in srgb, var(--surface-elevated) 86%, var(--accent) 14%), color-mix(in srgb, var(--surface-strong) 90%, var(--accent) 10%)); }
.item .id{ font-size:12px; font-weight:700; }
.item .meta{ font-size:11px; color:var(--muted); margin-top:2px; }

.node-appearance-row-main{
  min-width:0;
  flex:1;
}

.node-appearance-active{
  box-shadow:inset 3px 0 0 var(--node-appearance-color), 0 1px 0 rgba(255,255,255,.04) inset;
}

.node-appearance-trigger{
  min-width:34px;
  width:34px;
  height:34px;
  padding:0;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 34px;
}

.node-appearance-trigger svg{
  width:16px;
  height:16px;
}

.node-appearance-modal{
  width:min(100%, 520px);
}

.node-appearance-picker-row{
  align-items:start;
}

.node-appearance-picker-group{
  display:flex;
  gap:10px;
  align-items:center;
}

.node-appearance-picker-group input[type="color"]{
  width:56px;
  min-width:56px;
  height:42px;
  padding:4px;
}

.node-appearance-check{
  display:flex;
  gap:10px;
  align-items:flex-start;
  margin-top:12px;
  color:var(--text);
  font-size:13px;
}

.node-appearance-check input{
  width:auto;
  margin-top:2px;
}

#debug-drawer{
  position:fixed;
  top:0;
  right:0;
  width:420px;
  height:100vh;
  padding:14px;
  background:#0e1522;
  border-left:1px solid var(--line);
  overflow:auto;
  z-index:50;
}

.debugDrawerHead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}

.debugDrawerHead h3{ margin:0; }
.debugDrawerClose{ min-width:72px; }

.eventsToolbar{
  position:sticky;
  top:54px;
  z-index:6;
  background:rgba(10,14,22,.65);
  backdrop-filter:blur(10px);
}

.spacer{ flex:1; }

.debugQuick{
  display:flex;
  gap:8px;
  align-items:center;
  margin-bottom:8px;
}

.debugQuick input{ width:100%; }

.debugActions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.debugLink{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:38px;
  padding:9px 12px;
  border-radius:12px;
  border:1px solid #2a3a55;
  background:linear-gradient(180deg,#162235,#0e1726);
  color:var(--text);
  text-decoration:none;
}

.debugLink:hover{ border-color:#3a557a; }

.debugCheck{
  display:flex;
  gap:8px;
  align-items:center;
  margin-bottom:10px;
  font-size:12px;
}

.debugCheck input{ width:auto; }

.kv{
  display:grid;
  grid-template-columns:88px 1fr;
  gap:8px;
  margin:6px 0;
  font-size:12px;
}

.kv span:first-child{ color:var(--muted); }

.user-menu-wrap{ position:relative; }

.user-menu-trigger{
  width:38px;
  height:38px;
  padding:0;
  border-radius:999px;
  font-weight:700;
}

.user-menu{
  position:absolute;
  top:46px;
  right:0;
  min-width:220px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:16px;
  background:linear-gradient(180deg, rgba(18,26,38,.98), rgba(12,18,28,.98));
  box-shadow:0 8px 30px rgba(0,0,0,.35);
}

.user-menu-info{
  padding:6px 4px;
  border-bottom:1px solid rgba(255,255,255,0.06);
  margin-bottom:4px;
}

.user-menu-link{
  display:block;
  width:100%;
  margin-top:8px;
  padding:9px 12px;
  border-radius:12px;
  border:1px solid #2a3a55;
  background:linear-gradient(180deg,#162235,#0e1726);
  color:var(--text);
  text-decoration:none;
  text-align:left;
}

.user-menu-action{ cursor:pointer; }

.nx-nav-link,
.nx-nav-link:visited {
  color:inherit;
  text-decoration:none;
}

.nx-nav-link:hover {
  text-decoration:underline;
  cursor:pointer;
}

.badge {
  display:inline-block;
  padding:2px 10px;
  border-radius:999px;
  font-size:12px;
  line-height:18px;
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(255,255,255,0.06);
  color:inherit;
  white-space:nowrap;
}

.badge-online {
  background:rgba(0, 200, 120, 0.14);
  border-color:rgba(0, 200, 120, 0.25);
}

.badge-degraded {
  background:rgba(255, 165, 0, 0.14);
  border-color:rgba(255, 165, 0, 0.25);
}

.badge-offline {
  background:rgba(255, 80, 80, 0.14);
  border-color:rgba(255, 80, 80, 0.25);
}

.badge-unknown { opacity:0.85; }
