* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Roboto", Arial, sans-serif;
  color: #111827;
  background: #f8fafc;
  overflow-x: hidden;
}

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

a {
  color: #1d4ed8;
}

.app-navbar {
  min-height: 72px;
  padding: 0;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
}

.top-panel {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: none;
  min-height: 72px;
  margin: 0;
  padding: .75rem 1.5rem;
  background: #0f172a;
  border: 0;
  border-radius: 0;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .18);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: #f8fafc;
  white-space: nowrap;
}

.brand-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff;
  font-size: 1.12rem;
  background: #2563eb;
  border: 1px solid rgba(191, 219, 254, .35);
  border-radius: 10px;
  box-shadow: inset 0 -8px 18px rgba(15, 23, 42, .24);
}

.brand-icon i {
  line-height: 1;
}

.btn-nav {
  color: #e2e8f0;
  border-color: #334155;
  background: #1e293b;
}

.btn-nav:hover {
  color: #fff;
  border-color: #60a5fa;
  background: #1d4ed8;
}

.nav-actions {
  margin-left: auto;
  justify-content: flex-end;
}

.home-screen {
  min-height: calc(100vh - 64px);
  background:
    radial-gradient(circle at 15% 20%, rgba(37, 99, 235, .12), transparent 28%),
    linear-gradient(135deg, #eef2ff, #ecfeff 58%, #f8fafc);
}

.home-hero {
  padding-top: clamp(3rem, 8vh, 5.5rem);
  padding-bottom: clamp(2rem, 6vh, 4rem);
}

.hero-kicker {
  width: fit-content;
  margin-bottom: 1rem;
  padding: .35rem .65rem;
  color: #1d4ed8;
  font-size: .82rem;
  font-weight: 700;
  background: #dbeafe;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
}

.home-hero h1 {
  margin: 0 0 1rem;
  color: #0f172a;
}

.home-hero .lead {
  max-width: 680px;
  color: #475569;
  line-height: 1.55;
}

.hero-actions {
  margin-top: 1.5rem;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: 1.35rem;
  color: #334155;
  font-size: .94rem;
}

.hero-stats span {
  padding: .45rem .65rem;
  background: rgba(255, 255, 255, .76);
  border: 1px solid #dbeafe;
  border-radius: 8px;
}

.preview-board {
  position: relative;
  height: 430px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 18% 12%, rgba(37, 99, 235, .08) 0 1px, transparent 2px),
    linear-gradient(to right, rgba(148, 163, 184, .18) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, .18) 1px, transparent 1px),
    rgba(255, 255, 255, .96);
  background-position: 0 0, 56px 72px, 56px 72px;
  background-size: 18px 18px, 22px 22px, 22px 22px;
  border: 1px solid rgba(191, 219, 254, .86);
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .16);
}

.preview-board::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 5% 9%, rgba(96, 165, 250, .18), transparent 17%),
    radial-gradient(circle at 96% 86%, rgba(147, 197, 253, .22), transparent 19%);
  pointer-events: none;
}

.preview-dots {
  position: absolute;
  top: 18px;
  left: 22px;
  display: flex;
  gap: .4rem;
}

.preview-dots span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.preview-dots span:nth-child(1) { background: #ef4444; }
.preview-dots span:nth-child(2) { background: #f59e0b; }
.preview-dots span:nth-child(3) { background: #22c55e; }

.preview-toolbar {
  position: absolute;
  top: 30px;
  left: 118px;
  z-index: 4;
  display: flex;
  gap: .35rem;
  padding: .35rem;
  background: rgba(255, 255, 255, .88);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .1);
}

.preview-toolbar span,
.preview-sidebar span,
.preview-collab button,
.preview-zoom i {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: #64748b;
  background: #fff;
  border-radius: 9px;
}

.preview-toolbar span:first-child,
.preview-sidebar .active {
  color: #2563eb;
  background: #dbeafe;
}

.preview-collab {
  position: absolute;
  top: 30px;
  right: 22px;
  z-index: 4;
  display: flex;
  align-items: center;
}

.preview-collab span,
.preview-people span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-left: -7px;
  color: #fff;
  font-size: .75rem;
  font-weight: 800;
  background: #2563eb;
  border: 3px solid #fff;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .14);
}

.preview-collab span:nth-child(2),
.preview-people span:nth-child(2) { background: #f97316; }
.preview-collab span:nth-child(3),
.preview-people span:nth-child(3) { background: #16a34a; }

.preview-collab button {
  width: 58px;
  margin-left: .45rem;
  color: #fff;
  background: #2563eb;
  border: 0;
  border-radius: 999px;
}

.preview-sidebar {
  position: absolute;
  top: 74px;
  left: 24px;
  z-index: 4;
  display: grid;
  gap: .48rem;
  padding: .65rem .45rem;
  background: rgba(255, 255, 255, .92);
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 16px 38px rgba(15, 23, 42, .12);
}

.preview-board svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.preview-board path {
  stroke: #2563eb;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.preview-board .wifi-link {
  stroke: #a78bfa;
  stroke-dasharray: 8 7;
}

.preview-node {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  width: 92px;
  height: 70px;
  gap: .22rem;
  color: #0f172a;
  font-size: .82rem;
  font-weight: 700;
  background: rgba(255, 255, 255, .94);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 16px 34px rgba(15, 23, 42, .12);
}

.preview-node b {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 9px;
  height: 9px;
  background: #22c55e;
  border-radius: 999px;
}

.preview-node i {
  font-size: 1.55rem;
  line-height: 1;
}

.preview-node.pc {
  right: 74px;
  top: 224px;
  color: #0369a1;
  background: #f0f9ff;
}

.preview-node.firewall {
  left: 94px;
  top: 174px;
  color: #b91c1c;
  background: #fee2e2;
}

.preview-node.switch {
  left: 326px;
  top: 132px;
  background: #ecfeff;
  border-color: #0891b2;
}

.preview-node.router {
  left: 220px;
  top: 132px;
  background: #fef3c7;
  border-color: #b45309;
}

.preview-node.cloud {
  left: 220px;
  top: 58px;
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #60a5fa;
  border-radius: 999px 999px 56% 56%;
}

.preview-node.server {
  right: 30px;
  top: 132px;
  color: #3730a3;
  background: #eef2ff;
  border-color: #818cf8;
}

.preview-node.wifi {
  left: 270px;
  top: 224px;
  color: #7c3aed;
  background: #f5f3ff;
  border-color: #c4b5fd;
}

.preview-wifi-group {
  position: absolute;
  left: 222px;
  bottom: 28px;
  z-index: 2;
  display: flex;
  justify-content: space-around;
  width: 200px;
  padding: .9rem 1rem;
  color: #7c3aed;
  background: rgba(245, 243, 255, .92);
  border: 1px solid #ddd6fe;
  border-radius: 14px;
  box-shadow: 0 16px 34px rgba(124, 58, 237, .12);
}

.preview-wifi-group i {
  font-size: 1.8rem;
}

.preview-share-card {
  position: absolute;
  top: 92px;
  right: -18px;
  z-index: 5;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: .45rem .7rem;
  align-items: center;
  width: 180px;
  padding: .85rem;
  background: rgba(255, 255, 255, .94);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 20px 54px rgba(15, 23, 42, .14);
}

.preview-share-card i {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #fff;
  font-size: 1.35rem;
  background: #6366f1;
  border-radius: 999px;
}

.preview-share-card span {
  height: 9px;
  background: #e5e7eb;
  border-radius: 999px;
}

.preview-share-card b {
  grid-column: 2;
  width: 44px;
  height: 22px;
  background: #2563eb;
  border-radius: 999px;
}

.preview-people {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 5;
  display: flex;
  padding: .75rem 1.1rem .75rem 1.45rem;
  background: rgba(255, 255, 255, .94);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 20px 54px rgba(15, 23, 42, .12);
}

.preview-minimap {
  position: absolute;
  right: 48px;
  bottom: 20px;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 104px;
  height: 76px;
  color: #93c5fd;
  font-size: 2rem;
  background: rgba(255, 255, 255, .9);
  border: 1px solid #dbeafe;
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .1);
}

.preview-zoom {
  position: absolute;
  right: 14px;
  bottom: 20px;
  z-index: 4;
  display: grid;
  gap: .25rem;
  padding: .3rem;
  background: rgba(255, 255, 255, .94);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .1);
}

.auth-panel {
  max-width: 620px;
  padding-top: 3rem;
}

.form-card {
  padding: 1.25rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.select2-container {
  width: 100% !important;
  font-family: "Roboto", Arial, sans-serif;
}

.select2-container--default .select2-selection--single {
  height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #111827;
  line-height: 40px;
  padding-left: .7rem;
  padding-right: 2rem;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 40px;
  right: .35rem;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: #60a5fa;
  box-shadow: 0 0 0 .18rem rgba(37, 99, 235, .12);
}

.select2-dropdown {
  z-index: 9600;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .14);
}

.select2-results__option {
  padding: .55rem .7rem;
  font-family: "Roboto", Arial, sans-serif;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background: #2563eb;
}

.page-pad {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.dashboard-actions {
  display: grid;
  gap: .65rem;
  width: min(620px, 100%);
}

.create-diagram-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(180px, .8fr) auto;
  gap: .55rem;
  align-items: start;
  max-width: 620px;
}

.import-diagram-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .55rem;
  width: min(520px, 100%);
  padding: .65rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.agent-download-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, #f8fafc, #eef6ff);
  border: 1px solid #dbeafe;
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .06);
}

