/* NaviBlockSet stylesheet. Edit this file directly: it was first assembled from style.css, crop_and_ask.css and tiptap.css (performance hardening Fase 1), which have since been removed. */
:root {
    --border-container-color: black;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
}

#container {
    position: relative;
    z-index: 1;
    /* Touch gestures belong to the canvas (features/touch/canvasTouch.js):
       a pinch zooms the canvas, not the page. */
    touch-action: none;
}

.empty-canvas-hint {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(560px, calc(100vw - 72px));
    padding: 16px 18px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(17, 17, 17, 0.55);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: rgba(255, 255, 255, 0.86);
    font-family: 'Inter', sans-serif;
    text-align: center;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.empty-canvas-hint.is-visible {
    opacity: 1;
}

.empty-canvas-hint__title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ffffff;
}

/* What the guide says depends on the mode: how to add content while
   editing, how to start editing while viewing (body.nbs-editing, main.js). */
body.nbs-editing .empty-canvas-hint__line--view,
body:not(.nbs-editing) .empty-canvas-hint__line--edit {
  display: none;
}

/* Mouse and keyboard instructions, or touch ones, by the main pointer */
.empty-canvas-hint__line--touch {
  display: none;
}

@media (pointer: coarse) {
  .empty-canvas-hint__line--pointer {
    display: none;
  }

  body.nbs-editing .empty-canvas-hint__line--touch {
    display: block;
  }
}

.empty-canvas-hint__line {
    font-size: 13px;
    line-height: 1.45;
}

.sandbox-inline-tip {
    position: fixed;
    left: 42px;
    bottom: 36px;
    z-index: 4;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(12, 12, 12, 0.64);
    color: rgba(255, 255, 255, 0.72);
    font-size: 11px;
    font-weight: 500;
    pointer-events: none;
}

#container.spa-slide {
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.border-container {
    background-color: var(--border-container-color);
    z-index: 2;
}

#staticBackdrop {
    z-index: 2000 !important;
    /* o cualquier número alto */
}

.logo {
    height: 25px;
    margin-right: 20px;
    box-sizing: border-box;
    margin-bottom: 2px;
}

#id_blockset {
    display: inline-block;
    max-width: 230px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.custom-button {
    font-size: 12px !important;
    padding: 0 5px !important;
    margin: 1px 5px !important;
    /* Aumento del margen en los lados */
    height: 20px !important;
    line-height: 20px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold !important;
}

.button-icon {
    width: 23px !important;
    height: auto !important;
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.button-icon:hover {
    opacity: 0.7;
    filter: brightness(2.3);
}

.button-icon--up--down {
    width: auto;
    height: 22px;
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.button-icon--up--down:hover {
    opacity: 0.7;
    filter: brightness(2.3);
}

*/ .custom-modal-center {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1050;
    /* Este valor podría necesitar ajuste según tu diseño */
}

.context-menu {
    background-color: #f0f0f0;
    border: 1px solid #d4d4d4;
    padding: 10px;
}

.context-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.context-menu ul li {
    padding: 5px;
    cursor: pointer;
}

.context-menu ul li:hover {
    background-color: #e0e0e0;
}

/* Ajustar los estilos del contenedor de elementos izquierdos si es necesario */
.d-flex.align-items-center {
/* Asegúrate de que los elementos estén alineados en el centro verticalmente */
    align-items: center;
}

.d-flex {
    display: flex;
    align-items: center; /* Alinea verticalmente si es que hay altura suficiente */
    justify-content: flex-start; /* Alinea horizontalmente al inicio, es decir, a la izquierda */
}

/* En tu archivo style.css */
.custom-input {
    background-color: black;
    color: white;
    font-weight: bold;
}

  /* Contenedor de resultados con bordes redondeados */
  .rounded-container {
    border: 1px solid #ced4da; /* Color del borde */
    padding: 15px; /* Espacio interior */
    border-radius: 15px; /* Radio del borde redondeado */
    margin-top: 10px; /* Espacio superior */
    display: flex; /* Utilizar flexbox */
    flex-direction: column; /* Elementos en columna */
    align-items: flex-start; /* Alinear elementos al inicio */
  }
  
  /* Estilo de los botones de resultados de búsqueda */
  .btn-blockset-search-result {
    margin-top: 10px;
    background-color: #007bff; /* Color de fondo azul */
    color: white; /* Texto en color blanco */
    border: none; /* Sin bordes */
    border-radius: 4px; /* Bordes redondeados */
    padding: 10px 20px; /* Padding interno para tamaño del botón */
    font-size: 16px; /* Tamaño de la fuente */
    line-height: 1.5; /* Altura de línea para centrar el texto verticalmente */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Sombra para el botón */
    transition: background-color 0.2s; /* Transición suave para el color de fondo */
    cursor: pointer; /* Cambiar el cursor a tipo puntero */
    white-space: nowrap; /* Evitar que el texto se ajuste */
    display: inline-block; /* Hacer que el ancho se ajuste al contenido */
  }
  
  .btn-blockset-search-result:not(:first-child) {
    margin-top: 5px;
  }
  
  .btn-blockset-search-result:hover {
    background-color: #0056b3; /* Color de fondo al pasar el mouse */
  }

  .results-container {
    /* Ajusta este contenedor para que actúe como un contenedor flex */
    border: 1px solid var(--bgf-accent);
    padding: 15px; /* Espacio interior */
    border-radius: 5px; /* Radio del borde redondeado */
    margin-top: 10px; /* Espacio superior */
    display: flex;
    flex-wrap: wrap;
    gap: 10px; /* Espacio entre botones */
    justify-content: start; /* Alinea los elementos al inicio */
  }

 
  
  
  .result-button {
    /* Estilos para los botones de resultados */
    background-color: var(--bgf-accent);
    color: white;
    border: none;
    padding: 2px 15px;
    border-radius: 5px;
    text-align: center;
    cursor: pointer;
    white-space: nowrap; /* Evita que el texto se ajuste a una nueva línea */
  }

  .result-button:hover {
    background-color: gray; /* Color de fondo al pasar el mouse */
  }

 
  /* Estilo para el contenido del modal */
    .modal-content {
        background-color: black !important;
        color: white;
    }

    .modal .btn-close {
        filter: invert(1);
        opacity: 0.6;
    }

    .modal .modal-title {
        color: white;
    }

    .modal .col-form-label {
        color: rgba(255,255,255,0.7);
    }

    /* Estilo para la entrada de búsqueda para mantenerla visible */
    #search-input {
        background-color: black; /* Establece el fondo de la entrada a blanco */
        color: white; /* Establece el color del texto de la entrada a negro */
    }

    /* Asegúrate de aplicar los estilos necesarios para que la nueva imagen se muestre en el lugar correcto */
    #hoverImage {
        background: none;
        border: none;
        padding: 0;
        cursor: pointer;
    }
    

    /* .info-button {
        position: relative;
        width: 50px;  /* Ancho del botón */
        /*height: 50px;  /* Alto del botón */
        /*cursor: pointer;
        }*/
      
      .info-button {
        position: relative;
        width: 50px;  /* Ancho del botón */
        height: 50px; /* Alto del botón */
        cursor: pointer;
        display: flex; /* Añadido para hacer el contenedor flex */
        justify-content: center; /* Centrar horizontalmente */
        align-items: center; /* Centrar verticalmente */
        }

      /* Estilo general del modal */
    .modal {
        display: none;
        position: fixed;
        z-index: 1;
        right: 0;
        top: 50px;
        width: 300px;
        height: 100%;
        overflow: auto;
        background-color: rgba(0, 0, 0, 0.4);
    }

  /* Shared shell drawer overlay. Type renderers must not override this. */
  .modal.navi-edge-drawer-overlay {
    position: fixed;
    inset: 30px;
    z-index: 1040;
    width: auto;
    height: auto;
    overflow: visible;
    background: transparent;
    pointer-events: auto;
  }

  /* Modal info - contenedor principal */
  .modal-content-info {
    position: fixed;
    top: 30px;
    right: 30px;
    width: min(560px, calc(100vw - 60px));
    height: calc(100vh - 95px);
    background: var(--border-container-color, #000);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 0;
    border-radius: 0 0 0 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    animation: edgeDrawerSlideIn 240ms cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 1;
  }

  @keyframes edgeDrawerSlideIn {
    from {
      opacity: 0;
      transform: translateX(100%);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  /* Modal header */
  .modal-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .modal-info-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #fff;
  }

  /* Modal body */
  .modal-info-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
  }

  .modal-info-body::-webkit-scrollbar {
    width: 4px;
  }

  .modal-info-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
  }

  /* Secciones */
  .info-section {
    margin-bottom: 20px;
  }

  .info-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.4);
    margin: 0 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  /* Grid de instrucciones */
  .info-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    transition: background 0.2s;
  }

  .info-row:hover {
    background: rgba(255, 255, 255, 0.08);
  }

  .info-keys {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  .info-keys kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    padding: 0 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 5px;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    color: #fff;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
  }

  .key-plus {
    color: rgba(255, 255, 255, 0.3);
    font-size: 12px;
  }

  .key-icon {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
  }

  .info-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    text-align: right;
  }

  /* Modal footer */
  .modal-info-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .app-version {
    color: rgba(255, 255, 255, 0.3);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.5px;
  }

  .linkedin-button {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    opacity: 0.5;
    transition: all 0.2s;
  }

  .linkedin-button:hover {
    opacity: 1;
    background: rgba(10, 102, 194, 0.15);
    border-color: rgba(10, 102, 194, 0.3);
  }

  .linkedin-icon {
    width: 18px;
    height: 18px;
    display: block;
  }

  .linkedin-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    letter-spacing: 0.3px;
  }

  /* Close button mejorado */
  .close-button {
    color: rgba(255, 255, 255, 0.4);
    font-size: 24px;
    font-weight: 300;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
    float: none;
  }

  .close-button:hover,
  .close-button:focus {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
  }

  
  /* Estilo del botón de cerrar */
  .close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
  }
  
  .close-button:hover,
  .close-button:focus {
    color: black;
    cursor: pointer;
  }
      
  

