:root {
/* Colors */
--ne-primary: #f7f7f7;
--ne-primary-hover: #0056b3;
--ne-primary-light: rgba(0, 124, 186, 0.1);
--ne-primary-shadow: rgba(0, 123, 186, 0.4);

--ne-background: var(--BACKGROUND);
--ne-background-secondary: var(--BACKGROUND);
--ne-background-toolbar: var(--BACKGROUND);
--ne-background-hover: var(--WHITE);
--ne-background-selection: #d1ecf1;

--ne-text: var(--WHITE);
--ne-text-secondary: var(--GRAY);
--ne-text-muted: #aaaaaa;
--ne-text-inverse: white;

--ne-border: var(--WHITE);
--ne-border-light: rgba(255, 255, 255, 0.5);
--ne-border-dark: var(--WHITE);
--ne-border-focus: var(--ne-primary);

--ne-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
--ne-shadow-hover: 0 3px 6px rgba(0, 0, 0, 0.25);
--ne-shadow-focus: 0 0 0 1px var(--ne-primary);
--ne-shadow-tooltip: 0 4px 12px rgba(0, 0, 0, 0.15);

/* Spacing */
--ne-space-xs: 4px;
--ne-space-sm: 8px;
--ne-space-md: 12px;
--ne-space-lg: 16px;
--ne-space-xl: 20px;
--ne-space-2xl: 24px;

/* Typography */
--prism-font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;

--ne-font-size-xs: 10px;
--ne-font-size-sm: 12px;
--ne-font-size-base: 14px;
--ne-font-size-lg: 16px;
--ne-font-size-xl: 18px;

--ne-line-height: 1.6;

/* Sizing */
--ne-border-radius: 4px;
--ne-border-radius-lg: 8px;

--ne-button-size: 32px;
--ne-button-size-sm: 28px;
--ne-button-size-xs: 24px;
--ne-button-size-lg: 36px;
--ne-button-size-xl: 40px;

--ne-content-height: 300px;
--ne-content-height-sm: 200px;
--ne-content-height-xs: 150px;

/* Transitions */
--ne-transition: all 0.2s ease;
--ne-transition-fast: all 0.1s ease;

/* Z-index */
--ne-z-tooltip: 1000;
--ne-z-overlay: 10000;
}

/* Use station background color */

/* ==========================================================================
    RESET AND BASE STYLES
    ========================================================================== */

.ne-editor-container * {
  box-sizing: border-box;
}

.ne-editor-container input,
.ne-editor-container button,
.ne-editor-container select,
.ne-editor-container textarea {
  font-size: inherit;
  line-height: inherit;
}

/* ==========================================================================
    CORE EDITOR STRUCTURE
    ========================================================================== */

.ne-editor-container {
  border: 1px solid var(--ne-border);
  border-radius: var(--ne-border-radius);
  background: var(--background);
  margin-bottom: var(--ne-space-sm);
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  position: relative;
  z-index: 1;
  transition: var(--ne-transition);
}

.ne-editor-container.ne-focused {
  border-color: var(--ne-border-focus);
  box-shadow: var(--ne-shadow-focus);
}

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

.ne-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: var(--ne-space-sm);
  background: var(--ne-background-toolbar);
  border-bottom: 2px solid var(--ne-border-dark);
  border-radius: var(--ne-border-radius) var(--ne-border-radius) 0 0;
  gap: 6px;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.1);
}

.ne-toolbar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--ne-button-size);
  height: var(--ne-button-size);
  font-size: var(--ne-font-size-base);
  font-weight: bold;
  user-select: none;
}

.ne-toolbar-button.active {
  position: relative;
}

.ne-toolbar-button.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--ne-primary);
  border-radius: 2px;
}

.ne-toolbar-separator {
  width: 2px;
  height: var(--ne-space-2xl);
  background: var(--ne-text-muted);
  margin: 0 6px;
  border-radius: 1px;
}

/* ==========================================================================
    CONTENT AREA
    ========================================================================== */