.agent-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .65rem;
  color: #475569;
  font-size: .78rem;
}

.agent-download-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .5rem;
}

.agent-download-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}

/* Modernized public home */
.home-screen {
  min-height: calc(100vh - 76px);
  padding-bottom: 4rem;
  background:
    linear-gradient(135deg, rgba(248, 250, 252, .96), rgba(239, 246, 255, .96) 48%, rgba(236, 253, 245, .9)),
    #f8fafc;
}

.home-hero {
  padding-top: clamp(3rem, 7vh, 5rem);
  padding-bottom: clamp(1.5rem, 4vh, 3rem);
}

.home-hero .row {
  min-height: min(620px, calc(100vh - 170px));
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: #0f766e;
  background: rgba(204, 251, 241, .82);
  border-color: rgba(45, 212, 191, .38);
  box-shadow: 0 14px 34px rgba(15, 118, 110, .1);
}

.hero-kicker::before {
  content: "";
  width: .55rem;
  height: .55rem;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 6px rgba(34, 197, 94, .14);
}

.home-hero h1 {
  max-width: 680px;
  color: #0b1220;
  font-size: clamp(3rem, 7vw, 6rem);
  font-weight: 900;
  line-height: .9;
}

.home-hero .lead {
  max-width: 620px;
  color: #334155;
  font-size: clamp(1.08rem, 1.7vw, 1.35rem);
}

.home-hero .lead strong {
  color: #0f766e;
}

.hero-actions .btn {
  display: inline-flex;
  align-items: center;
  min-height: 3.1rem;
  padding-inline: 1.15rem;
  border-radius: 12px;
  font-weight: 800;
}

.hero-actions .btn-primary {
  background: #111827;
  border-color: #111827;
  box-shadow: 0 18px 34px rgba(17, 24, 39, .18);
}

.hero-actions .btn-primary:hover,
.hero-actions .btn-primary:focus {
  background: #0f766e;
  border-color: #0f766e;
}

.hero-stats {
  gap: .55rem;
  margin-top: 1.65rem;
}

.hero-stats span {
  color: #0f172a;
  background: rgba(255, 255, 255, .82);
  border-color: rgba(203, 213, 225, .85);
  border-radius: 999px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, .07);
}

.preview-board {
  height: min(520px, 72vh);
  min-height: 430px;
  border-color: rgba(148, 163, 184, .34);
  border-radius: 24px;
  box-shadow: 0 34px 90px rgba(15, 23, 42, .22);
  transform: perspective(1200px) rotateY(-5deg) rotateX(2deg);
}

.preview-board::after {
  content: "";
  position: absolute;
  inset: 54px 22px 22px 78px;
  z-index: -1;
  border: 1px solid rgba(14, 165, 233, .2);
  border-radius: 20px;
  pointer-events: none;
}

.preview-node {
  border-radius: 14px;
  box-shadow: 0 16px 34px rgba(15, 23, 42, .14);
}

.preview-node b {
  width: 9px;
  height: 9px;
  background: #22c55e;
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 0 16px rgba(34, 197, 94, .7);
}

.preview-node.firewall b {
  background: #ef4444;
  box-shadow: 0 0 16px rgba(239, 68, 68, .55);
}

.preview-live-card {
  position: absolute;
  right: 26px;
  bottom: 78px;
  z-index: 5;
  display: grid;
  gap: .55rem;
  width: 190px;
  padding: .85rem;
  color: #0f172a;
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(226, 232, 240, .95);
  border-radius: 16px;
  box-shadow: 0 22px 48px rgba(15, 23, 42, .18);
}

.preview-live-card div,
.preview-live-card span {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.preview-live-card i {
  color: #0f766e;
}

.preview-live-card strong {
  font-size: .82rem;
}

.preview-live-card span {
  color: #475569;
  font-size: .78rem;
  font-weight: 700;
}

.preview-live-card b {
  width: .6rem;
  height: .6rem;
  border-radius: 999px;
  background: #22c55e;
}

.preview-live-card .offline b {
  background: #ef4444;
}

.home-feature-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.home-feature-card {
  padding: 1.1rem;
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: 16px;
  box-shadow: 0 20px 46px rgba(15, 23, 42, .08);
}

.home-feature-card > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 1rem;
  color: #fff;
  background: #111827;
  border-radius: 12px;
}

.home-feature-card:nth-child(2) > span {
  background: #2563eb;
}

.home-feature-card:nth-child(3) > span {
  background: #0f766e;
}

.home-feature-card h2 {
  margin: 0 0 .45rem;
  color: #0f172a;
  font-size: 1.05rem;
  font-weight: 900;
}

.home-feature-card p {
  margin: 0;
  color: #475569;
  font-size: .94rem;
  line-height: 1.5;
}

@media (max-width: 991px) {
  .preview-board {
    transform: none;
  }

  .home-feature-band {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575px) {
  .home-hero h1 {
    font-size: 3rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .preview-live-card {
    left: 92px;
    right: auto;
    bottom: 24px;
  }
}

/* Revised home composition */
.nav-icon-link {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
}

.nav-icon-link i {
  font-size: .98rem;
  line-height: 1;
}

.theme-toggle-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
}

.theme-toggle-btn i {
  font-size: 1rem;
  line-height: 1;
}

.home-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(520px, 1.18fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.home-copy {
  max-width: 620px;
}

.home-copy h1 {
  max-width: 560px;
  font-size: clamp(2.8rem, 6vw, 5.4rem);
  line-height: .94;
}

.home-product-preview {
  overflow: hidden;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, .26);
  border-radius: 26px;
  box-shadow: 0 34px 90px rgba(15, 23, 42, .28);
}

.home-window-bar {
  display: flex;
  align-items: center;
  gap: .45rem;
  height: 46px;
  padding: 0 1rem;
  color: #cbd5e1;
  background: rgba(15, 23, 42, .96);
  border-bottom: 1px solid rgba(148, 163, 184, .18);
}

.home-window-bar span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #ef4444;
}

.home-window-bar span:nth-child(2) {
  background: #f59e0b;
}

.home-window-bar span:nth-child(3) {
  background: #22c55e;
}

.home-window-bar strong {
  margin-left: .55rem;
  font-size: .8rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.home-preview-layout {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 170px;
  min-height: 440px;
}

.home-preview-sidebar {
  display: grid;
  align-content: start;
  gap: .65rem;
  padding: 1rem .55rem;
  background: #111827;
  border-right: 1px solid rgba(148, 163, 184, .18);
}

.home-preview-sidebar i {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
}

.home-preview-sidebar i:first-child {
  color: #fff;
  background: #2563eb;
}

.home-map-canvas {
  position: relative;
  min-height: 440px;
  overflow: hidden;
  background:
    linear-gradient(to right, rgba(148, 163, 184, .14) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, .14) 1px, transparent 1px),
    #f8fafc;
  background-size: 26px 26px;
}

.home-map-canvas svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.home-map-canvas path {
  fill: none;
  stroke: #2563eb;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-map-canvas path.soft {
  stroke: #0f766e;
  stroke-dasharray: 10 9;
}

.map-device {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 96px;
  min-height: 70px;
  padding: .65rem;
  color: #0f172a;
  background: #fff;
  border: 2px solid #cbd5e1;
  border-radius: 16px;
  box-shadow: 0 16px 32px rgba(15, 23, 42, .14);
}

.map-device i {
  font-size: 1.55rem;
}

.map-device span {
  margin-top: .25rem;
  font-size: .76rem;
  font-weight: 800;
}

.map-device b {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 16px rgba(34, 197, 94, .65);
}

.map-device.cloud {
  left: 88px;
  top: 84px;
  color: #075985;
  background: #eff6ff;
  border-color: #7dd3fc;
  border-radius: 999px 999px 58% 58%;
}

.map-device.router {
  left: 246px;
  top: 84px;
  color: #92400e;
  background: #fffbeb;
  border-color: #f59e0b;
}

.map-device.firewall {
  right: 96px;
  top: 84px;
  color: #991b1b;
  background: #fef2f2;
  border-color: #ef4444;
}

.map-device.switch {
  left: 246px;
  bottom: 132px;
  color: #0f766e;
  background: #ecfdf5;
  border-color: #2dd4bf;
}

.map-device.server {
  left: 92px;
  bottom: 132px;
}

.map-device.wifi {
  right: 72px;
  bottom: 92px;
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #60a5fa;
}

.map-device.firewall b,
.home-status-card .offline b {
  background: #ef4444;
  box-shadow: 0 0 16px rgba(239, 68, 68, .5);
}

.home-status-card {
  position: absolute;
  left: 24px;
  bottom: 24px;
  display: grid;
  gap: .55rem;
  width: 188px;
  padding: .85rem;
  color: #0f172a;
  background: rgba(255, 255, 255, .94);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 22px 48px rgba(15, 23, 42, .14);
}