/* Estilos para el modal de búsqueda con filtros */

/* Contenedor principal del modal de búsqueda */
.search-modal-content {
    background-color: var(--bgf-surface);
    color: #fff;
    border-radius: var(--bgf-radius);
    border: 1px solid var(--bgf-border);
}

/* Campo de búsqueda */
#search-input {
    background-color: #333;
    border: 1px solid #444;
    color: white;
    /* Room on the right for the clear button: no text under it. */
    padding: 10px 38px 10px 15px;
    border-radius: 4px;
}

#search-input::placeholder {
    color: #888;
}

/* Contenedor de botones de filtro */
.filter-buttons {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    margin-bottom: 12px;
}

/* Botones de filtro (most used, history) */
.filter-btn {
    padding: 5px 15px;
    border: none;
    border-radius: 4px;
    background-color: #444;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.filter-btn:hover {
    background-color: #555;
}

/* Estilo para el botón de filtro activo */
.active-filter {
    background-color: var(--bgf-accent);
}

/* Área para los blocksets favoritos/recientes */
.favorite-blocksets-area {
    margin-bottom: 15px;
    min-height: 50px;
}

/* Contenedor para los blocksets como botones */
#favorite-blocksets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Estilos para los botones de blockset */
.blockset-button {
    background-color: var(--bgf-accent);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.blockset-button:hover {
    background-color: #004080;
}

/* Línea divisoria */
.divider {
    border-color: #444;
    margin: 15px 0;
    opacity: 0.5;
}

/* Contenedor de resultados de búsqueda */
.results-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Botones de resultados */
.result-button {
    background-color: var(--bgf-accent);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.result-button:hover {
    background-color: #004080;
}

/* Mensajes de estado */
.no-results-message {
    color: #999;
    font-style: italic;
    padding: 10px 0;
}

.error-message {
    color: #ff6b6b;
    padding: 10px 0;
    font-style: italic;
}

/* Agrega esto a tu archivo CSS: c:\Users\Crica\Documents\Projects\BlockGraf\blockgraf\NaviBlockSet\static\NaviBlockSet\css\style.css */

/* Contenedor con borde para los blocksets */
.blocksets-container {
  border: 2px solid #0072e6; /* Color púrpura para el borde como se ve en la imagen */
  border-radius: 12px;
  margin-top: 15px;
  margin-bottom: 15px;
  padding: 5px;
  background-color: #111; /* Fondo oscuro para el contenedor */
  min-height: 100px;
}

/* Mejoras para los botones de blockset */
.blockset-button {
  background-color: var(--bgf-accent);
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s;
  margin: 4px;
  text-align: center;
}

.blockset-button:hover {
  background-color: #0072e6;
}

/* Estilos para los botones de filtro */
.filter-btn {
  padding: 5px 15px;
  border: none;
  border-radius: 4px;
  background-color: #444;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-right: 5px;
}

.filter-btn:hover {
  background-color: #555;
}

.active-filter {
  background-color: #0072e6; /* Color púrpura para el botón activo */
}

/* Mejorar el estilo del modal */
.search-modal-content {
  background-color: var(--bgf-surface);
  color: white;
  border: 1px solid var(--bgf-border);
  border-radius: var(--bgf-radius);
}

/* Añade esto a tu archivo CSS */
.blocksets-container {
  border: 2px solid #0072e6; /* Borde púrpura */
  border-radius: 12px;
  margin: 12px 0;
  padding: 5px;
  background-color: #111;
}

.blockset-button {
  background-color: var(--bgf-accent);
  color: white;
  border: none;
  padding: 5px 15px;
  border-radius: 4px;
  margin: 3px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.blockset-button:hover {
  background-color: #004080;
}

.active-filter {
  background-color: #0072e6; /* Púrpura para el botón activo */
}

/* Añade esto a tu archivo CSS si no lo tienes ya */
.blocksets-container {
  border: 2px solid #0072e6;
  border-radius: 12px;
  margin: 12px 0;
  padding: 5px;
  background-color: #111;
  display: block; /* Asegura que el contenedor siempre es visible */
}

/* Neighbor preview cards */
.neighbor-preview-card {
  --nbs-peek-shift: 0 0;
  position: fixed;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: var(--bgf-space-1);
  width: max-content;
  min-width: 140px;
  max-width: 240px;
  padding: var(--bgf-space-3) var(--bgf-space-4);
  box-sizing: border-box;
  color: var(--bgf-text);
  font-family: var(--bgf-font);
  background: var(--bgf-surface);
  border: 1px solid var(--bgf-border-strong);
  border-radius: var(--bgf-radius);
  box-shadow: var(--bgf-shadow);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--bgf-duration) ease, translate var(--bgf-duration) ease;
  translate: var(--nbs-peek-shift);
}

.neighbor-preview-card.visible {
  opacity: 1;
  translate: 0 0;
}

.neighbor-preview-card__meta {
  display: flex;
  align-items: center;
  gap: var(--bgf-space-2);
  color: var(--bgf-text-muted);
  font-size: var(--bgf-text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.neighbor-preview-card__meta .fa-arrow-up,
.neighbor-preview-card__meta .fa-arrow-down,
.neighbor-preview-card__meta .fa-arrow-left,
.neighbor-preview-card__meta .fa-arrow-right {
  color: var(--bgf-accent-text);
}

.neighbor-preview-card__name {
  display: -webkit-box;
  overflow: hidden;
  font-size: var(--bgf-text-sm);
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

/* SPA directional slide transition */
.spa-clip-wrapper {
  position: fixed;
  top: 30px;
  left: 30px;
  width: calc(100vw - 60px);
  height: calc(100vh - 60px);
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.spa-snapshot-overlay {
  position: absolute;
  top: -30px;
  left: -30px;
  width: 100vw;
  height: 100vh;
  background-size: 100vw 100vh;
  background-position: top left;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.navigation-map-overlay {
  position: fixed;
  inset: 0;
  z-index: 1600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: rgba(8, 10, 12, 0.34);
  backdrop-filter: blur(7px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

.navigation-map-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.navigation-map-panel {
  width: min(720px, calc(100vw - 64px));
  aspect-ratio: 1 / 1;
  max-height: min(720px, calc(100vh - 80px));
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(18, 20, 22, 0.9);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.42);
}

.navigation-map-grid {
  display: grid;
  grid-template-columns: repeat(var(--navigation-map-columns, 5), minmax(0, 1fr));
  grid-template-rows: repeat(var(--navigation-map-rows, 5), minmax(0, 1fr));
  gap: 9px;
  width: 100%;
  height: 100%;
  aspect-ratio: var(--navigation-map-columns, 5) / var(--navigation-map-rows, 5);
}

.navigation-map-cell {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  min-height: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  background: rgba(38, 42, 45, 0.9);
  color: rgba(255, 255, 255, 0.86);
  font-family: 'Inter', sans-serif;
  text-align: left;
  transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.16s ease;
}

.navigation-map-cell:disabled {
  cursor: default;
}

.navigation-map-cell.is-navigable {
  cursor: pointer;
}

.navigation-map-cell.is-navigable:hover {
  border-color: rgba(78, 190, 150, 0.78);
  background: rgba(35, 48, 45, 0.92);
  transform: translateY(-1px);
}

.navigation-map-cell.is-current {
  border-color: rgba(255, 255, 255, 0.76);
  background: rgba(58, 76, 88, 0.96);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.navigation-map-cell.is-origin {
  border-color: rgba(223, 178, 94, 0.86);
}

.navigation-map-cell.is-target {
  border-color: rgba(78, 190, 150, 0.92);
  background: rgba(28, 61, 52, 0.94);
}

.navigation-map-cell.is-empty {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.055);
  opacity: 1;
}

.navigation-map-cell.is-empty::after {
  content: "";
  width: 18px;
  height: 18px;
  align-self: center;
  margin: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 4px;
}

.navigation-map-cell.is-out-of-bounds {
  visibility: hidden;
  pointer-events: none;
}

.navigation-map-cell.is-blocked {
  background: rgba(53, 38, 39, 0.72);
  color: rgba(255, 255, 255, 0.6);
}

.navigation-map-cell__name {
  display: -webkit-box;
  overflow: hidden;
  color: inherit;
  font-size: clamp(11px, 1.15vw, 15px);
  font-weight: 600;
  line-height: 1.15;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.navigation-map-cell__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.navigation-map-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 16px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.82);
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.navigation-map-badge--public {
  background: rgba(45, 142, 95, 0.28);
}

.navigation-map-badge--private {
  background: rgba(148, 91, 65, 0.28);
}

@media (max-width: 600px) {
  .navigation-map-overlay {
    padding: 18px;
  }

  .navigation-map-panel {
    width: min(94vw, 460px);
    padding: 8px;
  }

  .navigation-map-grid {
    gap: 6px;
  }

  .navigation-map-cell {
    padding: 7px;
  }

  .navigation-map-cell__name {
    font-size: 10px;
    -webkit-line-clamp: 3;
  }

  .navigation-map-badge {
    font-size: 9px;
    padding-inline: 4px;
  }
}

/* Copy toast notification — roller window */
.neighbor-preview-up    { top: 52px; left: 50%; transform: translateX(-50%); --nbs-peek-shift: 0 -6px; }
.neighbor-preview-down  { bottom: 52px; left: 50%; transform: translateX(-50%); --nbs-peek-shift: 0 6px; }
.neighbor-preview-left  { left: 40px; top: 50%; transform: translateY(-50%); --nbs-peek-shift: -6px 0; }
.neighbor-preview-right { right: 40px; top: 50%; transform: translateY(-50%); --nbs-peek-shift: 6px 0; }

/* === Search results: chip-based rows === */
.results-container[data-state="results"],
.results-container[data-state="loading"],
.results-container[data-state="no-results"],
.results-container[data-state="error"] {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

.results-container[data-state="idle"] {
  display: none;
  margin: 0;
  padding: 0;
  border: 0;
}

#history-blocksets,
#most-used-blocksets {
  flex-direction: column;
  align-items: stretch;
  gap: 4px !important;
  padding: 10px 12px !important;
  overflow: visible;
}

.result-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  margin: 0;
  padding: 5px 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  align-items: center;
  text-align: left;
  width: 100%;
  min-width: 0;
  overflow: visible;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.result-row:hover,
.result-row--active {
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.045);
}

.result-row:hover .result-chip,
.result-row--active .result-chip,
.result-row:focus-visible .result-chip {
  filter: brightness(1.08);
}

.result-row:focus-visible {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  outline: 2px solid rgba(103, 176, 49, 0.45);
  outline-offset: 1px;
}

.result-chip {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 28px;
  padding: 6px 12px;
  border-radius: 0;
  font-weight: 600;
  font-size: 12px;
  line-height: 1;
  color: #fff;
  white-space: nowrap;
  pointer-events: none;
  overflow: visible;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.result-chip + .result-chip {
  border-left: 1px solid rgba(255, 255, 255, 0.55);
}

.result-chip:first-of-type {
  border-top-left-radius: 7px;
  border-bottom-left-radius: 7px;
}

.result-chip--terminal {
  border-top-right-radius: 7px;
  border-bottom-right-radius: 7px;
  font-weight: 800;
}

.result-chip--own {
  background-color: var(--bgf-accent);
}

.result-chip--other {
  background-color: #fd5407;
}

.result-chip--local {
  background-color: #67b031;
}

/* Blockworld results carry the blockworld identity yellow; dark text for
   contrast on the light background. */
.result-chip--world {
  background-color: var(--bgf-world-accent);
  color: #141414;
}

.result-chip--world + .result-chip--world {
  border-left-color: rgba(0, 0, 0, 0.35);
}

/* Inline completion: laid over the input, the typed part invisible (the
   input draws it) and the rest of the best match in gray (searchSuggest.js
   copies the input's font and padding). */
.search-ghost {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: pre;
  border: 0 solid transparent;
  pointer-events: none;
}

.search-ghost[hidden] {
  display: none;
}

.search-ghost-typed {
  flex: none;
  color: transparent;
}

/* A long completion ends in an ellipsis before the clear button. */
.search-ghost-rest {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--bgf-text-dim);
}

/* The search modal stays centered at a fixed height: a centered modal moves
   whenever its height changes, which moved the input and the results under
   the pointer. The lists take the room left and scroll inside it. */
#searchModal .search-modal-content {
  height: min(620px, calc(100vh - 2 * var(--bgf-space-4)));
}

#searchModal .modal-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#searchModal :is(#search-results, .blocksets-container) {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
}

/* Long names never widen the list (no sideways scroll): each chip may shrink
   and ends in an ellipsis; the row's tooltip has the full names. The time in
   history rows keeps its size. */
#searchModal :is(#search-results, .blocksets-container) {
  overflow-x: hidden;
}

#searchModal .result-chip {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 16px;
}

/* Owner and blockworld keep their size unless they pass 40% of the row: the
   blockset name gives way first. */
#searchModal .result-chip:not(.result-chip--terminal) {
  flex-shrink: 0;
  max-width: 40%;
}

/* One column that scrolls: wrapping would push the rows that do not fit into
   a second column cut off at the side. */
#searchModal :is(#search-results, #history-blocksets, #most-used-blocksets) {
  flex-wrap: nowrap;
}

#searchModal :is(#search-results, #history-blocksets, #most-used-blocksets) > * {
  flex-shrink: 0;
}