.ne-content {
  position: relative;
  height: var(--ne-content-height);
  max-height: var(--ne-content-height);
  padding: var(--ne-space-md);
  outline: none;
  line-height: var(--ne-line-height);
  color: var(--ne-text);
  background: var(--ne-background);
  overflow-y: auto;
  font-size: var(--ne-font-size-base);
  font-weight: 400;
  resize: none;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* Hide native cursor when visual caret is active */
.ne-content.ne-visual-caret-active {
  caret-color: transparent;
}

.ne-content:empty:before {
  content: attr(data-placeholder);
  color: var(--ne-text-muted);
  font-style: italic;
}

.ne-content:focus {
  outline: none;
}

/* ==========================================================================
    TEXT FORMATTING
    ========================================================================== */

.ne-content strong,
.ne-content b {
  font-weight: 700;
}

.ne-content em,
.ne-content i {
  font-style: italic;
}

.ne-content s,
.ne-content strike {
  text-decoration: line-through;
}

.ne-content p {
  margin: var(--ne-space-sm) 0;
}

/* ==========================================================================
    LISTS
    ========================================================================== */

.ne-content ul,
.ne-content ol {
  margin: var(--ne-space-sm) 0;
  padding-left: var(--ne-space-2xl);
  list-style-position: inside;
}

.ne-content ul {
  list-style-type: disc;
}

.ne-content ol {
  list-style-type: decimal;
}

.ne-content li {
  margin: var(--ne-space-xs) 0;
}

/* ==========================================================================
    TABLES
    ========================================================================== */

.ne-content table {
  border-collapse: collapse;
  width: 100%;
  margin: var(--ne-space-sm) 0;
}

.ne-content table td,
.ne-content table th {
  border: 1px solid var(--ne-border-dark);
  padding: var(--ne-space-sm);
  text-align: left;
  opacity: 1;
}

.ne-content table th {
  background-color: var(--ne-background-secondary);
  font-weight: 700;
  opacity: 1;
}

.ne-content .ne-ranked-table,
.ne-content .ranked-table,
.ne-content .ne-ordinary-table,
.ne-content .ordinary-table {
  border-collapse: collapse;
  width: 100%;
  margin: var(--ne-space-sm) 0;
  border: 1px solid var(--ne-border);
  background: var(--background);
  table-layout: fixed;
  overflow-x: auto;
}

.ne-content .ne-ranked-table th,
.ne-content .ne-ranked-table td,
.ne-content .ranked-table th,
.ne-content .ranked-table td,
.ne-content .ne-ordinary-table th,
.ne-content .ne-ordinary-table td,
.ne-content .ordinary-table th,
.ne-content .ordinary-table td {
  border: 1px solid var(--ne-border);
  padding: var(--ne-space-sm) var(--ne-space-md);
  text-align: left;
  vertical-align: middle;
  word-wrap: break-word;
  overflow-wrap: break-word;
  opacity: 1;
}

.ne-content .ne-ranked-table th,
.ne-content .ranked-table th,
.ne-content .ne-ordinary-table th,
.ne-content .ordinary-table th {
  background: var(--ne-background-secondary);
  font-weight: 700;
  height: 36px;
}

/* Specific styles for ranked tables */
.ne-content .ne-ranked-table th:not(:last-child),
.ne-content .ne-ranked-table td:not(:last-child),
.ne-content .ranked-table th:not(:last-child),
.ne-content .ranked-table td:not(:last-child) {
  width: auto;
}

.ne-content .ne-ranked-table th:last-child,
.ne-content .ne-ranked-table td:last-child,
.ne-content .ranked-table th:last-child,
.ne-content .ranked-table td:last-child {
  width: 120px;
  min-width: 120px;
  max-width: 120px;
}

/* Styles for table tool */
.ne-content .ne-ranked-table td[contenteditable="true"],
.ne-content .ranked-table td[contenteditable="true"],
.ne-content .ne-ordinary-table td[contenteditable="true"],
.ne-content .ordinary-table td[contenteditable="true"] {
  min-width: 100px;
  min-height: 36px;
  height: 36px;
}

.ne-content .ne-ranked-table td[contenteditable="true"]:focus,
.ne-content .ranked-table td[contenteditable="true"]:focus,
.ne-content .ne-ordinary-table td[contenteditable="true"]:focus,
.ne-content .ordinary-table td[contenteditable="true"]:focus {
  outline: 2px solid var(--ne-primary);
  outline-offset: -2px;
}

/* Score Cell - Scoped to native editor only */
.ne-content .ne-score-cell {
  text-align: center;
  width: 120px;
}

.ne-content .ne-score-container,
.ne-content .score-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--ne-space-sm);
}

.ne-content .thumb-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--ne-space-xs);
}