.home-status-card div,
.home-status-card span {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.home-status-card strong {
  font-size: .8rem;
}

.home-status-card span {
  color: #475569;
  font-size: .78rem;
  font-weight: 800;
}

.home-status-card b {
  width: .6rem;
  height: .6rem;
  border-radius: 999px;
  background: #22c55e;
}

.home-share-pill {
  position: absolute;
  right: 22px;
  top: 20px;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .7rem;
  color: #0f172a;
  font-size: .8rem;
  font-weight: 800;
  background: rgba(255, 255, 255, .92);
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .12);
}

.home-preview-sidepanel {
  display: grid;
  align-content: start;
  gap: .75rem;
  padding: 1rem;
  background: #f8fafc;
  border-left: 1px solid #e2e8f0;
}

.sidepanel-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
  padding: .6rem;
  color: #475569;
  font-size: .82rem;
  font-weight: 800;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.sidepanel-row.active {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.sidepanel-metric {
  padding: .75rem;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  border-radius: 14px;
}

.sidepanel-metric.warn {
  background: #fef2f2;
  border-color: #fecaca;
}

.sidepanel-metric small {
  display: block;
  color: #64748b;
  font-weight: 800;
}

.sidepanel-metric strong {
  color: #0f172a;
  font-size: 1.75rem;
  line-height: 1;
}

@media (max-width: 1100px) {
  .home-hero-grid {
    grid-template-columns: 1fr;
  }

  .home-product-preview {
    max-width: 820px;
  }
}

@media (max-width: 720px) {
  .home-preview-layout {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .home-preview-sidepanel {
    display: none;
  }

  .home-map-canvas {
    min-height: 380px;
  }

  .map-device {
    min-width: 82px;
    min-height: 62px;
  }

  .map-device.firewall,
  .map-device.wifi {
    right: 28px;
  }

  .home-status-card {
    width: 168px;
  }
}

/* Day/night mode */
body.theme-dark {
  color: #e5e7eb;
  background: #20242b;
}

body.theme-dark .app-navbar {
  background: #2b3038;
  border-bottom-color: rgba(226, 232, 240, .14);
}

body.theme-dark .top-panel {
  background: #2b3038;
}

body.theme-dark .brand-mark,
body.theme-dark .btn-nav,
body.theme-dark .nav-icon-link {
  color: #e5e7eb;
}

body.theme-dark .brand-icon,
body.theme-dark .btn-nav:hover,
body.theme-dark .btn-nav:focus,
body.theme-dark .theme-toggle-btn {
  color: #fff;
  background: #1d4ed8;
  border-color: #2563eb;
}

body.theme-dark .language-switcher {
  background: rgba(55, 65, 81, .72);
  border-color: rgba(226, 232, 240, .16);
}

body.theme-dark .home-screen {
  background:
    linear-gradient(135deg, #242932, #303640 54%, #2f3b3c),
    #242932;
}

body.theme-dark .hero-kicker {
  color: #99f6e4;
  background: rgba(20, 184, 166, .16);
  border-color: rgba(45, 212, 191, .32);
}

body.theme-dark .home-hero h1,
body.theme-dark .home-copy h1,
body.theme-dark .home-feature-card h2,
body.theme-dark .page-pad h1,
body.theme-dark .auth-panel h1 {
  color: #f8fafc;
}

body.theme-dark .home-hero .lead,
body.theme-dark .home-feature-card p,
body.theme-dark .text-muted,
body.theme-dark .form-text {
  color: #94a3b8 !important;
}

body.theme-dark .hero-stats span,
body.theme-dark .home-feature-card,
body.theme-dark .form-card,
body.theme-dark .dashboard-table-wrap,
body.theme-dark .diagram-settings-card,
body.theme-dark .modal-card,
body.theme-dark .agent-download-panel,
body.theme-dark .import-diagram-form {
  color: #e2e8f0;
  background: rgba(45, 51, 60, .94);
  border-color: rgba(226, 232, 240, .14);
  box-shadow: 0 22px 54px rgba(0, 0, 0, .2);
}

body.theme-dark .home-product-preview {
  background: #303640;
  border-color: rgba(226, 232, 240, .16);
  box-shadow: 0 34px 90px rgba(0, 0, 0, .28);
}

body.theme-dark .home-map-canvas {
  background:
    linear-gradient(to right, rgba(148, 163, 184, .14) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, .14) 1px, transparent 1px),
    #f8fafc;
}

body.theme-dark .preview-board {
  background:
    radial-gradient(circle at 18% 12%, rgba(37, 99, 235, .08) 0 1px, transparent 2px),
    linear-gradient(to right, rgba(148, 163, 184, .18) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, .18) 1px, transparent 1px),
    rgba(255, 255, 255, .96);
  border-color: rgba(226, 232, 240, .52);
}

body.theme-dark .home-preview-sidepanel {
  background: #343a43;
  border-left-color: rgba(226, 232, 240, .14);
}

body.theme-dark .sidepanel-row,
body.theme-dark .map-device,
body.theme-dark .home-status-card,
body.theme-dark .home-share-pill {
  color: #e2e8f0;
  background: #3b424c;
  border-color: rgba(226, 232, 240, .16);
}

body.theme-dark .map-device {
  color: #0f172a;
  background: #fff;
  border-color: #cbd5e1;
}

body.theme-dark .map-device.cloud {
  color: #075985;
  background: #eff6ff;
  border-color: #7dd3fc;
}

body.theme-dark .map-device.router {
  color: #92400e;
  background: #fffbeb;
  border-color: #f59e0b;
}

body.theme-dark .map-device.firewall {
  color: #991b1b;
  background: #fef2f2;
  border-color: #ef4444;
}

body.theme-dark .map-device.switch {
  color: #0f766e;
  background: #ecfdf5;
  border-color: #2dd4bf;
}

body.theme-dark .map-device.wifi {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #60a5fa;
}

body.theme-dark .sidepanel-row.active {
  color: #bfdbfe;
  background: rgba(37, 99, 235, .24);
}

body.theme-dark .sidepanel-metric {
  background: rgba(20, 83, 45, .55);
  border-color: rgba(34, 197, 94, .32);
}

body.theme-dark .sidepanel-metric.warn {
  background: rgba(127, 29, 29, .55);
  border-color: rgba(248, 113, 113, .32);
}

body.theme-dark .sidepanel-metric strong,
body.theme-dark .home-status-card strong,
body.theme-dark .home-status-card span {
  color: #e2e8f0;
}

body.theme-dark .page-pad,
body.theme-dark .auth-panel,
body.theme-dark .public-diagram {
  color: #e2e8f0;
}

body.theme-dark .form-control,
body.theme-dark .form-select,
body.theme-dark .select2-container--default .select2-selection--single {
  color: #e2e8f0;
  background-color: #303640;
  border-color: rgba(226, 232, 240, .18);
}

body.theme-dark .form-control::placeholder {
  color: #64748b;
}

body.theme-dark .select2-dropdown {
  color: #e2e8f0;
  background: #303640;
  border-color: rgba(226, 232, 240, .18);
}

body.theme-dark .dashboard-data-table,
body.theme-dark .dt-container {
  color: #e2e8f0;
}

body.theme-dark .dashboard-data-table thead th {
  color: #cbd5e1;
  background: #343a43;
  border-bottom-color: rgba(226, 232, 240, .14);
}

body.theme-dark .dashboard-data-table tbody td {
  color: #e2e8f0;
  background: rgba(45, 51, 60, .9);
  border-bottom-color: rgba(226, 232, 240, .1);
}

body.theme-dark .dashboard-data-table tbody tr:hover td {
  background: rgba(59, 66, 76, .95);
}

body.theme-dark .action-menu-list {
  background: #303640;
  border-color: rgba(226, 232, 240, .16);
  box-shadow: 0 20px 48px rgba(0, 0, 0, .26);
}

body.theme-dark .action-menu-list a,
body.theme-dark .action-menu-list button {
  color: #e2e8f0;
}

body.theme-dark .editor-shell,
body.theme-dark .tool-panel {
  background: #2b3038;
}

body.theme-dark .canvas-wrap,
body.theme-dark .public-wrap {
  background: #3b424c;
}

body.theme-dark .diagram-canvas {
  background-color: #f8fafc;
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, .18) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, .18) 1px, transparent 1px);
}

body.theme-dark .connection-panel .connection-settings,
body.theme-dark .tool-grid:hover,
body.theme-dark .tool-grid:focus-within,
body.theme-dark .editor-nav-actions .btn span,
body.theme-dark .icon-command span,
body.theme-dark .tool-panel #saveState {
  color: #e2e8f0;
  background: rgba(48, 54, 64, .96);
  border-color: rgba(226, 232, 240, .16);
  box-shadow: 0 22px 54px rgba(0, 0, 0, .26);
}

body.theme-dark .public-header {
  background: #2b3038;
  border-color: rgba(226, 232, 240, .14);
}

.dashboard-table-wrap {
  padding: .9rem;
  overflow: visible;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .06);
}

.dt-container {
  overflow: visible;
  color: #111827;
  font-family: "Roboto", Arial, sans-serif;
}