/* "Did you mean" fuzzy fallback under the empty-results message */
.search-didyoumean {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 2px 12px 10px;
}

.search-didyoumean-label {
  color: var(--bgf-text-dim);
  font-size: 12px;
  font-weight: 600;
}

.search-didyoumean-option {
  border: 1px solid var(--bgf-border);
  border-radius: 999px;
  background: var(--bgf-surface-2);
  color: var(--bgf-text);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
}

.search-didyoumean-option:hover,
.search-didyoumean-option:focus-visible {
  border-color: var(--bgf-accent);
  color: #fff;
}

/* Context bar above the search input: quiet links, identity color in the
   icon only (scoped-search pattern — nothing competes with the input). */
.search-context-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.search-context-label {
  color: var(--bgf-text-dim);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.context-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--bgf-text-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.context-link:hover {
  background: var(--bgf-surface-2);
  border-color: var(--bgf-border);
}

.context-link--world i {
  color: var(--bgf-world-accent);
}

.context-link--world:hover {
  color: var(--bgf-world-accent);
}

.context-link--profile {
  margin-left: auto;
}

.context-link--profile i {
  color: var(--bgf-accent);
}

.context-link--profile:hover {
  color: var(--bgf-accent-hover);
}

.result-row-meta {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  margin-left: 10px;
  padding: 0;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  color: rgba(255, 255, 255, 0.42) !important;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: none !important;
}

@media (max-width: 560px) {
  .result-row {
    flex-wrap: wrap;
    gap: 4px;
  }

  .result-chip,
  .result-chip:first-of-type,
  .result-chip:last-of-type {
    border-radius: 7px;
  }

  .result-chip + .result-chip {
    border-left: 0;
  }
}

/* Divider between filter groups in the search modal */
.filter-divider {
  display: inline-block;
  width: 1px;
  height: 18px;
  background-color: #555;
  margin: 0 6px;
  vertical-align: middle;
}

/* Status messages inside the results container */
.search-status {
  padding: 12px;
  color: #aaa;
  font-size: 13px;
  text-align: center;
  width: 100%;
}

.search-status-error {
  color: #e57373;
}

/* Search input + inline clear button */
.search-input-wrapper {
  position: relative;
}

.search-clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #888;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease, background 0.15s ease;
}