.ne-content .thumb-up,
.ne-content .thumb-down {
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--ne-space-xs);
  border-radius: var(--ne-border-radius);
  transition: background-color 0.2s ease;
  color: var(--ne-text);
}

.ne-content .thumb-up:hover,
.ne-content .thumb-down:hover {
  background: var(--ne-background-secondary);
}

.ne-content .score-box {
  font-weight: 700;
  font-size: var(--ne-font-size-lg);
  color: var(--ne-text);
  min-width: 20px;
  text-align: center;
}

/* ==========================================================================
    CODE SAMPLES
    ========================================================================== */

.language-python, .language-cpp {
  background: var(--background-secondary)!important;
  border: 1px solid var(--ne-border)!important;
  border-radius: var(--ne-border-radius);
  margin: var(--ne-space-sm) 0;
  font-size: var(--ne-font-size-base);
  overflow-x: auto;
  color: var(--ne-text);
  line-height: 1.5;
}

.code-content-wrapper {
  display: flex;
  white-space: pre !important;
  position: relative;
  background: var(--background-secondary);
}

.line-numbers {
  width: 50px;
  padding: var(--ne-space-md) 0;
  background: rgba(0, 0, 0, 0.1);
  border-right: 1px solid var(--ne-border);
  color: var(--ne-text-muted);
  font-family: var(--prism-font-family) !important;
  font-size: var(--ne-font-size-base);
  line-height: 1.5;
  text-align: right;
  user-select: none;
  flex-shrink: 0;
}

.line-number {
  display: block;
  padding: 0 8px;
  color: var(--ne-text-muted);
  height: 1.5em;
}

.language-python code, .language-cpp code {
  flex: 1;
  padding: var(--ne-space-md);
  font-family: var(--prism-font-family) !important;
  padding-left: 16px;
  white-space: pre !important;
  display: block;
  min-width: 0;
  overflow-x: auto;
  background: none;
}

/* Code Editor Line Numbers */
.code-editor-wrapper {
  position: relative;
  display: flex;
  background: var(--background-secondary);
  border: 1px solid var(--ne-border);
  border-radius: var(--ne-border-radius);
  height: 300px;
  overflow: hidden;
}

.line-numbers {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 40px;
  padding: 8px 0;
  background: rgba(0, 0, 0, 0.1);
  border-right: 1px solid var(--ne-border);
  color: var(--ne-text-muted);
  font-size: var(--ne-font-size-base);
  line-height: 1.5;
  text-align: right;
  user-select: none;
  z-index: 2;
  pointer-events: none;
}

.code-content-wrapper .line-numbers {
  position: static;
}

.code-content-wrapper .line-number {
  padding-right: 0;
}

.line-numbers-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 8px;
}

.line-numbers span {
  display: block;
  height: 1.5em;
  color: var(--ne-text-muted);
}

.code-content {
  flex: 1;
  position: relative;
  margin-left: 40px; /* Same as line-numbers width */
}

#code-sample-overlay textarea[name="code"] {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 8px;
  background: transparent;
  border: none;
  font-size: var(--ne-font-size-base);
  line-height: 1.5;
  color: var(--ne-text);
  resize: none;
  white-space: pre;
  tab-size: 4;
  outline: none;
  overflow-y: scroll;
}

#code-sample-overlay textarea[name="code"]:focus {
  outline: none;
}

.code-with-line-numbers {
  position: relative;
  padding: 0 !important;
  margin: var(--ne-space-sm) 0;
  background: var(--background-secondary) !important;
  border: 1px solid var(--ne-border) !important;
  border-radius: var(--ne-border-radius);
}

.code-content-wrapper {
  display: flex;
  font-size: var(--ne-font-size-base);
  line-height: 1.5;
}

.line-numbers {
  display: flex;
  flex-direction: column;
  padding: var(--ne-space-md) var(--ne-space-sm);
  background: rgba(0, 0, 0, 0.1);
  border-right: 1px solid var(--ne-border);
  user-select: none;
  text-align: right;
  min-width: 3em;
}

.line-number {
  color: var(--ne-text-muted);
  font-size: inherit;
  line-height: inherit;
  padding-right: var(--ne-space-sm);
}

.language-python code, .language-cpp code {
  background: none;
  padding: var(--ne-space-md);
  font-size: inherit;
  color: inherit;
  border:0 !important;
  flex: 1;
  display: block;
}

.code-with-line-numbers {
  position: relative;
}

.code-with-line-numbers textarea {
  width: 100%;
  resize: vertical;
  line-height: 1.5;
  tab-size: 4;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
}