.dt-container .dt-layout-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 .85rem;
}

.dt-container .dt-layout-cell {
  display: flex;
  align-items: center;
}

.dt-container .dt-layout-start {
  justify-content: flex-start;
}

.dt-container .dt-layout-end {
  justify-content: flex-end;
  margin-left: auto;
}

.dt-container .dt-layout-row:last-child {
  margin: .85rem 0 0;
}

.dt-container .dt-length,
.dt-container .dt-search {
  display: flex;
  align-items: center;
  gap: .45rem;
  color: #475569;
  font-size: .9rem;
}

.dt-container .dt-search {
  justify-content: flex-end;
  text-align: right;
}

.dt-container .dt-search input,
.dt-container .dt-length select {
  min-height: 42px;
  margin: 0;
  padding: .55rem .65rem;
  color: #111827;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}

.dt-container .dt-search input {
  width: min(280px, 48vw);
}

.dt-container .dt-length select {
  min-width: 76px;
  padding-right: 1.9rem;
}

.dt-container .dt-search input:focus,
.dt-container .dt-length select:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 .18rem rgba(37, 99, 235, .12);
  outline: 0;
}

.dt-container .dt-info {
  color: #64748b;
  font-size: .9rem;
}

.dt-container .dt-paging .dt-paging-button {
  min-width: 36px;
  margin-left: .25rem;
  padding: .45rem .65rem !important;
  color: #334155 !important;
  background: #fff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
}

.dt-container .dt-paging .dt-paging-button:hover,
.dt-container .dt-paging .dt-paging-button:focus {
  color: #fff !important;
  background: #2563eb !important;
  border-color: #2563eb !important;
  outline: 0;
}

.dt-container .dt-paging .dt-paging-button.current,
.dt-container .dt-paging .dt-paging-button.current:hover {
  color: #fff !important;
  background: #2563eb !important;
  border-color: #2563eb !important;
}

.dt-container .dt-paging .dt-paging-button.disabled,
.dt-container .dt-paging .dt-paging-button.disabled:hover {
  color: #94a3b8 !important;
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  cursor: default !important;
}

.dashboard-data-table {
  width: 100% !important;
  margin: 0 !important;
  border-collapse: separate;
  border-spacing: 0;
}

.dashboard-data-table thead th {
  padding: .75rem .85rem;
  color: #334155;
  font-size: .8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}

.dashboard-data-table thead th:first-child {
  border-left: 1px solid #e2e8f0;
  border-top-left-radius: 8px;
}

.dashboard-data-table thead th:last-child {
  border-right: 1px solid #e2e8f0;
  border-top-right-radius: 8px;
}

.dashboard-data-table tbody td {
  padding: .85rem;
  vertical-align: middle;
  border-bottom: 1px solid #e5e7eb;
}

.dashboard-data-table tbody tr:hover td {
  background: #f8fafc;
}

.dashboard-data-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 8px;
}

.dashboard-data-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 8px;
}

.dashboard-data-table a:not(.btn) {
  font-weight: 600;
  text-decoration: none;
}

.dashboard-data-table a:not(.btn):hover,
.dashboard-data-table a:not(.btn):focus {
  text-decoration: underline;
}

.diagram-action-bar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: .35rem;
  justify-content: flex-end;
  align-items: center;
}

.action-menu {
  position: relative;
  z-index: 200;
}

.action-menu summary {
  list-style: none;
}

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

.action-menu-list {
  position: absolute;
  right: 0;
  bottom: calc(100% + .35rem);
  z-index: 5000;
  min-width: 180px;
  overflow: hidden;
  text-align: left;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .16);
}

.action-menu-list a,
.action-menu-list button {
  display: block;
  width: 100%;
  padding: .55rem .75rem;
  color: #334155;
  font: inherit;
  font-size: .9rem;
  text-align: left;
  text-decoration: none;
  background: #fff;
  border: 0;
  cursor: pointer;
}

.action-menu-list a:hover,
.action-menu-list button:hover,
.action-menu-list a:focus,
.action-menu-list button:focus {
  color: #fff;
  background: #2563eb;
  outline: 0;
}

.dashboard-modal-card {
  position: relative;
  width: min(560px, calc(100vw - 2rem));
}

.modal-close-btn {
  position: absolute;
  top: .8rem;
  right: .8rem;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
}

.modal-close-btn:hover,
.modal-close-btn:focus {
  color: #fff;
  background: #2563eb;
  border-color: #2563eb;
  outline: 0;
}

.diagram-settings-row td {
  padding-top: 0;
  background: #f8fafc;
}

.diagram-settings-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
  gap: .75rem;
}

.diagram-settings-card {
  padding: .8rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.setting-title {
  margin-bottom: .55rem;
  color: #334155;
  font-size: .82rem;
  font-weight: 700;
}

.public-url-control,
.share-form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .45rem;
  align-items: center;
}

.public-url-control span {
  color: #64748b;
  font-size: .86rem;
  white-space: nowrap;
}

.share-form {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.share-edit-check {
  align-self: center;
  margin: 0;
  white-space: nowrap;
}

.form-check-line {
  display: flex;
  gap: .45rem;
  align-items: flex-start;
  color: #334155;
  font-size: .9rem;
}

.form-check-line input {
  margin-top: .2rem;
}

.share-list {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .65rem;
}

.share-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  max-width: 100%;
  margin: 0;
  padding: .35rem .45rem .35rem .6rem;
  color: #334155;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
}

.share-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-chip button {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  color: #1d4ed8;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.share-chip button:hover,
.share-chip button:focus {
  color: #fff;
  background: #2563eb;
  outline: 0;
}

.share-permission-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: .55rem;
  align-items: center;
  width: 100%;
  padding: .55rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.share-email {
  min-width: 0;
}

.share-email span,
.share-email small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-email span {
  color: #0f172a;
  font-weight: 600;
}

.share-email small {
  color: #64748b;
}

.share-permission-form {
  display: inline-flex;
  gap: .45rem;
  align-items: center;
  margin: 0;
}

.share-remove-form {
  margin: 0;
}

.share-remove-form button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: #b91c1c;
  background: #fff;
  border: 1px solid #fecaca;
  border-radius: 8px;
  cursor: pointer;
}

.share-remove-form button:hover,
.share-remove-form button:focus {
  color: #fff;
  background: #dc2626;
  border-color: #dc2626;
  outline: 0;
}

.shared-diagrams-section {
  padding-top: .5rem;
}

.create-diagram-form .select2-container--default .select2-selection--single {
  height: 42px;
}

.create-diagram-form .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 40px;
}

.create-diagram-form .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 40px;
}

.custom-canvas-size {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .45rem;
  grid-column: 1 / -1;
}

.editor-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: calc(100vh - 64px);
  min-height: 640px;
}

.tool-panel {
  padding: 1rem;
  overflow: auto;
  background: #fff;
  border-right: 1px solid #e5e7eb;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(5, 42px);
  gap: .4rem;
  align-items: center;
  max-height: calc(84px + .4rem);
  overflow: hidden;
  transition: max-height .18s ease;
}

.tool-grid:hover,
.tool-grid:focus-within {
  max-height: 300px;
}

.tool-icon-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  cursor: pointer;
}

.tool-icon-btn:hover,
.tool-icon-btn:focus {
  color: #fff;
  background: #2563eb;
  border-color: #2563eb;
  outline: 0;
}

.tool-icon-btn svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-icon-btn i {
  font-size: 1.18rem;
  line-height: 1;
}

.connection-panel {
  padding: .75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.connection-toggle {
  gap: .4rem;
  font-size: .9rem;
}

.connection-settings {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: max-height .18s ease, opacity .18s ease, margin-top .18s ease;
}

.connection-settings.is-open {
  max-height: 340px;
  margin-top: .75rem;
  opacity: 1;
  pointer-events: auto;
}

.connection-title {
  margin-bottom: .55rem;
  color: #334155;
  font-size: .82rem;
  font-weight: 700;
}

.connection-panel .select2-container {
  margin-bottom: .55rem;
}

.connection-panel .select2-container--default .select2-selection--single {
  height: 34px;
  border-radius: 8px;
}

.connection-panel .select2-container--default .select2-selection--single .select2-selection__rendered {
  font-size: .86rem;
  line-height: 32px;
  padding-left: .6rem;
}

.connection-panel .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 32px;
}

.connection-fields {
  margin-top: .1rem;
}

.compact-input {
  min-height: 34px;
  padding: .35rem .5rem;
  font-size: .86rem;
  border-radius: 8px;
}

.form-control-color.compact-input {
  height: 34px;
}

.canvas-wrap {
  position: relative;
  overflow: auto;
  background: #e2e8f0;
}

.canvas-wrap.is-panning {
  cursor: grabbing;
  user-select: none;
}

.canvas-stage {
  position: relative;
  min-width: 100%;
  min-height: 100%;
}