.search-clear-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.search-clear-btn[hidden] {
  display: none;
}

.search-clear-btn i {
  font-size: 12px;
}

/* Filter buttons (history / most used / scope) — clearer active vs inactive states */
.filter-btn {
  padding: 6px 14px;
  border: 1px solid transparent;
  border-radius: 4px;
  background-color: #3a3a3a;
  color: #d8d8d8;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.filter-btn:hover {
  background-color: #555;
  color: #fff;
}

.filter-btn:focus-visible {
  outline: var(--bgf-focus-ring);
  outline-offset: var(--bgf-focus-offset);
}

.active-filter,
.filter-btn.active-filter {
  background-color: #0072e6;
  color: #fff;
  border-color: #1a83ef;
  box-shadow: 0 0 0 1px rgba(0, 114, 230, 0.35);
}

.active-filter:hover,
.filter-btn.active-filter:hover {
  background-color: #1a83ef;
}

.crop-ask-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 10, 0.9);
  z-index: 9999;
}

.crop-ask-container {
  width: 80%;
  height: 70%;
  display: flex;
  background: #1e1e1e;
  border: 2px solid #b94aff;
  border-radius: 16px;
  overflow: hidden;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
}

.crop-ask-preview {
  flex: 1;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 2px solid #b94aff;
}

.crop-ask-chat {
  flex: 1.2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  color: white;
}

.crop-ask-input {
  width: 100%;
  min-height: 60px;
  resize: none;
  background: #252525;
  color: white;
  border: 1px solid #b94aff;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
}

.crop-ask-send {
  margin-top: 10px;
  padding: 10px 18px;
  background: #b94aff;
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  align-self: flex-end;
}

.crop-ask-send:hover {
  background: #9c3be5;
}
.text-renderer-host {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100vh;
  /* Clear the chrome bars, whatever their height (see .nbs-bar). */
  --text-host-gap: calc(var(--nbs-bar-h) + 10px);
  padding: var(--text-host-gap) 42px var(--text-host-gap);
  box-sizing: border-box;
  background:
    radial-gradient(circle at top left, rgba(28, 89, 184, 0.18), transparent 32%),
    radial-gradient(circle at bottom right, rgba(180, 90, 32, 0.14), transparent 28%),
    linear-gradient(180deg, #060606 0%, #111111 100%);
}

.navi-text-editor {
  height: calc(100vh - var(--text-host-gap) * 2);
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 34px 56px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: rgba(16, 16, 16, 0.9);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  overflow-y: auto;
  scrollbar-color: rgba(183, 108, 255, 0.56) rgba(255, 255, 255, 0.05);
  scrollbar-width: thin;
}

.text-renderer-host[data-theme="light"] .navi-text-editor {
  border: 1px solid rgba(27, 33, 45, 0.12);
  background: rgba(255, 252, 246, 0.9);
  box-shadow: 0 24px 80px rgba(34, 30, 23, 0.12);
  scrollbar-color: rgba(127, 43, 209, 0.48) rgba(15, 23, 42, 0.08);
}

.navi-text-editor::-webkit-scrollbar {
  width: 10px;
}

.navi-text-editor::-webkit-scrollbar-track {
  margin: 14px 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.navi-text-editor::-webkit-scrollbar-thumb {
  border: 2px solid rgba(16, 16, 16, 0.9);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(183, 108, 255, 0.68), rgba(183, 108, 255, 0.32));
}

.navi-text-editor::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(199, 139, 255, 0.86), rgba(183, 108, 255, 0.48));
}

.text-renderer-host[data-theme="light"] .navi-text-editor::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.07);
}

.text-renderer-host[data-theme="light"] .navi-text-editor::-webkit-scrollbar-thumb {
  border-color: rgba(255, 252, 246, 0.9);
  background: linear-gradient(180deg, rgba(127, 43, 209, 0.58), rgba(127, 43, 209, 0.28));
}

.navi-text-editor__surface {
  min-height: 100%;
}

.navi-text-editor__content {
  min-height: 100%;
  outline: none;
  color: rgba(255, 255, 255, 0.92);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 19px;
  line-height: 1.8;
}

.text-renderer-host[data-theme="light"] .navi-text-editor__content {
  color: #1f232b;
}

.navi-text-editor__content > *:first-child {
  margin-top: 0;
}

.navi-text-editor__content p {
  margin: 0 0 1.1em;
}

.navi-text-editor__content h2 {
  margin: 1.5em 0 0.7em;
  color: #ffffff;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.text-renderer-host[data-theme="light"] .navi-text-editor__content h2 {
  color: #152033;
}

.navi-text-editor__content ul,
.navi-text-editor__content ol {
  margin: 0 0 1.15em 1.4em;
  padding: 0;
}

.navi-text-editor__content blockquote {
  margin: 1.4em 0;
  padding-left: 1em;
  border-left: 3px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.68);
}

.text-renderer-host[data-theme="light"] .navi-text-editor__content blockquote {
  border-left: 3px solid rgba(21, 32, 51, 0.22);
  color: #465162;
}

.navi-text-editor__content a {
  color: #b76cff;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: background-color 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

.text-renderer-host[data-theme="light"] .navi-text-editor__content a {
  color: #7f2bd1;
}

.navi-text-editor__content a[href*="/naviblockset/"] {
  color: #38bdf8;
  text-decoration-color: rgba(56, 189, 248, 0.9);
}

.text-renderer-host[data-theme="light"] .navi-text-editor__content a[href*="/naviblockset/"] {
  color: #0277bd;
  text-decoration-color: rgba(2, 119, 189, 0.85);
}

.navi-text-editor__content a.text-link-opened {
  border-radius: 5px;
  background: rgba(183, 108, 255, 0.2);
  box-shadow: 0 0 0 4px rgba(183, 108, 255, 0.12);
  color: #e2c4ff;
}

.text-renderer-host[data-theme="light"] .navi-text-editor__content a.text-link-opened {
  background: rgba(127, 43, 209, 0.14);
  box-shadow: 0 0 0 4px rgba(127, 43, 209, 0.1);
  color: #6820b0;
}

.navi-text-editor__content a[href*="/naviblockset/"].text-link-opened {
  background: rgba(56, 189, 248, 0.18);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
}

.text-renderer-host[data-theme="light"] .navi-text-editor__content a[href*="/naviblockset/"].text-link-opened {
  background: rgba(2, 119, 189, 0.12);
  box-shadow: 0 0 0 4px rgba(2, 119, 189, 0.1);
  color: #015f96;
}

.navi-text-editor__content .is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  float: left;
  color: rgba(255, 255, 255, 0.3);
  pointer-events: none;
  height: 0;
}

.text-renderer-host[data-theme="light"] .navi-text-editor__content .is-editor-empty:first-child::before {
  color: rgba(31, 35, 43, 0.38);
}