.code-editor-container {
  position: relative;
}


/* ==========================================================================
    TEXT HIGHLIGHTING
    ========================================================================== */

.ne-content .ne-highlight-red {
  color: #FF0000;
}

.ne-content .ne-highlight-turquoise {
  color: #40E0D0;
}

.ne-toolbar-button i {
  font-size: inherit;
  line-height: inherit;
}

/* Highlight button styling - maintain colors for paint brush icons */
.ne-toolbar-button[data-action="highlightTurquoise"]:hover {
  background: var(--WHITE) !important;
}

.ne-toolbar-button[data-action="highlightTurquoise"].active {
  background: var(--WHITE) !important;
}

.ne-toolbar-button[data-action="highlightRed"]:hover {
  background: var(--WHITE) !important;
}

.ne-toolbar-button[data-action="highlightRed"].active {
  background: var(--WHITE) !important;
}

/* ==========================================================================
    IMAGE HANDLING
    ========================================================================== */

.ne-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--ne-border-radius);
  margin: var(--ne-space-sm) 0;
  display: block;
  cursor: pointer;
  position: relative;
}

.ne-content img.selected {
  outline: 2px solid var(--ne-primary);
  outline-offset: 2px;
}

.ne-content .image-resize-container {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

/* ==========================================================================
    DRAG AND DROP ZONE
    ========================================================================== */

.ne-content.ne-drop-zone {
  position: relative;
  background: linear-gradient(135deg, rgba(74, 144, 226, 0.1) 0%, rgba(80, 227, 194, 0.1) 100%);
  border: 2px dashed var(--ne-primary);
  border-radius: var(--ne-border-radius-lg);
  transition: all 0.3s ease;
  animation: dropZonePulse 1.5s ease-in-out infinite;
}

.ne-content.ne-drop-zone::before {
  content: "Drop image here";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: var(--ne-font-size-lg);
  font-weight: 600;
  color: var(--ne-primary);
  pointer-events: none;
  z-index: 10;
  background: var(--ne-background);
  padding: var(--ne-space-sm) var(--ne-space-md);
  border-radius: var(--ne-border-radius);
  box-shadow: var(--ne-shadow);
}

@keyframes dropZonePulse {
  0%, 100% {
    border-color: var(--ne-primary);
    box-shadow: 0 0 0 0 rgba(74, 144, 226, 0.4);
  }
  50% {
    border-color: var(--ne-accent);
    box-shadow: 0 0 0 8px rgba(74, 144, 226, 0.1);
  }
}

.ne-content .resize-handle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--ne-primary);
  border: 1px solid var(--ne-text-inverse);
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: none;
}

/* Mobile-friendly resize handles */
@media (max-width: 768px) {
  .ne-content .resize-handle {
    width: 16px;
    height: 16px;
    border-width: 2px;
  }
}

.ne-content .image-resize-container.selected .resize-handle {
  display: block;
}

.ne-content .resize-handle.nw {
  top: -4px;
  left: -4px;
  cursor: nw-resize;
}

.ne-content .resize-handle.ne {
  top: -4px;
  right: -4px;
  cursor: ne-resize;
}

.ne-content .resize-handle.sw {
  bottom: -4px;
  left: -4px;
  cursor: sw-resize;
}

.ne-content .resize-handle.se {
  bottom: -4px;
  right: -4px;
  cursor: se-resize;
}

/* Mobile handle positioning adjustments */
@media (max-width: 768px) {
  .ne-content .resize-handle.nw {
    top: -8px;
    left: -8px;
  }

  .ne-content .resize-handle.ne {
    top: -8px;
    right: -8px;
  }

  .ne-content .resize-handle.sw {
    bottom: -8px;
    left: -8px;
  }

  .ne-content .resize-handle.se {
    bottom: -8px;
    right: -8px;
  }
}

.image-resize-tooltip {
  position: fixed;
  background: rgba(0, 0, 0, 0.8);
  color: var(--ne-text-inverse);
  padding: var(--ne-space-xs) var(--ne-space-sm);
  border-radius: var(--ne-border-radius);
  font-size: var(--ne-font-size-sm);
  pointer-events: none;
  z-index: var(--ne-z-tooltip);
  white-space: nowrap;
  box-shadow: var(--ne-shadow);
}

/* ==========================================================================
    POPUP SYSTEMS
    ========================================================================== */