.diagram-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 1600px;
  height: 1600px;
  transform-origin: top left;
  background-size: 24px 24px;
  background-image:
    linear-gradient(to right, #cbd5e1 1px, transparent 1px),
    linear-gradient(to bottom, #cbd5e1 1px, transparent 1px);
}

.zoom-controls {
  position: sticky;
  top: .75rem;
  left: calc(100% - 9.75rem);
  z-index: 7;
  display: flex;
  gap: .4rem;
  width: max-content;
  padding: .3rem;
  margin: .75rem .75rem -3.2rem auto;
  background: rgba(15, 23, 42, .86);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .2);
}

.public-zoom-controls {
  left: calc(100% - 7rem);
}

.zoom-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: #0f172a;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
}

.zoom-btn:hover,
.zoom-btn:focus {
  color: #fff;
  background: #2563eb;
  border-color: #2563eb;
  outline: 0;
}

.zoom-btn i {
  font-size: 1.1rem;
  line-height: 1;
}

.group-layer,
.link-layer,
.node-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.group-layer {
  z-index: 0;
  pointer-events: none;
}

.link-layer {
  z-index: 1;
  overflow: visible;
  pointer-events: none;
}

.node-layer {
  z-index: 2;
  pointer-events: none;
}

.diagram-node {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 64px;
  min-height: 54px;
  padding: .45rem;
  color: #0f172a;
  text-align: center;
  background: #fff;
  border: 2px solid #334155;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .08);
  cursor: move;
  pointer-events: auto;
  user-select: none;
}

.diagram-node::before,
.diagram-node::after {
  pointer-events: none;
}

.node-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .28rem;
  max-width: 100%;
  min-width: 0;
}

.diagram-node.selected {
  outline: 3px solid #38bdf8;
}

.diagram-node.node-shape-circle {
  border-radius: 999px;
}

.diagram-node.node-shape-cloud {
  border-radius: 999px 999px 58% 58%;
}

.diagram-node.node-shape-cloud::before,
.diagram-node.node-shape-cloud::after {
  content: "";
  position: absolute;
  z-index: 0;
  background: inherit;
  border: inherit;
  box-shadow: inherit;
}

.diagram-node.node-shape-cloud::before {
  top: -18%;
  left: 14%;
  width: 46%;
  height: 58%;
  border-radius: 999px;
}

.diagram-node.node-shape-cloud::after {
  top: -10%;
  right: 10%;
  width: 52%;
  height: 66%;
  border-radius: 999px;
}

.diagram-node.node-shape-diamond {
  transform: rotate(45deg);
}

.diagram-node.node-shape-diamond .node-content {
  transform: rotate(-45deg);
  transform-origin: center;
}

.diagram-node.multi-selected {
  outline-color: #2563eb;
  box-shadow: 0 0 0 5px rgba(37, 99, 235, .14), 0 8px 20px rgba(15, 23, 42, .08);
}

.node-icon {
  display: grid;
  place-items: center;
  width: min(42px, 42%);
  min-width: 30px;
  max-width: 56px;
  aspect-ratio: 1;
  color: currentColor;
  pointer-events: none;
}

.node-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.node-icon i {
  font-size: 2rem;
  line-height: 1;
}

.node-label {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-ip {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: inherit;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-monitor-status {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #94a3b8;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, .12);
}

.diagram-node.monitor-online .node-monitor-status {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, .22), 0 0 14px rgba(34, 197, 94, .45);
}

.diagram-node.monitor-unknown .node-monitor-status {
  background: #facc15;
  box-shadow: 0 0 0 2px rgba(250, 204, 21, .24), 0 0 12px rgba(250, 204, 21, .45);
}

.diagram-node.monitor-offline .node-monitor-status {
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, .2);
}

.diagram-node:not(.group) {
  overflow: visible;
}

.diagram-node.computer {
  background: #fff;
  border-color: #334155;
}

.diagram-node.switch {
  color: #0e7490;
  background: #ecfeff;
  border-color: #0891b2;
}

.diagram-node.router {
  color: #92400e;
  background: #fef3c7;
  border-color: #b45309;
}

.diagram-node.label {
  align-items: flex-start;
  justify-content: flex-start;
  place-items: start;
  min-width: 24px;
  min-height: 20px;
  padding: 0;
  color: #111827;
  background: transparent !important;
  border: 0;
  box-shadow: none;
}

.diagram-node.label .node-label {
  width: 100%;
  color: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
  white-space: normal;
}

.diagram-node.label.selected {
  outline-offset: 4px;
}

.diagram-node.group {
  align-items: flex-start;
  justify-content: flex-start;
  place-items: start;
  color: #475569;
  background: rgba(248, 250, 252, .18);
  border-style: dashed;
  border-color: rgba(100, 116, 139, .6);
  box-shadow: none;
  opacity: .72;
}

.diagram-node.search-dimmed {
  opacity: .16;
}

.diagram-node.search-match {
  opacity: 1;
  outline: 4px solid #f59e0b;
  box-shadow: 0 0 0 8px rgba(245, 158, 11, .18), 0 8px 20px rgba(15, 23, 42, .08);
}

.diagram-node.group .node-icon {
  width: 34px;
}

.diagram-node .resize-handle {
  position: absolute;
  right: -6px;
  bottom: -6px;
  z-index: 2;
  width: 14px;
  height: 14px;
  background: #2563eb;
  border-radius: 3px;
  cursor: nwse-resize;
}

.diagram-link {
  cursor: pointer;
  pointer-events: stroke;
}

.diagram-link-hit {
  cursor: pointer;
  pointer-events: stroke;
}

.diagram-link.selected {
  filter: drop-shadow(0 0 4px #38bdf8);
}

.selection-box {
  position: absolute;
  z-index: 5;
  background: rgba(37, 99, 235, .12);
  border: 1px solid rgba(37, 99, 235, .78);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .65) inset;
  pointer-events: none;
}

.link-label {
  font-size: 13px;
  fill: #111827;
  stroke: #fff;
  stroke-width: 4px;
  paint-order: stroke;
  cursor: pointer;
  pointer-events: auto;
}

.selection-actions {
  position: absolute;
  z-index: 6;
  display: flex;
  gap: .35rem;
  padding: .25rem;
  background: rgba(15, 23, 42, .86);
  border-radius: 8px;
}

.editor-nav-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: .45rem;
}

.editor-nav-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
}

.selection-action-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: #0f172a;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
}

.selection-action-btn:hover,
.selection-action-btn:focus {
  color: #fff;
  background: #2563eb;
  border-color: #2563eb;
  outline: 0;
}

.selection-action-danger {
  color: #b91c1c;
}

.selection-action-danger:hover,
.selection-action-danger:focus {
  color: #fff;
  background: #dc2626;
  border-color: #dc2626;
}

.selection-action-btn i {
  display: block;
  font-size: 1rem;
  line-height: 1;
}

.node-connections {
  padding-top: .8rem;
  border-top: 1px solid #e5e7eb;
}

.node-connections-list {
  display: grid;
  gap: .45rem;
}