#textEditorContextMenu {
  position: fixed;
  z-index: 1200;
  min-width: 190px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(16, 16, 16, 0.96);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

#textEditorContextMenu .context-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

#textEditorContextMenu .context-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

#textEditorContextMenu hr {
  margin: 4px 2px;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.text-selection-menu {
  position: fixed;
  z-index: 1210;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(16, 16, 16, 0.96);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.text-selection-menu__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.text-selection-menu__icon {
  width: 32px;
  padding: 0;
}

.text-selection-menu__item:hover,
.text-selection-menu__item:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  outline: none;
}

.text-selection-menu__item i {
  font-size: 12px;
}

.text-renderer-host[data-theme="light"] .text-selection-menu {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.16);
}

.text-renderer-host[data-theme="light"] .text-selection-menu__item {
  color: rgba(15, 23, 42, 0.82);
}

.text-renderer-host[data-theme="light"] .text-selection-menu__item:hover,
.text-renderer-host[data-theme="light"] .text-selection-menu__item:focus-visible {
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
}

.text-link-preview {
  position: fixed;
  z-index: 1214;
  align-items: center;
  gap: 8px;
  max-width: min(340px, calc(100vw - 24px));
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(16, 16, 16, 0.96);
  color: rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  line-height: 1.2;
  pointer-events: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.text-link-preview__hint {
  flex: 0 0 auto;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(183, 108, 255, 0.18);
  color: #d7b6ff;
  font-weight: 600;
}

.text-link-preview__url {
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.72);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-link-copy-popover {
  position: fixed;
  z-index: 1216;
  align-items: center;
  gap: 8px;
  max-width: min(360px, calc(100vw - 24px));
  padding: 6px 7px 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 11px;
  background: rgba(16, 16, 16, 0.97);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.36);
  font-family: 'Inter', sans-serif;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.text-link-copy-popover__url {
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-link-copy-popover__btn {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
}

.text-link-copy-popover__btn:hover,
.text-link-copy-popover__btn:focus-visible {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
  outline: none;
}

.text-link-modal {
  position: fixed;
  inset: 0;
  z-index: 1260;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.text-link-modal__panel {
  width: min(420px, calc(100vw - 48px));
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(14, 14, 14, 0.98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.46);
  font-family: 'Inter', sans-serif;
}

.text-link-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.text-link-modal__eyebrow {
  margin-bottom: 3px;
  color: #b76cff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.text-link-modal__title {
  color: rgba(255, 255, 255, 0.94);
  font-size: 15px;
  font-weight: 650;
}

.text-link-modal__close {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.66);
  cursor: pointer;
}

.text-link-modal__close:hover,
.text-link-modal__close:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  outline: none;
}

.text-link-modal__label {
  display: block;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 600;
}

.text-link-modal__input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.94);
  font-size: 13px;
  outline: none;
}

.text-link-modal__input:focus {
  border-color: var(--bgf-accent);
  box-shadow: 0 0 0 3px var(--bgf-accent-soft);
}

.text-link-modal__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.text-link-modal__spacer {
  flex: 1;
}

.text-link-modal__btn {
  height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.text-link-modal__btn:hover,
.text-link-modal__btn:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  outline: none;
}

.text-link-modal__btn--primary {
  border-color: var(--bgf-accent);
  background: var(--bgf-accent);
  color: var(--bgf-on-accent);
}

.text-link-modal__btn--primary:hover,
.text-link-modal__btn--primary:focus-visible {
  background: var(--bgf-accent-hover);
}

.text-link-modal__btn--danger {
  border-color: rgba(255, 111, 111, 0.28);
  background: rgba(255, 111, 111, 0.08);
  color: rgba(255, 198, 198, 0.9);
}

.text-link-modal__btn--danger:hover,
.text-link-modal__btn--danger:focus-visible {
  background: rgba(255, 111, 111, 0.16);
  color: #ffe0e0;
}

.text-link-modal__btn[hidden] {
  display: none;
}

.text-blockset-modal {
  position: fixed;
  inset: 0;
  z-index: 1265;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.text-blockset-modal__panel {
  width: min(520px, calc(100vw - 48px));
  max-height: min(560px, calc(100vh - 72px));
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 16px;
  background: rgba(12, 14, 16, 0.98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.46);
  font-family: 'Inter', sans-serif;
}

.text-blockset-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.text-blockset-modal__eyebrow {
  margin-bottom: 3px;
  color: #38bdf8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.text-blockset-modal__title {
  color: rgba(255, 255, 255, 0.94);
  font-size: 15px;
  font-weight: 650;
}

.text-blockset-modal__close {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.66);
  cursor: pointer;
}

.text-blockset-modal__close:hover,
.text-blockset-modal__close:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  outline: none;
}

.text-blockset-modal__label {
  display: block;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 600;
}

.text-blockset-modal__input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.94);
  font-size: 13px;
  outline: none;
}

.text-blockset-modal__input:focus {
  border-color: rgba(56, 189, 248, 0.74);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.14);
}

.text-blockset-modal__results {
  min-height: 92px;
  max-height: 340px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  padding-right: 2px;
}

.text-blockset-modal__status {
  padding: 18px 10px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  text-align: center;
}

.text-blockset-modal__status--error {
  color: rgba(255, 155, 155, 0.9);
}

.text-blockset-modal__result {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.9);
  text-align: left;
  cursor: pointer;
}

.text-blockset-modal__result:hover,
.text-blockset-modal__result:focus-visible {
  border-color: rgba(56, 189, 248, 0.38);
  background: rgba(56, 189, 248, 0.1);
  outline: none;
}

.text-blockset-modal__result-title {
  color: #7dd3fc;
  font-size: 13px;
  font-weight: 700;
}

.text-blockset-modal__result-meta {
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
}

.text-slash-menu {
  position: fixed;
  z-index: 1250;
  width: 260px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 13px;
  background: rgba(14, 14, 14, 0.97);
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.42);
  font-family: 'Inter', sans-serif;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.text-slash-menu__section {
  padding: 5px 7px 7px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.text-slash-menu__item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 0;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.09);
  color: rgba(255, 255, 255, 0.9);
  text-align: left;
  cursor: pointer;
}

.text-slash-menu__item:hover,
.text-slash-menu__item:focus-visible {
  background: rgba(56, 189, 248, 0.16);
  outline: none;
}

.text-slash-menu__icon {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
}

.text-slash-menu__title {
  display: block;
  color: rgba(255, 255, 255, 0.94);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.text-slash-menu__desc {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.54);
  font-size: 11px;
  line-height: 1.25;
}

.text-ai-review-panel {
  position: fixed;
  right: 48px;
  bottom: 52px;
  z-index: 1220;
  width: min(360px, calc(100vw - 72px));
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(12, 12, 12, 0.96);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.text-ai-review-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.9);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
}

.text-ai-review-panel__close {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.text-ai-review-panel__close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.text-ai-review-panel__content {
  max-height: 200px;
  overflow-y: auto;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.92);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 16px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.text-ai-review-panel__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.text-ai-review-panel__btn {
  height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.text-ai-review-panel__btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 900px) {
  .text-renderer-host {
    padding: var(--text-host-gap) 34px calc(var(--nbs-bar-h) * 2 + 12px);
  }

  .navi-text-editor {
    height: calc(100vh - var(--text-host-gap) - var(--nbs-bar-h) * 2 - 12px);
  }

  .navi-text-editor {
    padding: 24px 22px 40px;
  }
}

@media (max-width: 640px) {
  /* The format toolbar is its own row above the bottom bar on phones. */
  .text-renderer-host {
    --text-host-gap: calc(var(--nbs-bar-h) + 6px);
    /* Clear the frame's side edges, which overlay the page on phones too. */
    padding: var(--text-host-gap) calc(var(--nbs-edge-w) + 6px) calc(var(--nbs-bar-h) * 2 + 12px);
  }

  .navi-text-editor {
    height: calc(100vh - var(--text-host-gap) - var(--nbs-bar-h) * 2 - 12px);
    padding: 18px 16px 28px;
    border-radius: 16px;
  }

  .navi-text-editor__content {
    font-size: 17px;
  }
}
/* HTML report renderer */
.html-renderer-host {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 18%, rgba(48, 94, 72, 0.24), transparent 28%),
    radial-gradient(circle at 84% 12%, rgba(120, 84, 38, 0.18), transparent 30%),
    #050604;
  overflow: hidden;
}