/* Table Insert Popup */
#table-insert-overlay {
  width: 34rem;
  max-width: 90%;
  box-sizing: border-box;
}

.table-insert-form {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  width: 100%;
}

.table-insert-form h3.table-insert-title {
  text-align: center;
  margin-bottom: 1rem;
  color: var(--ne-text);
  font-weight: 600;
}

.table-insert-form .input-box {
  position: relative;
  width: 100%;
  border-bottom: 2px solid var(--WHITE);
  padding: 1rem;
  margin-top: 15px;
}

.table-insert-form .input-box input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--WHITE);
  font-size: 1.5rem;
  padding: 0;
}

.table-insert-form .input-box input:focus {
  outline: none;
}

.table-insert-form .input-box input:focus ~ label,
.table-insert-form .input-box input:valid ~ label {
  top: -5px;
  font-size: 1.3rem;
}

.table-insert-form .input-box label {
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  pointer-events: none;
  transition: var(--ne-transition);
}

.overlay-popup-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.overlay-popup-buttons button {
  height: 4.5rem;
  background-color: transparent;
  padding: 10px 20px;
  width: 100%;
}

.overlay-popup-buttons button:hover {
  background-color: var(--WHITE);
  color: var(--BACKGROUND);
}

.overlay-popup-buttons button:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px var(--ne-primary-shadow);
}


/* ==========================================================================
    TOOLTIP SYSTEM
    ========================================================================== */

.ne-table-tooltip {
  position: absolute;
  z-index: var(--ne-z-tooltip);
  background: var(--ne-background);
  border-radius: var(--ne-border-radius-lg);
  box-shadow: var(--ne-shadow-tooltip);
  padding: var(--ne-space-sm);
  display: none;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  min-width: 300px;
}

.ne-table-tooltip.show {
  display: block;
  pointer-events: auto;
  opacity: 1;
  left: 0;
  top: 115px;
  right:0;
  width:fit-content;
  margin:0 auto;
}

.ne-tooltip-content {
  display: flex;
  flex-direction: row;
  gap: 0;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.ne-tooltip-group {
  display: flex;
  gap: var(--ne-space-xs);
  align-items: center;
}

.ne-tooltip-divider {
  width: 1px;
  height: var(--ne-space-2xl);
  background: var(--ne-border);
  margin: 0 var(--ne-space-sm);
  flex-shrink: 0;
}

.ne-tooltip-btn {
  width: var(--ne-button-size);
  height: var(--ne-button-size);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--ne-font-size-sm);
  position: relative;
}

.ne-tooltip-btn i {
  font-size: var(--ne-font-size-sm);
}

.ne-tooltip-btn i:last-child {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: var(--ne-font-size-xs);
  color: #dc3545;
}

.ne-tooltip-caret {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--ne-background);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}



/* ==========================================================================
    TOUCH AND MOBILE SUPPORT
    ========================================================================== */

.ne-touch .ne-toolbar-button {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  touch-action: manipulation;
}

.ne-mobile .ne-toolbar-button {
  min-height: 44px;
  min-width: 44px;
}