.node-connection-row {
  display: grid;
  grid-template-columns: 1fr 34px 34px;
  gap: .35rem;
  align-items: center;
  padding: .4rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.node-connection-text {
  overflow: hidden;
  color: #334155;
  font-size: .86rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-connections-empty {
  padding: .55rem .65rem;
  color: #64748b;
  font-size: .86rem;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, .45);
}

.modal-card {
  width: min(460px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding: 1.25rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .24);
}

.public-header {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.public-header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.public-search {
  position: relative;
  width: min(360px, 42vw);
}

.public-search i {
  position: absolute;
  top: 50%;
  left: .85rem;
  color: #64748b;
  transform: translateY(-50%);
  pointer-events: none;
}

.public-search .form-control {
  padding-left: 2.35rem;
}

.public-wrap {
  height: calc(100vh - 120px);
}

.readonly .diagram-node {
  cursor: default;
}

.readonly .resize-handle {
  display: none;
}

@media (max-width: 850px) {
  .top-panel {
    gap: .75rem;
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .hero-actions {
    flex-wrap: wrap;
  }

  .create-diagram-form {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .import-diagram-form {
    grid-template-columns: 1fr;
  }

  .dashboard-table-wrap {
    padding: .65rem;
  }

  .dt-container .dt-layout-row {
    align-items: stretch;
    flex-direction: column;
  }

  .dt-container .dt-layout-cell,
  .dt-container .dt-layout-start,
  .dt-container .dt-layout-end {
    width: 100%;
    margin-left: 0;
    justify-content: stretch;
  }

  .dt-container .dt-length,
  .dt-container .dt-search {
    justify-content: space-between;
    width: 100%;
  }

  .dt-container .dt-search input {
    width: min(100%, 320px);
  }

  .diagram-settings-grid,
  .public-url-control,
  .share-form,
  .share-permission-row {
    grid-template-columns: 1fr;
  }

  .share-permission-form {
    justify-content: space-between;
  }

  .public-url-control span {
    white-space: normal;
  }

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

  .public-search {
    width: 100%;
  }

  .editor-shell {
    grid-template-columns: 1fr;
    height: auto;
  }

  .tool-panel {
    border-right: 0;
    border-bottom: 1px solid #e5e7eb;
  }

  .canvas-wrap {
    height: 70vh;
  }
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .18rem;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
}

.language-switcher a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.15rem;
  height: 1.75rem;
  border-radius: 999px;
  color: rgba(255, 255, 255, .72);
  font-size: .72rem;
  font-weight: 700;
  text-decoration: none;
}

.language-switcher a:hover,
.language-switcher a:focus,
.language-switcher a.active {
  background: rgba(255, 255, 255, .16);
  color: #fff;
}

.admin-page .admin-section {
  min-width: 0;
}

.admin-data-table {
  width: 100% !important;
}

.admin-data-table .diagram-action-bar {
  gap: .45rem;
}

@media (max-width: 680px) {
  .language-switcher {
    order: 10;
    width: 100%;
    justify-content: flex-end;
  }
}

/* Product mockup skin inspired by the generated MindMap hero. */
body {
  background:
    radial-gradient(circle at 6% 12%, rgba(147, 197, 253, .25), transparent 16rem),
    radial-gradient(circle at 96% 78%, rgba(191, 219, 254, .34), transparent 18rem),
    linear-gradient(135deg, #f8fbff 0%, #eef6ff 42%, #f8fafc 100%);
}

.app-navbar {
  min-height: 76px;
  padding: .85rem 1rem 0;
  background: transparent;
  border: 0;
}

.top-panel {
  min-height: 62px;
  padding: .7rem 1rem;
  background: rgba(255, 255, 255, .86);
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .1);
  backdrop-filter: blur(14px);
}

.brand-mark {
  color: #0f172a;
}

.brand-icon {
  color: #2563eb;
  background: #dbeafe;
  border-color: #bfdbfe;
  border-radius: 12px;
  box-shadow: none;
}

.btn-nav {
  color: #334155;
  background: #fff;
  border-color: #dbeafe;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .05);
}

.btn-nav:hover {
  color: #fff;
  background: #2563eb;
  border-color: #2563eb;
}

.home-screen {
  min-height: calc(100vh - 76px);
  background: transparent;
}

.home-hero {
  padding-top: clamp(2.5rem, 6vh, 4.5rem);
}

.hero-kicker,
.hero-stats span {
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 10px 24px rgba(37, 99, 235, .08);
}

.auth-panel {
  max-width: 720px;
}

.auth-panel h1,
.page-pad h1 {
  color: #0f172a;
  font-weight: 800;
}

.form-card,
.dashboard-table-wrap,
.diagram-settings-card,
.modal-card {
  background: rgba(255, 255, 255, .9);
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, .1);
  backdrop-filter: blur(14px);
}

.form-card {
  padding: 1.35rem;
}

.page-pad {
  padding: 2rem 1.25rem;
}

.page-pad > .d-flex:first-child {
  padding: 1rem;
  background: rgba(255, 255, 255, .7);
  border: 1px solid rgba(226, 232, 240, .85);
  border-radius: 18px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, .08);
}

.create-diagram-form,
.import-diagram-form {
  padding: .55rem;
  background: rgba(255, 255, 255, .86);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
}

.create-diagram-form {
  position: relative;
}

.create-diagram-form .select2-container--open,
.create-diagram-form .select2-dropdown {
  z-index: 6000;
}

.create-diagram-form .select2-dropdown {
  min-width: 180px;
}

.form-control,
.form-select,
.select2-container--default .select2-selection--single,
.dt-container .dt-search input,
.dt-container .dt-length select {
  background: rgba(255, 255, 255, .95);
  border-color: #dbeafe;
  border-radius: 12px;
}

.btn,
.zoom-btn,
.selection-action-btn,
.tool-icon-btn,
.modal-close-btn {
  border-radius: 12px;
}

.btn-primary,
.btn-success {
  background: #2563eb;
  border-color: #2563eb;
  box-shadow: 0 12px 26px rgba(37, 99, 235, .22);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-success:hover,
.btn-success:focus {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.dashboard-data-table thead th {
  background: #f8fbff;
}

.dashboard-data-table tbody tr:hover td {
  background: #f8fbff;
}

.action-menu-list {
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .16);
}

.editor-shell {
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 1rem;
  height: calc(100vh - 76px);
  padding: 1rem;
}

.tool-panel {
  display: flex;
  flex-direction: column;
  gap: .8rem;
  padding: .8rem;
  overflow: auto;
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, .1);
  backdrop-filter: blur(14px);
}

.editor-nav-actions {
  gap: .5rem;
}

.editor-nav-actions .btn {
  min-height: 40px;
  padding: .45rem;
  font-size: 0;
}

.editor-nav-actions .btn i {
  font-size: 1rem;
}

.tool-grid {
  grid-template-columns: repeat(5, 42px);
  gap: .45rem;
  max-height: calc(84px + .45rem);
  overflow: hidden;
}

.tool-icon-btn {
  width: 46px;
  height: 46px;
  color: #64748b;
  background: #fff;
  border-color: #e2e8f0;
  box-shadow: 0 10px 22px rgba(15, 23, 42, .06);
}

.tool-icon-btn:hover,
.tool-icon-btn:focus {
  transform: translateY(-1px);
}

.connection-panel {
  background: rgba(248, 251, 255, .96);
  border-color: #dbeafe;
  border-radius: 16px;
  box-shadow: 0 16px 38px rgba(15, 23, 42, .08);
}

.canvas-wrap {
  background:
    radial-gradient(circle at 8% 10%, rgba(147, 197, 253, .18), transparent 18rem),
    radial-gradient(circle at 95% 90%, rgba(191, 219, 254, .25), transparent 20rem),
    #f6faff;
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, .1);
}

.diagram-canvas {
  background-color: rgba(255, 255, 255, .96);
  background-image:
    radial-gradient(circle, rgba(148, 163, 184, .38) 1px, transparent 1.5px),
    linear-gradient(to right, rgba(226, 232, 240, .5) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(226, 232, 240, .5) 1px, transparent 1px);
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(226, 232, 240, .8);
}

.zoom-controls,
.selection-actions {
  background: rgba(255, 255, 255, .92);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, .12);
}

.zoom-btn,
.selection-action-btn {
  color: #64748b;
  border-color: transparent;
}

.diagram-node {
  background: rgba(255, 255, 255, .94);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 16px 34px rgba(15, 23, 42, .12);
}

.diagram-node.selected {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .24), 0 18px 38px rgba(15, 23, 42, .14);
}

.diagram-node.switch,
.diagram-node.router,
.diagram-node.computer {
  border-width: 1px;
}

.diagram-node.group {
  background: rgba(241, 245, 249, .28);
  border-color: rgba(148, 163, 184, .55);
  border-radius: 18px;
}

.diagram-node .resize-handle {
  background: #2563eb;
  border: 2px solid #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .24);
}

.modal-backdrop {
  background: rgba(15, 23, 42, .32);
  backdrop-filter: blur(6px);
}

.public-diagram {
  padding: 1rem;
}

.public-header {
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: 18px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, .08);
  backdrop-filter: blur(14px);
}

.public-wrap {
  height: calc(100vh - 142px);
}

@media (min-width: 851px) {
  .tool-grid:hover,
  .tool-grid:focus-within {
    max-height: 300px;
  }
}

@media (max-width: 850px) {
  .app-navbar {
    padding: .5rem .5rem 0;
  }

  .top-panel {
    border-radius: 14px;
  }

  .editor-shell {
    grid-template-columns: 1fr;
    height: auto;
    padding: .75rem;
  }

  .tool-panel {
    border-right: 1px solid rgba(226, 232, 240, .9);
  }

  .tool-grid {
    grid-template-columns: repeat(5, 42px);
  }

  .canvas-wrap {
    height: 70vh;
  }

  .public-diagram {
    padding: .75rem;
  }

  .public-wrap {
    height: 70vh;
  }
}

.brand-diagram-title {
  display: inline-block;
  max-width: min(38vw, 520px);
  overflow: hidden;
  padding-left: .75rem;
  margin-left: .75rem;
  color: #475569;
  font-size: .95rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-left: 1px solid #dbeafe;
}

.top-panel > .brand-diagram-title {
  align-self: center;
}

.brand-title-edit {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-left: .35rem;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  cursor: pointer;
}

.top-panel > .brand-title-edit {
  align-self: center;
}

.brand-title-edit:hover,
.brand-title-edit:focus {
  color: #fff;
  background: #2563eb;
  border-color: #2563eb;
  outline: 0;
}

.editor-shell {
  grid-template-columns: 82px minmax(0, 1fr);
}

.tool-panel {
  align-items: center;
  width: 82px;
  overflow: visible;
}

.editor-nav-actions {
  width: 46px;
}

.editor-nav-actions .btn {
  width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 0;
}

.tool-grid {
  position: relative;
  z-index: 9;
  grid-template-columns: 46px;
  width: 46px;
  max-height: calc(5 * 46px + 4 * .45rem);
  padding: 0;
  overflow: hidden;
  transition: width .18s ease, max-height .18s ease, padding .18s ease, box-shadow .18s ease;
}

.tool-grid:hover,
.tool-grid:focus-within {
  grid-template-columns: repeat(5, 46px);
  width: calc(5 * 46px + 4 * .45rem + 1.2rem);
  max-height: 360px;
  padding: .55rem;
  overflow: visible;
  background: rgba(255, 255, 255, .94);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .14);
}