.html-report-shell,
.html-frame-wrap {
  width: 100%;
  height: 100%;
}

.html-frame-wrap {
  position: relative;
  padding: 0;
  box-sizing: border-box;
}

.html-frame-wrap--fit {
  overflow: hidden;
}

.html-iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.html-import-ui,
.html-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 56px;
  box-sizing: border-box;
  color: #f5efe3;
}

.html-import-ui__panel,
.html-empty-state {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 26px;
  background: rgba(10, 13, 10, 0.86);
  box-shadow: 0 24px 88px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(18px);
}

.html-import-ui__panel {
  display: grid;
  gap: 16px;
  width: min(920px, 100%);
  padding: 28px;
}

.html-import-ui__eyebrow,
.html-empty-state__eyebrow {
  color: #dfb86b;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.html-import-ui__title,
.html-empty-state__title {
  margin: 0;
  color: #fff8ea;
  font-family: 'Inter', sans-serif;
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 700;
  letter-spacing: -0.04em;
}

.html-import-ui__copy,
.html-empty-state__copy {
  max-width: 680px;
  margin: 0;
  color: rgba(245, 239, 227, 0.72);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

.html-import-ui__textarea {
  width: 100%;
  min-height: 360px;
  resize: vertical;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 18px;
  color: #f8f2e8;
  background: rgba(0, 0, 0, 0.42);
  font-family: 'IBM Plex Sans', monospace;
  font-size: 13px;
  line-height: 1.5;
  outline: none;
}

.html-import-ui__textarea:focus {
  border-color: rgba(223, 184, 107, 0.75);
  box-shadow: 0 0 0 3px rgba(223, 184, 107, 0.14);
}

.html-import-ui__dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  border: 1px dashed rgba(223, 184, 107, 0.5);
  border-radius: 18px;
  color: rgba(245, 239, 227, 0.78);
  background: rgba(223, 184, 107, 0.06);
  cursor: pointer;
}

.html-import-ui__file {
  display: none;
}

.html-import-ui__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.html-import-ui__button {
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  color: #15120b;
  background: #dfb86b;
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 700;
}

.html-import-ui__button--secondary {
  color: #f5efe3;
  background: rgba(255, 255, 255, 0.1);
}

.html-import-ui__button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.html-empty-state {
  flex-direction: column;
  align-items: flex-start;
  width: min(620px, calc(100% - 48px));
  height: auto;
}

@media (max-width: 720px) {
  .html-frame-wrap {
    padding: 0;
  }

  .html-iframe {
    border-radius: 0;
  }

  .html-import-ui,
  .html-empty-state {
    padding: 42px 18px;
  }

  .html-import-ui__panel {
    padding: 20px;
  }

  .html-import-ui__textarea {
    min-height: 300px;
  }
}


/* ══ The frame ═══════════════════════════════════════════════════════════════
   NaviBlockSet is a frame around a result, like a cockpit around its view:
   - the four borders have one thickness (--nbs-frame), top, bottom and sides;
   - every control lives in those borders and fits inside them -- nothing
     sticks out of the frame; the centre is only the blockset (canvas, text,
     idea map or HTML report);
   - bar buttons are icons; their name is the tooltip and the accessible
     label. Menus opened from the frame (More, Share, Add on phones) list
     options with words.
   The four navigation buttons (#btn-up, #btn-down, #btn-left, #btn-right)
   keep their place, look and behavior. DESIGN.md, "NaviBlockSet frame". */
:root {
  --nbs-frame: 30px;
  --nbs-bar-h: var(--nbs-frame);
  --nbs-edge-w: var(--nbs-frame);
  --nbs-control-h: 24px;
  --bgf-toast-bottom: calc(var(--nbs-bar-h) + var(--bgf-space-3));
}

.nbs-bar {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: var(--bgf-space-2);
  height: var(--nbs-bar-h);
  padding: 0 calc(var(--nbs-edge-w) + var(--bgf-space-1));
  box-sizing: border-box;
  color: var(--bgf-text);
  font-family: var(--bgf-font);
  font-size: var(--bgf-text-sm);
}

.nbs-bar--top {
  top: 0;
}

.nbs-bar--bottom {
  bottom: 0;
}

.nbs-edge {
  position: fixed;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--nbs-edge-w);
  height: 100vh;
}

.nbs-edge--left {
  left: 0;
}

.nbs-edge--right {
  right: 0;
}

.nbs-slot,
.nbs-slot--end,
.nbs-title-wrap {
  display: flex;
  align-items: center;
  gap: var(--bgf-space-2);
  min-width: 0;
}

.nbs-slot--start {
  justify-self: start;
  max-width: 100%; /* never wider than its half of the bar */
}

.nbs-slot--frame {
  justify-self: center;
}

.nbs-slot--end {
  justify-self: end;
  flex-shrink: 0;
}

.nbs-slot--right {
  justify-content: space-between;
}

.nbs-title-wrap {
  flex: 1;
}

/* Frame buttons: the four border icons are identity and are never restyled
   (same SVGs, same .button-icon / .button-icon--up--down sizing). The only
   addition is a focus ring, drawn outside the image and only for keyboard use. */
.nbs-frame-btn:focus-visible {
  outline: var(--bgf-focus-ring);
  outline-offset: var(--bgf-focus-offset);
}

/* Title */
.nbs-title {
  flex: 1;
  min-width: 80px;
  max-width: 420px;
  height: var(--nbs-control-h);
  padding: 0 var(--bgf-space-2);
  box-sizing: border-box;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--bgf-radius-sm);
  color: var(--bgf-text);
  font: 600 var(--bgf-text-md) var(--bgf-font);
  text-overflow: ellipsis;
  outline: none;
  transition: border-color var(--bgf-duration);
}

.nbs-title:not([readonly]):hover {
  border-color: var(--bgf-border);
}

.nbs-title:not([readonly]):focus {
  border-color: var(--bgf-accent);
  background: var(--bgf-surface-2);
}

.nbs-title.name-saved {
  border-color: var(--bgf-success);
}

/* Buttons: one component for every chrome control */
.nbs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--bgf-space-2);
  flex-shrink: 0;
  min-width: var(--nbs-control-h);
  height: var(--nbs-control-h);
  padding: 0 var(--bgf-space-3);
  box-sizing: border-box;
  background: var(--bgf-surface-2);
  border: 1px solid var(--bgf-border);
  border-radius: var(--bgf-radius-sm);
  color: var(--bgf-text);
  font: 500 var(--bgf-text-sm) var(--bgf-font);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--bgf-duration), border-color var(--bgf-duration);
}

.nbs-btn:hover {
  background: var(--bgf-border);
  border-color: var(--bgf-border-strong);
  color: var(--bgf-text);
}

.nbs-btn--icon {
  width: var(--nbs-control-h);
  padding: 0;
}

.nbs-btn--danger i {
  color: var(--bgf-danger);
}

.nbs-btn--danger:hover {
  background: var(--bgf-danger-soft);
  border-color: var(--bgf-danger);
}

.nbs-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.nbs-btn[hidden] {
  display: none;
}

.nbs-btn:focus-visible,
.text-toolbar-btn:focus-visible {
  outline: var(--bgf-focus-ring);
  outline-offset: var(--bgf-focus-offset);
}

.nbs-btn.is-active,
.navigation-map-toggle.is-active {
  border-color: var(--bgf-accent);
  color: var(--bgf-accent);
}

/* Switches (Edit, Public access) */
.nbs-switch.form-check.form-switch {
  display: flex;
  align-items: center;
  gap: var(--bgf-space-2);
  min-height: var(--nbs-control-h);
  margin: 0;
  padding: 0;
}

.nbs-switch.form-switch .form-check-input {
  float: none;
  width: 36px;
  height: 20px;
  margin: 0;
  background-color: var(--bgf-surface-2);
  border-color: var(--bgf-border-strong);
  cursor: pointer;
}

