.routeros-enhanced-editor {
  min-width: 0;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(96, 165, 250, 0.24);
  background: #0d1117;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 18px 42px rgba(2, 6, 23, 0.36);
}

.routeros-enhanced-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.8rem;
  min-height: 2.65rem;
  padding: 0.45rem 0.65rem;
  background: linear-gradient(180deg, #111827, #0b1220);
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.routeros-enhanced-dots {
  display: inline-flex;
  gap: 0.34rem;
}

.routeros-enhanced-dots i {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 999px;
}

.routeros-enhanced-dots i:nth-child(1) { background: #ff5f56; }
.routeros-enhanced-dots i:nth-child(2) { background: #ffbd2e; }
.routeros-enhanced-dots i:nth-child(3) { background: #27c93f; }

.routeros-enhanced-title {
  min-width: 0;
  overflow: hidden;
  color: #94a3b8;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.76rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.routeros-enhanced-copy {
  min-height: 2rem;
  padding: 0.38rem 0.7rem;
  border: 1px solid rgba(96, 165, 250, 0.32);
  border-radius: 8px;
  color: #dbeafe;
  background: rgba(15, 23, 42, 0.86);
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}

.routeros-enhanced-copy:hover {
  border-color: rgba(56, 189, 248, 0.65);
  color: #f8fafc;
}

.routeros-enhanced-code {
  max-height: min(54vh, 520px);
  overflow: auto;
  padding: 0.8rem 0;
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0.92) 0 3.4rem, transparent 3.4rem),
    #0d1117;
  scrollbar-color: rgba(96, 165, 250, 0.42) rgba(15, 23, 42, 0.7);
  scrollbar-width: thin;
}

.routeros-enhanced-line {
  display: grid;
  grid-template-columns: 3.4rem max-content;
  min-width: max-content;
  padding: 0 1rem 0 0;
  color: #d6deeb;
  font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.52;
}

.routeros-enhanced-line-number {
  padding-right: 0.85rem;
  color: #64748b;
  text-align: right;
  user-select: none;
}

.routeros-enhanced-line code {
  white-space: pre;
}

.routeros-enhanced-source {
  display: none !important;
}

.routeros-enhanced-comment { color: #6ee787; }
.routeros-enhanced-path { color: #ff7b72; }
.routeros-enhanced-keyword { color: #79c0ff; }
.routeros-enhanced-property { color: #d2a8ff; }
.routeros-enhanced-string { color: #ffa657; }
.routeros-enhanced-variable { color: #db61a2; }
.routeros-enhanced-number { color: #f2cc60; }
.routeros-enhanced-plain { color: #d6deeb; }

@media (max-width: 640px) {
  .routeros-enhanced-bar {
    gap: 0.55rem;
    padding: 0.42rem 0.5rem;
  }

  .routeros-enhanced-code {
    max-height: 420px;
    background:
      linear-gradient(90deg, rgba(15, 23, 42, 0.92) 0 2.85rem, transparent 2.85rem),
      #0d1117;
  }

  .routeros-enhanced-line {
    grid-template-columns: 2.85rem max-content;
    font-size: 0.78rem;
  }

  .routeros-enhanced-line-number {
    padding-right: 0.65rem;
  }
}