.tool-icon-btn {
  width: 46px;
  height: 46px;
}

.connection-panel {
  position: relative;
  z-index: 8;
  width: 46px;
  min-height: 46px;
  padding: 0;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.connection-panel .connection-toggle {
  width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 0;
  font-size: 0;
}

.connection-panel .connection-toggle i {
  font-size: 1rem;
}

.connection-panel .connection-settings {
  position: absolute;
  top: 0;
  left: calc(100% + .65rem);
  width: 248px;
  max-height: none;
  padding: .85rem;
  overflow: visible;
  opacity: 0;
  background: rgba(255, 255, 255, .96);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .14);
  pointer-events: none;
  transform: translateX(-6px);
  transition: opacity .16s ease, transform .16s ease;
}

.connection-panel:hover .connection-settings,
.connection-panel:focus-within .connection-settings,
.connection-panel.is-selecting .connection-settings,
.connection-panel .connection-settings.is-open {
  margin-top: 0;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.icon-command {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px !important;
  height: 46px;
  min-height: 46px;
  padding: 0;
  font-size: 0;
}

.icon-command i {
  font-size: 1.05rem;
}

.icon-command span {
  position: absolute;
  left: calc(100% + .65rem);
  top: 50%;
  z-index: 20;
  min-width: max-content;
  padding: .5rem .65rem;
  color: #334155;
  font-size: .86rem;
  font-weight: 700;
  background: rgba(255, 255, 255, .96);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 16px 38px rgba(15, 23, 42, .12);
  opacity: 0;
  pointer-events: none;
  transform: translate(-6px, -50%);
  transition: opacity .16s ease, transform .16s ease;
}

.editor-nav-actions .btn {
  position: relative;
}

.editor-nav-actions .btn span {
  position: absolute;
  left: calc(100% + .65rem);
  top: 50%;
  z-index: 9500;
  min-width: max-content;
  padding: .5rem .65rem;
  color: #334155;
  font-size: .86rem;
  font-weight: 700;
  background: rgba(255, 255, 255, .96);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 16px 38px rgba(15, 23, 42, .12);
  opacity: 0;
  pointer-events: none;
  transform: translate(-6px, -50%);
  transition: opacity .16s ease, transform .16s ease;
}

.editor-nav-actions .btn:hover span,
.editor-nav-actions .btn:focus span {
  opacity: 1;
  transform: translate(0, -50%);
}

.icon-command:hover span,
.icon-command:focus-within span,
.icon-command:focus span {
  opacity: 1;
  transform: translate(0, -50%);
}

.autosave-command input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.autosave-command:has(input:checked) {
  color: #fff;
  background: #2563eb;
  border-color: #2563eb;
}

.tool-panel #saveState {
  position: absolute;
  left: calc(100% + 1rem);
  bottom: 1rem;
  min-width: 180px;
  padding: .5rem .65rem;
  background: rgba(255, 255, 255, .94);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 16px 38px rgba(15, 23, 42, .1);
}

.tool-panel #saveState:empty {
  display: none;
}

@media (max-width: 850px) {
  .editor-shell {
    grid-template-columns: 1fr;
  }

  .tool-panel {
    align-items: flex-start;
    width: auto;
    overflow: auto;
  }

  .tool-grid {
    align-self: flex-start;
    grid-template-columns: repeat(5, 46px);
    width: auto;
    max-height: calc(2 * 46px + .45rem);
  }
}

/* Editor flyouts must sit above the canvas and expand to the right. */
.editor-shell {
  overflow: visible;
}

.tool-panel {
  position: relative;
  z-index: 9000;
  overflow: visible;
}

.canvas-wrap {
  z-index: 1;
}

.tool-grid {
  align-self: flex-start;
  z-index: 9200;
  display: grid;
  grid-template-columns: 46px;
  grid-template-rows: repeat(5, 46px);
  grid-auto-flow: column;
  grid-auto-columns: 46px;
  width: 46px;
  max-height: calc(5 * 46px + 4 * .45rem);
  overflow: hidden;
  transform-origin: left top;
}

.tool-grid:hover,
.tool-grid:focus-within {
  grid-template-columns: repeat(6, 46px);
  grid-template-rows: none;
  grid-auto-flow: row;
  grid-auto-rows: 46px;
  width: calc(6 * 46px + 5 * .45rem + 1.1rem);
  max-width: calc(100vw - 6rem);
  max-height: calc(5 * 46px + 4 * .45rem + 1.1rem);
  overflow: visible;
}

.connection-panel {
  z-index: 9300;
}

.connection-panel::after {
  content: "";
  position: absolute;
  top: 0;
  left: 100%;
  width: .8rem;
  height: max(46px, 100%);
}

.connection-panel .connection-settings,
.icon-command span,
.tool-panel #saveState {
  z-index: 9500;
}

.connection-panel .select2-container,
.connection-panel .select2-dropdown,
.connection-panel .select2-container--open {
  z-index: 9600;
}

@media (min-width: 851px) {
  .tool-grid:hover,
  .tool-grid:focus-within {
    grid-template-columns: repeat(6, 46px);
    grid-template-rows: none;
    grid-auto-flow: row;
    grid-auto-rows: 46px;
  }
}

@media (max-width: 850px) {
  .tool-panel {
    overflow: visible;
  }

  .tool-grid {
    align-self: flex-start;
    grid-template-columns: repeat(5, 46px);
    grid-template-rows: none;
    grid-auto-flow: row;
    width: auto;
    max-width: 100%;
  }

  .tool-grid:hover,
  .tool-grid:focus-within {
    width: auto;
    max-width: 100%;
  }
}

/* Dark theme contrast polish */
body.theme-dark {
  color: #e8edf5;
  background: #242830;
}

body.theme-dark a:not(.btn):not(.nav-icon-link):not(.brand-mark) {
  color: #8bd3ff;
}

body.theme-dark a:not(.btn):not(.nav-icon-link):not(.brand-mark):hover,
body.theme-dark a:not(.btn):not(.nav-icon-link):not(.brand-mark):focus {
  color: #c8ecff;
}

body.theme-dark .app-navbar,
body.theme-dark .top-panel,
body.theme-dark .editor-shell,
body.theme-dark .tool-panel,
body.theme-dark .public-header {
  background: #2d333c;
  border-color: rgba(226, 232, 240, .14);
}

body.theme-dark .brand-mark,
body.theme-dark .btn-nav,
body.theme-dark .nav-icon-link {
  color: #eef4fb;
}

body.theme-dark .btn-nav:hover,
body.theme-dark .btn-nav:focus,
body.theme-dark .nav-icon-link:hover,
body.theme-dark .nav-icon-link:focus,
body.theme-dark .theme-toggle-btn {
  color: #fff;
  background: #2563eb;
  border-color: #60a5fa;
}

body.theme-dark .btn-primary {
  color: #fff;
  background-color: #2f6fec;
  border-color: #5b8df6;
}

body.theme-dark .btn-primary:hover,
body.theme-dark .btn-primary:focus {
  color: #fff;
  background-color: #245ed4;
  border-color: #8bb4ff;
}

body.theme-dark .btn-success {
  color: #062514;
  background-color: #62d394;
  border-color: #86efac;
}

body.theme-dark .btn-success:hover,
body.theme-dark .btn-success:focus {
  color: #041b0e;
  background-color: #86efac;
  border-color: #bbf7d0;
}

body.theme-dark .btn-danger {
  color: #fff;
  background-color: #dc3f4b;
  border-color: #f87171;
}

body.theme-dark .btn-outline-primary {
  color: #c7ddff;
  background: rgba(47, 111, 236, .12);
  border-color: #6ea8fe;
}

body.theme-dark .btn-outline-primary:hover,
body.theme-dark .btn-outline-primary:focus {
  color: #fff;
  background: #2f6fec;
  border-color: #9cc2ff;
}

body.theme-dark .btn-outline-secondary,
body.theme-dark .btn-outline-dark {
  color: #edf2f8;
  background: rgba(255, 255, 255, .06);
  border-color: #94a3b8;
}

body.theme-dark .btn-outline-secondary:hover,
body.theme-dark .btn-outline-secondary:focus,
body.theme-dark .btn-outline-dark:hover,
body.theme-dark .btn-outline-dark:focus {
  color: #0f172a;
  background: #e2e8f0;
  border-color: #f8fafc;
}

body.theme-dark .btn-outline-danger {
  color: #fecaca;
  background: rgba(220, 63, 75, .12);
  border-color: #fb7185;
}

body.theme-dark .btn-outline-danger:hover,
body.theme-dark .btn-outline-danger:focus {
  color: #fff;
  background: #dc3f4b;
  border-color: #fda4af;
}

body.theme-dark .btn:disabled,
body.theme-dark .btn.disabled {
  color: #94a3b8;
  background: rgba(148, 163, 184, .12);
  border-color: rgba(148, 163, 184, .35);
  opacity: 1;
}