.ne-touch .ne-content {
  -webkit-touch-callout: none;
  -webkit-user-select: text;
  -khtml-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.ne-selection-active .ne-toolbar {
  background: var(--ne-background-selection);
}

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

.form-box .ne-editor-container {
  margin-top: var(--ne-space-sm);
}

.popup .ne-editor-container {
  max-height: 350px;
}

.popup .ne-content {
  height: 300px;
  max-height: 300px;
  overflow-y: auto;
}

.form-box.update-content .ne-content {
  height: 300px;
  max-height: 300px;
}

.ne-content .ranked-table tbody tr td:last-child {
  cursor: not-allowed;
  user-select: none;
  pointer-events: none;
  opacity: 0.7;
}

.ne-content .ranked-table tbody tr td:last-child * {
  pointer-events: none;
  user-select: none;
}

.ne-content .ranked-table td:last-child[contenteditable="false"] {
  -webkit-user-modify: read-only;
  caret-color: transparent;
}

.ne-content .ranked-table td:last-child:focus {
  outline: none;
}

.ne-content .thumb-up,
.ne-content .thumb-down {
  cursor: not-allowed;
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
}

.ne-content .thumb-up:hover,
.ne-content .thumb-down:hover {
  background-color: transparent !important;
  color: inherit !important;
}

.ne-content .score-box {
  opacity: 0.6;
}

.form-box.update-content {
  max-height: 80vh;
  overflow-y: auto;
}

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

/* Mobile (≤768px) */
@media (max-width: 768px) {
  .popup-container.active-popup-large {
    width: 95%;
    max-width: 95%;
  }
  
  .ne-editor-container {
    margin-bottom: var(--ne-space-sm);
  }
  
  .ne-toolbar {
    padding: 6px;
    gap: var(--ne-space-xs);
    flex-wrap: wrap;
  }
  
  .ne-toolbar-button {
    width: var(--ne-button-size-sm);
    height: var(--ne-button-size-sm);
    font-size: var(--ne-font-size-sm);
    border-width: 1px;
  }
  
  .ne-toolbar-separator {
    width: 1px;
    height: var(--ne-space-xl);
    margin: 0 3px;
  }
  
  .ne-content {
    height: var(--ne-content-height-sm);
    max-height: var(--ne-content-height-sm);
    padding: var(--ne-space-sm);
    font-size: var(--ne-font-size-lg);
  }
  
  .ne-content .ne-score-container {
    flex-direction: column;
    gap: var(--ne-space-xs);
  }
  
  .ne-content .ne-thumb-buttons {
    flex-direction: row;
    gap: var(--ne-space-xs);
  }
  
  .ne-content .ne-ranked-table {
    font-size: var(--ne-font-size-base);
  }
  
  .ne-content .ne-ranked-table th,
  .ne-content .ne-ranked-table td {
    padding: 6px var(--ne-space-sm);
  }
  
  .ne-content .ne-ranked-table th:last-child,
  .ne-content .ne-ranked-table td:last-child {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
  }
  
  .form-box.update-content .ne-content {
    height: var(--ne-content-height-sm);
    max-height: var(--ne-content-height-sm);
  }
  
  .form-box.update-content {
    max-height: 100vh;
    padding: 1rem;
  }
  
  .popup .ne-content {
    height: var(--ne-content-height-sm);
    max-height: var(--ne-content-height-sm);
  }
  
  #table-insert-overlay {
    width: 95%;
    max-width: 95%;
    margin: 0 auto;
  }
  
  .table-insert-form {
    padding: var(--ne-space-xl);
  }
  
  .overlay-popup-buttons {
    flex-direction: column;
    gap: 0.8rem;
  }
  
  .overlay-popup-buttons button {
    height: 3.5rem;
    font-size: 1.2rem;
  }
  
  .ne-table-tooltip {
    min-width: 280px;
  }
  
  .ne-tooltip-btn {
    width: var(--ne-button-size-sm);
    height: var(--ne-button-size-sm);
    font-size: 11px;
  }
  
  .ne-tooltip-btn i {
    font-size: 11px;
  }
  
  .ne-tooltip-btn i:last-child {
    font-size: 7px;
  }
  
  .ne-tooltip-divider {
    height: var(--ne-space-xl);
    margin: 0 6px;
  }
  
}

/* Small Mobile (≤480px) */
@media (max-width: 480px) {
  .ne-editor-container {
    margin-bottom: 6px;
  }
  
  .ne-toolbar {
    padding: var(--ne-space-xs);
    gap: 2px;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .ne-toolbar-button {
    width: var(--ne-button-size-xs);
    height: var(--ne-button-size-xs);
    font-size: var(--ne-font-size-xs);
    border-width: 1px;
  }
  
  .ne-toolbar-separator {
    width: 1px;
    height: var(--ne-space-lg);
    margin: 0 2px;
  }
  
  .ne-content {
    min-height: 120px;
    padding: 6px;
    font-size: var(--ne-font-size-lg);
  }
  
  .ne-content .ne-ranked-table {
    font-size: var(--ne-font-size-sm);
  }
  
  .ne-content .ne-ranked-table th,
  .ne-content .ne-ranked-table td {
    padding: var(--ne-space-xs) 6px;
  }
  
  .ne-content .ne-ranked-table th:last-child,
  .ne-content .ne-ranked-table td:last-child {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
  }
  
  .ne-content .ne-score-container {
    gap: 2px;
  }
  
  #table-insert-overlay {
    width: 98%;
    max-width: 98%;
    margin: 0 auto;
  }
  
  .table-insert-form {
    padding: var(--ne-space-lg);
  }
  
  .table-insert-form .input-box {
    margin-bottom: 1rem;
    padding: 0.8rem;
  }
  
  .table-insert-form .input-box input {
    font-size: 1.2rem;
  }
  
  .table-insert-form .input-box input:focus ~ label,
  .table-insert-form .input-box input:valid ~ label {
    font-size: 1rem;
  }
  
  .overlay-popup-buttons button {
    height: 3rem;
    font-size: 1rem;
    padding: 8px 16px;
  }
  
  .ne-table-tooltip {
    min-width: 240px;
  }
  
  .ne-tooltip-content {
    flex-wrap: wrap;
    gap: 0;
  }
  
  .ne-tooltip-group {
    gap: 2px;
  }
  
  .ne-tooltip-btn {
    width: var(--ne-button-size-xs);
    height: var(--ne-button-size-xs);
    font-size: var(--ne-font-size-xs);
  }
  
  .ne-tooltip-btn i {
    font-size: var(--ne-font-size-xs);
  }
  
  .ne-tooltip-btn i:last-child {
    font-size: 6px;
  }
  
  .ne-tooltip-divider {
    height: var(--ne-space-lg);
    margin: 0 var(--ne-space-xs);
  }
}