.nbs-switch.form-switch .form-check-input:checked {
  background-color: var(--bgf-accent);
  border-color: var(--bgf-accent);
}

.nbs-switch.form-switch .form-check-input:focus {
  box-shadow: none;
}

.nbs-switch.form-switch .form-check-input:focus-visible {
  outline: var(--bgf-focus-ring);
  outline-offset: var(--bgf-focus-offset);
}

.nbs-switch .form-check-label {
  margin: 0;
  line-height: 1;
  color: var(--bgf-text);
  font-size: var(--bgf-text-sm);
  font-weight: 600;
  cursor: pointer;
}

.nbs-switch--row {
  justify-content: space-between;
  padding: 0 var(--bgf-space-2);
}

/* Popovers: Share, "More", Add (static/js/ui/disclosure.js) */
.nbs-share {
  position: relative;
}

.nbs-popover {
  position: fixed;
  z-index: 3100;
  display: none;
  flex-direction: column;
  align-items: stretch;
  gap: var(--bgf-space-1);
  min-width: 220px;
  padding: var(--bgf-space-2);
  background: var(--bgf-surface);
  border: 1px solid var(--bgf-border-strong);
  border-radius: var(--bgf-radius);
  box-shadow: var(--bgf-shadow);
}

.nbs-popover.is-open {
  display: flex;
}

#nbsSharePanel,
#nbsTopTools {
  top: calc(var(--nbs-bar-h) + var(--bgf-space-1));
  right: calc(var(--nbs-edge-w) + var(--bgf-space-1));
}

.nbs-popover--up {
  bottom: calc(var(--nbs-bar-h) + var(--bgf-space-1));
  right: calc(var(--nbs-edge-w) + var(--bgf-space-1));
}

.nbs-popover .nbs-btn {
  justify-content: flex-start;
  width: 100%;
}

.nbs-menu__title {
  margin: 0;
  padding: var(--bgf-space-1) var(--bgf-space-2) var(--bgf-space-2);
  border-bottom: 1px solid var(--bgf-border);
  color: var(--bgf-text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.nbs-menu__heading {
  margin: var(--bgf-space-2) var(--bgf-space-2) 0;
  color: var(--bgf-text-muted);
  font-size: var(--bgf-text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nbs-menu__heading:first-child {
  margin-top: 0;
}

/* The save status gives way to the title: icon only below 1200px (the full
   text stays in its tooltip and is still announced). */
.nbs-title-wrap .bgf-save-status {
  flex-shrink: 0;
}

@media (max-width: 1200px) {
  .nbs-title-wrap .bgf-save-status__text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
}

/* Viewing shows only what viewing needs: Add text and Add button appear
   while Edit is on (main.js sets body.nbs-editing). */
body:not(.nbs-editing) :is(#nbsAddTools, #nbsAddButton) {
  display: none !important;
}

/* Bar buttons are icons that fit the border; words stay for screen readers
   (visually hidden) and the tooltip. Menus opened from the bar show them. */
.nbs-bar .nbs-btn {
  width: var(--nbs-control-h);
  padding: 0;
  justify-content: center;
}

.nbs-bar .nbs-btn > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Menus float over the result only while open, so they keep full-size rows */
.nbs-bar .nbs-popover .nbs-btn {
  width: 100%;
  height: var(--bgf-control-h);
  padding: 0 var(--bgf-space-3);
  justify-content: flex-start;
}

.nbs-bar .nbs-popover .nbs-btn > span {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: none;
}

/* Copies of a link: in the bar on wide screens, inside "More" on phones */
.nbs-narrow,
.nbs-narrow-add {
  display: none;
}

/* The top "More" only holds those phone copies (title, Profile, Help), so on
   wide screens it would open empty: it shows on phones only. */
.nbs-more--phone-only {
  display: none;
}

/* Add text / Add button sit inline; on phones they collapse into "+" */
.nbs-add {
  display: flex;
  align-items: center;
  gap: var(--bgf-space-2);
}

/* Canvas selection bar: tools for the selected element */
.nbs-selection,
.nbs-selection__group {
  display: flex;
  align-items: center;
  gap: var(--bgf-space-1);
}

.nbs-selection {
  margin-left: var(--bgf-space-2);
}

/* Element tools and the text editor toolbar stay inside the bottom border's
   start slot: when the slot is narrower than they are, they shrink into a
   strip that scrolls sideways instead of growing out of the frame. */
.nbs-slot > .nbs-btn {
  flex-shrink: 0;
}

.nbs-selection,
#textEditorToolbar {
  flex: 0 1 auto;
  min-width: 0;
  padding-block: 2px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.nbs-selection > *,
#textEditorToolbar > * {
  flex-shrink: 0;
}

.text-toolbar-btn,
.text-toolbar-control,
.text-toolbar-color {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--nbs-control-h);
  height: var(--nbs-control-h);
  padding: 0 var(--bgf-space-2);
  box-sizing: border-box;
  background: var(--bgf-surface-2);
  border: 1px solid var(--bgf-border);
  border-radius: var(--bgf-radius-sm);
  color: var(--bgf-text);
  font: 500 var(--bgf-text-sm) var(--bgf-font);
  cursor: pointer;
  transition: background-color var(--bgf-duration), border-color var(--bgf-duration);
}

.text-toolbar-color {
  width: var(--nbs-control-h);
  padding: var(--bgf-space-1);
}

.text-toolbar-btn:hover {
  background: var(--bgf-border);
  border-color: var(--bgf-border-strong);
}

.text-toolbar-btn.active,
.text-toolbar-btn.is-active {
  background: var(--bgf-accent);
  border-color: var(--bgf-accent);
  color: var(--bgf-on-accent);
}

/* QR of the public link in the Share panel (features/share/publicLinkQr.js) */
.nbs-share-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--bgf-space-2);
  padding: var(--bgf-space-2);
}

.nbs-share-qr[hidden] {
  display: none;
}

.nbs-share-qr canvas {
  display: block;
  border-radius: var(--bgf-radius-sm);
  image-rendering: pixelated;
}

.nbs-share-qr__url {
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--bgf-text-muted);
  font-size: var(--bgf-text-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* HTML blockset zoom (features/html/htmlZoom.js): - / percentage / + */
.nbs-html-zoom {
  display: inline-flex;
  align-items: center;
  gap: var(--bgf-space-1);
}

.nbs-html-zoom[hidden] {
  display: none;
}

.nbs-bar .nbs-btn.nbs-html-zoom__level {
  width: auto;
  min-width: 44px;
  padding: 0 var(--bgf-space-1);
  font-size: var(--bgf-text-xs);
  font-variant-numeric: tabular-nums;
}

/* HTML blockset file drop (features/html/htmlFileDrop.js): the import panel
   while a file is dragged over it, the loaded file line, and the layer that
   covers the report so a drop replaces it. */
#container.html-renderer-host .html-import-ui--dragging .html-import-ui__dropzone {
  border-style: solid;
  border-color: var(--bgf-accent);
  color: var(--bgf-text);
  background: var(--bgf-accent-soft);
}

#container.html-renderer-host .html-import-ui__file-info {
  margin: 0;
  color: var(--bgf-text-muted);
  font-size: var(--bgf-text-sm);
}

#container.html-renderer-host .html-import-ui__file-info[hidden],
.html-drop-layer[hidden] {
  display: none;
}

.html-drop-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--bgf-space-4);
  background: var(--bgf-overlay);
}

.html-drop-layer__panel {
  display: grid;
  justify-items: center;
  gap: var(--bgf-space-2);
  max-width: 420px;
  padding: var(--bgf-space-6);
  border: 2px dashed var(--bgf-border-strong);
  border-radius: var(--bgf-radius);
  color: var(--bgf-text);
  background: var(--bgf-surface);
  font-family: var(--bgf-font);
  text-align: center;
  pointer-events: none;
}

.html-drop-layer--over .html-drop-layer__panel {
  border-color: var(--bgf-accent);
  background: var(--bgf-surface-2);
}

.html-drop-layer__panel .fa-file-arrow-up {
  color: var(--bgf-accent);
  font-size: 28px;
}