body.theme-dark .home-screen {
  background:
    radial-gradient(circle at 18% 10%, rgba(59, 130, 246, .18), transparent 34%),
    linear-gradient(135deg, #252a33, #313842 56%, #2f3e3f),
    #252a33;
}

body.theme-dark .home-product-preview,
body.theme-dark .home-preview-sidepanel,
body.theme-dark .home-feature-card,
body.theme-dark .form-card,
body.theme-dark .dashboard-table-wrap,
body.theme-dark .diagram-settings-card,
body.theme-dark .modal-card,
body.theme-dark .agent-download-panel,
body.theme-dark .import-diagram-form,
body.theme-dark .page-pad,
body.theme-dark .auth-panel,
body.theme-dark .public-diagram {
  color: #e8edf5;
  background: #303742;
  border-color: rgba(226, 232, 240, .16);
  box-shadow: 0 24px 58px rgba(0, 0, 0, .24);
}

body.theme-dark .text-muted,
body.theme-dark .form-text,
body.theme-dark .dt-container .dt-info,
body.theme-dark .agent-meta,
body.theme-dark .public-url-control span {
  color: #a9b7c9 !important;
}

body.theme-dark .form-label,
body.theme-dark .form-check-label,
body.theme-dark .form-check-line,
body.theme-dark .setting-title,
body.theme-dark .share-edit-check,
body.theme-dark label {
  color: #dbe5f1;
}

body.theme-dark .form-control,
body.theme-dark .form-select,
body.theme-dark .dt-container .dt-search input,
body.theme-dark .dt-container .dt-length select,
body.theme-dark .select2-container--default .select2-selection--single {
  color: #f4f7fb;
  background-color: #38404b;
  border-color: #667085;
}

body.theme-dark .form-control:focus,
body.theme-dark .form-select:focus,
body.theme-dark .dt-container .dt-search input:focus,
body.theme-dark .dt-container .dt-length select:focus,
body.theme-dark .select2-container--default.select2-container--focus .select2-selection--single,
body.theme-dark .select2-container--default.select2-container--open .select2-selection--single {
  color: #fff;
  background-color: #3f4854;
  border-color: #8bd3ff;
  box-shadow: 0 0 0 .18rem rgba(139, 211, 255, .18);
}

body.theme-dark .form-control::placeholder {
  color: #94a3b8;
}

body.theme-dark .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #f4f7fb;
}

body.theme-dark .select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: #dbe5f1 transparent transparent transparent;
}

body.theme-dark .select2-dropdown {
  color: #f4f7fb;
  background: #343c47;
  border-color: #667085;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .32);
}

body.theme-dark .select2-results__option {
  color: #f4f7fb;
  background: #343c47;
}

body.theme-dark .select2-container--default .select2-results__option--selected {
  color: #fff;
  background: #2563eb;
}

body.theme-dark .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  color: #fff;
  background: #2f6fec;
}

body.theme-dark .dashboard-data-table,
body.theme-dark .dt-container {
  color: #e8edf5;
}

body.theme-dark .dashboard-data-table thead th {
  color: #eaf1f8;
  background: #3b4450;
  border-color: rgba(226, 232, 240, .18);
}

body.theme-dark .dashboard-data-table tbody td {
  color: #e8edf5;
  background: #303742;
  border-bottom-color: rgba(226, 232, 240, .12);
}

body.theme-dark .dashboard-data-table tbody tr:hover td,
body.theme-dark .diagram-settings-row td {
  background: #39424e;
}

body.theme-dark .dashboard-data-table a:not(.btn) {
  color: #8bd3ff;
}

body.theme-dark .dashboard-data-table a:not(.btn):hover,
body.theme-dark .dashboard-data-table a:not(.btn):focus {
  color: #c8ecff;
}

body.theme-dark .dt-container .dt-length,
body.theme-dark .dt-container .dt-search {
  color: #cbd7e5;
}

body.theme-dark .dt-container .dt-paging .dt-paging-button {
  color: #e8edf5 !important;
  background: #38404b !important;
  border-color: #667085 !important;
}

body.theme-dark .dt-container .dt-paging .dt-paging-button:hover,
body.theme-dark .dt-container .dt-paging .dt-paging-button:focus {
  color: #fff !important;
  background: #2f6fec !important;
  border-color: #8bd3ff !important;
}

body.theme-dark .dt-container .dt-paging .dt-paging-button.current,
body.theme-dark .dt-container .dt-paging .dt-paging-button.current:hover {
  color: #fff !important;
  background: #2563eb !important;
  border-color: #8bd3ff !important;
}

body.theme-dark .dt-container .dt-paging .dt-paging-button.disabled,
body.theme-dark .dt-container .dt-paging .dt-paging-button.disabled:hover {
  color: #8290a3 !important;
  background: #2f3640 !important;
  border-color: #48515e !important;
}

body.theme-dark .action-menu-list {
  color: #e8edf5;
  background: #343c47;
  border-color: #667085;
  box-shadow: 0 22px 52px rgba(0, 0, 0, .36);
}

body.theme-dark .action-menu-list a,
body.theme-dark .action-menu-list button {
  color: #e8edf5;
  background: #343c47;
}

body.theme-dark .action-menu-list a:hover,
body.theme-dark .action-menu-list button:hover,
body.theme-dark .action-menu-list a:focus,
body.theme-dark .action-menu-list button:focus {
  color: #fff;
  background: #2f6fec;
}

body.theme-dark .modal-close-btn {
  color: #e8edf5;
  background: #38404b;
  border-color: #667085;
}

body.theme-dark .modal-close-btn:hover,
body.theme-dark .modal-close-btn:focus {
  color: #fff;
  background: #2f6fec;
  border-color: #8bd3ff;
}

body.theme-dark .share-chip,
body.theme-dark .sidepanel-row,
body.theme-dark .home-status-card,
body.theme-dark .home-share-pill,
body.theme-dark .connection-panel .connection-settings,
body.theme-dark .tool-grid:hover,
body.theme-dark .tool-grid:focus-within,
body.theme-dark .editor-nav-actions .btn span,
body.theme-dark .icon-command span,
body.theme-dark .tool-panel #saveState {
  color: #e8edf5;
  background: #38404b;
  border-color: rgba(226, 232, 240, .16);
}

body.theme-dark .canvas-wrap,
body.theme-dark .public-wrap {
  background: #3b424c;
}

body.theme-dark .home-map-canvas,
body.theme-dark .preview-board,
body.theme-dark .diagram-canvas {
  background-color: #f8fafc;
}

/* Dark theme header and dashboard top panel */
body.theme-dark .top-panel {
  background: rgba(45, 51, 60, .96);
  border-color: rgba(226, 232, 240, .16);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .28);
}

body.theme-dark .nav-actions .btn,
body.theme-dark .btn-nav {
  color: #e8edf5;
  background: rgba(255, 255, 255, .07);
  border-color: rgba(226, 232, 240, .18);
  box-shadow: none;
}

body.theme-dark .nav-actions .btn:hover,
body.theme-dark .nav-actions .btn:focus,
body.theme-dark .btn-nav:hover,
body.theme-dark .btn-nav:focus {
  color: #fff;
  background: #2f6fec;
  border-color: #8bd3ff;
}

body.theme-dark .nav-actions .btn-primary {
  color: #fff;
  background: #2f6fec;
  border-color: #6ea8fe;
}

body.theme-dark .nav-actions .btn-outline-danger {
  color: #ffd0d5;
  background: rgba(220, 63, 75, .14);
  border-color: rgba(251, 113, 133, .72);
}

body.theme-dark .nav-actions .btn-outline-danger:hover,
body.theme-dark .nav-actions .btn-outline-danger:focus {
  color: #fff;
  background: #dc3f4b;
  border-color: #fda4af;
}

body.theme-dark .brand-icon {
  color: #d9ecff;
  background: rgba(47, 111, 236, .28);
  border-color: rgba(139, 211, 255, .42);
}

body.theme-dark .page-pad > .d-flex:first-child {
  color: #e8edf5;
  background:
    linear-gradient(135deg, rgba(59, 130, 246, .12), rgba(20, 184, 166, .08)),
    #303742;
  border-color: rgba(226, 232, 240, .16);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .24);
}

body.theme-dark .page-pad > .d-flex:first-child h1,
body.theme-dark .page-pad h1 {
  color: #f8fafc;
}

body.theme-dark .page-pad > .d-flex:first-child .text-muted {
  color: #b6c3d4 !important;
}

body.theme-dark .create-diagram-form,
body.theme-dark .import-diagram-form {
  color: #e8edf5;
  background: rgba(56, 64, 75, .9);
  border-color: rgba(226, 232, 240, .16);
  box-shadow: 0 14px 32px rgba(0, 0, 0, .22);
}

body.theme-dark .create-diagram-form .btn-primary {
  color: #fff;
  background: #2f6fec;
  border-color: #8bd3ff;
}

.home-footer {
  padding: 1.5rem 1rem 2rem;
  color: #64748b;
  font-size: .92rem;
  text-align: center;
}

.home-footer a {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}

.home-footer a:hover,
.home-footer a:focus {
  color: #1d4ed8;
  text-decoration: underline;
}

body.theme-dark .home-footer {
  color: #b6c3d4;
}

body.theme-dark .home-footer a {
  color: #8bd3ff;
}

body.theme-dark .home-footer a:hover,
body.theme-dark .home-footer a:focus {
  color: #c8ecff;
}