/* Large Screens (≥1200px) */
@media (min-width: 1200px) {
  .ne-editor-container {
    max-width: 100%;
  }
  
  .ne-toolbar {
    padding: 10px;
    gap: var(--ne-space-sm);
  }
  
  .ne-toolbar-button {
    width: var(--ne-button-size-lg);
    height: var(--ne-button-size-lg);
    font-size: var(--ne-font-size-lg);
  }
  
  .ne-content {
    min-height: 250px;
    padding: var(--ne-space-lg);
    font-size: var(--ne-font-size-lg);
  }
}

/* Extra Large Screens (≥1600px) */
@media (min-width: 1600px) {
  .ne-toolbar-button {
    width: var(--ne-button-size-xl);
    height: var(--ne-button-size-xl);
    font-size: var(--ne-font-size-xl);
  }
  
  .ne-content {
    min-height: var(--ne-content-height);
    padding: var(--ne-space-xl);
    font-size: var(--ne-font-size-xl);
  }
}

/* Landscape Orientation */
@media (max-width: 768px) and (orientation: landscape) {
  .ne-content {
    height: var(--ne-content-height-xs);
    max-height: var(--ne-content-height-xs);
  }
  
  .ne-toolbar {
    padding: var(--ne-space-xs);
    gap: 3px;
  }
  
  .ne-toolbar-button {
    width: 26px;
    height: 26px;
    font-size: 11px;
  }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .ne-toolbar-button {
    border-width: 0.5px;
  }
  
  .ne-toolbar-separator {
    width: 0.5px;
  }
}

/* ==========================================================================
    PRINT STYLES
    ========================================================================== */

@media print {
  .ne-editor-container {
    border: 1px solid #000;
    background: var(--ne-background);
    box-shadow: none;
  }
  
  .ne-toolbar {
    display: none;
  }
  
  .ne-content {
    background: var(--ne-background);
    color: black;
    min-height: auto;
  }
}

/* ==========================================================================
    UTILITY CLASSES
    ========================================================================== */

.ne-hidden {
  display: none;
}

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

/* .ne-text-center {
  text-align: center;
} */

.ne-text-left {
  text-align: left;
}

.ne-text-right {
  text-align: right;
}

.ne-mb-0 {
  margin-bottom: 0;
}

.ne-mb-1 {
  margin-bottom: var(--ne-space-xs);
}

.ne-mb-2 {
  margin-bottom: var(--ne-space-sm);
}

.ne-mb-3 {
  margin-bottom: var(--ne-space-md);
}

.ne-mb-4 {
  margin-bottom: var(--ne-space-lg);
}

.ne-p-0 {
  padding: 0;
}

.ne-p-1 {
  padding: var(--ne-space-xs);
}

.ne-p-2 {
  padding: var(--ne-space-sm);
}

.ne-p-3 {
  padding: var(--ne-space-md);
}

.ne-p-4 {
  padding: var(--ne-space-lg);
}


/* Visual Caret for Block Navigation */
.ne-visual-caret {
  position: absolute;
  width: 1px;
  background-color: var(--ne-primary);
  pointer-events: none;
  z-index: 1000;
  animation: ne-caret-blink 1s step-end infinite;
  /* Add subtle border for definition */
  border: 1px solid var(--ne-primary-light);
}

@keyframes ne-caret-blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}