.html-drop-layer__title {
  font-size: var(--bgf-text-md);
  font-weight: 600;
}

.html-drop-layer__hint {
  color: var(--bgf-text-muted);
  font-size: var(--bgf-text-sm);
}

/* Presenter (features/present/): its palette takes the selection bar's place
   while presenting, and the edit tools step aside. Ink colors are user
   content and arrive as --swatch from caps.drawing. */
.nbs-present[hidden] {
  display: none !important;
}

body.nbs-presenting :is(#nbsSelectionBar, #nbsAddTools, #nbsAddButton, #nbsBottomMore, #textEditorToolbar) {
  display: none !important;
}

.nbs-popover--up-start {
  bottom: calc(var(--nbs-bar-h) + var(--bgf-space-1));
  left: calc(var(--nbs-edge-w) + var(--bgf-space-1));
}

#presentStylePanel {
  min-width: 0;
}

/* Each inking tool carries its own color as a bar under its icon */
.nbs-present .has-ink {
  position: relative;
}

.nbs-present .has-ink::after {
  content: "";
  position: absolute;
  right: 5px;
  bottom: 2px;
  left: 5px;
  height: 3px;
  background: var(--tool-ink);
  border-radius: 2px;
}

/* On the accent background of the tool in use, a light edge keeps a blue ink visible */
.nbs-present .has-ink.is-active::after {
  box-shadow: 0 0 0 1px var(--bgf-on-accent);
}

.nbs-present-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bgf-space-2);
  padding: var(--bgf-space-1) var(--bgf-space-2);
}

.nbs-swatch {
  display: inline-block;
  width: 24px;
  height: 24px;
  padding: 0;
  background: var(--swatch);
  border: 2px solid var(--bgf-border-strong);
  border-radius: 50%;
  cursor: pointer;
}

.nbs-swatch--current {
  width: 16px;
  height: 16px;
  border-width: 1px;
  cursor: inherit;
}

.nbs-swatch.is-active {
  outline: 2px solid var(--bgf-accent);
  outline-offset: 2px;
}

.nbs-size-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--bgf-control-h);
  height: var(--bgf-control-h);
  padding: 0;
  background: var(--bgf-surface-2);
  border: 1px solid var(--bgf-border);
  border-radius: var(--bgf-radius-sm);
  cursor: pointer;
}

.nbs-size-dot::before {
  content: "";
  width: var(--dot);
  height: var(--dot);
  background: var(--bgf-text);
  border-radius: 50%;
}

.nbs-size-dot.is-active {
  border-color: var(--bgf-accent);
}

.nbs-swatch:focus-visible,
.nbs-size-dot:focus-visible {
  outline: var(--bgf-focus-ring);
  outline-offset: var(--bgf-focus-offset);
}

body.nbs-presenting .nbs-presenter-surface {
  cursor: crosshair;
}

body.nbs-presenting:is([data-presenter-tool="laser"], [data-presenter-tool="spotlight"], [data-presenter-tool="eraser"]) .nbs-presenter-surface {
  cursor: none;
}

body.nbs-presenting[data-presenter-tool="text"] .nbs-presenter-surface {
  cursor: text;
}

/* Over a canvas button, whatever the tool: it opens with a double click */
body.nbs-presenting.nbs-presenter-over-button .nbs-presenter-surface {
  cursor: pointer;
}

/* Phones: while presenting, Find and Map give their room to the palette */
@media (max-width: 640px) {
  body.nbs-presenting :is(#searchButton, #navigationMapSlot) {
    display: none !important;
  }
}

/* The drawing layer laid over documents (text, HTML) while presenting,
   inside the four frame borders (overlayPresenterSurface.js) */
.nbs-presenter-overlay {
  position: fixed;
  /* Above the document (1), below the frame bars (3) and the menus they open */
  z-index: 2;
  touch-action: none;
}

/* Space held: the pointer reaches the document underneath */
.nbs-presenter-overlay.is-passing-through {
  pointer-events: none;
}

/* Ctrl+Q while presenting: the colors and sizes of the tool in use, in the
   middle of the screen (presenterQuickPalette.js) */
.nbs-quick-palette {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 3100;
  display: flex;
  flex-direction: column;
  gap: var(--bgf-space-2);
  max-width: calc(100vw - 2 * var(--bgf-space-4));
  padding: var(--bgf-space-3);
  background: var(--bgf-surface);
  border: 1px solid var(--bgf-border-strong);
  border-radius: var(--bgf-radius);
  box-shadow: var(--bgf-shadow);
  transform: translate(-50%, -50%);
}

.nbs-quick-palette__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--bgf-space-2);
}

/* A text under the pointer while presenting: move it; once picked, resize it
   from a corner (scale) or a side (width) */
body.nbs-presenting[data-presenter-text-hover="move"] .nbs-presenter-surface {
  cursor: move;
}

body.nbs-presenting:is([data-presenter-text-hover="nw"], [data-presenter-text-hover="se"]) .nbs-presenter-surface {
  cursor: nwse-resize;
}

body.nbs-presenting:is([data-presenter-text-hover="ne"], [data-presenter-text-hover="sw"]) .nbs-presenter-surface {
  cursor: nesw-resize;
}

body.nbs-presenting:is([data-presenter-text-hover="e"], [data-presenter-text-hover="w"]) .nbs-presenter-surface {
  cursor: ew-resize;
}

/* A canvas text being edited (Edit on): no box either, as in the presenter;
   size, color and position come inline from the text (servTextNodes.js) */
.nbs-canvas-text-editor {
  margin: 0;
  overflow: hidden;
  background: transparent;
  border: none;
  outline: none;
  box-shadow: none;
  resize: none;
}

/* The text typed while presenting, before it lands on the canvas: only the
   caret and the letters, as in Excalidraw (the caret is the focus cue) */
.nbs-present-text {
  position: fixed;
  z-index: 3050;
  margin: 0;
  padding: 0;
  overflow: hidden;
  white-space: pre;
  background: transparent;
  border: none;
  outline: none;
  caret-color: currentColor;
  font-family: var(--bgf-font);
  font-weight: 600;
  line-height: 1.2;
  resize: none;
}

/* ── Narrow screens: secondary items live in "More" ──────────────────────── */
@media (max-width: 900px) {
  .nbs-wide {
    display: none !important;
  }

  .nbs-narrow {
    display: inline-flex;
  }

  .nbs-more--phone-only {
    display: inline-flex;
  }

  p.nbs-narrow {
    display: block;
  }

  .nbs-title {
    max-width: none;
  }

  .nbs-selection:not(.is-active) {
    display: none;
  }
}

/* ── Phones: touch-size controls; the title moves into "More" ─────────────── */
@media (max-width: 640px) {
  .nbs-bar {
    gap: var(--bgf-space-1);
    padding: 0 var(--nbs-edge-w);
  }

  .nbs-slot,
  .nbs-slot--end {
    gap: var(--bgf-space-1);
  }

  .nbs-title-wrap .nbs-title {
    display: none;
  }

  .nbs-switch .form-check-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .nbs-switch.form-check.form-switch {
    justify-content: center;
    min-width: var(--nbs-control-h);
  }

  .nbs-switch--row .form-check-label {
    position: static;
    width: auto;
    height: auto;
    clip-path: none;
  }

  .nbs-narrow-add {
    display: inline-flex;
  }

  .nbs-add {
    position: fixed;
    z-index: 3100;
    bottom: calc(var(--nbs-bar-h) + var(--bgf-space-1));
    right: calc(var(--nbs-edge-w) + var(--bgf-space-1));
    display: none;
    flex-direction: column;
    align-items: stretch;
    min-width: 200px;
    padding: var(--bgf-space-2);
    background: var(--bgf-surface);
    border: 1px solid var(--bgf-border-strong);
    border-radius: var(--bgf-radius);
    box-shadow: var(--bgf-shadow);
  }

  .nbs-add.is-open {
    display: flex;
  }

  .nbs-add .nbs-btn {
    justify-content: flex-start;
    width: 100%;
    height: var(--bgf-control-h);
    padding: 0 var(--bgf-space-3);
  }

  .nbs-add .nbs-btn > span {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
  }
}
