/*
 * © 2025 Webtool.es . All rights reserved.
 *   This file is subject to the terms of the license located in /LICENSE.txt
 *   Authorized use exclusively on the domain Webtool.es and its subdomains.
 */
/* ===== Base (light/dark) ================================================== */
body {
  margin: 0;
  font-family: sans-serif;
  background: #f9f9f9;
  color: #333;
  /* los SVGs usan filtro por tema a través de --icon-filter */
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Modo compacto de pestañas: oculta el texto y reduce paddings cuando no cabe */
.tabs--compact .tab { gap: 0; padding: 8px; }
.tabs--compact .tab__label { display: none; }

/* Botón “⋯” para pestañas ocultas */
.tabs__more-btn{ display:none; }
.tabs__more-btn[hidden]{ display:none !important; } /* controlado por JS */
.tabs__more-btn{
  border-right: 1px solid #aaa;
}
.dark-theme .tabs__more-btn{
  border-right-color:#555;
}
.dark-theme {
  background: #1e1e1e;
  color: #eee;
}

/* ===== Tabs =============================================================== */
.tabs {
  display: flex;
  align-items: center;
  background: #ddd;
  border-bottom: 1px solid #aaa;
  gap: 0;
}
.dark-theme .tabs {
  background: #333;
  border-bottom: 1px solid #555;
}
.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: none;
  background: white;
  cursor: pointer;
  border-right: 1px solid #aaa;
}
.tab.active { background: lightblue; }
.dark-theme .tab {
  background: #555;
  color: #fff;
}
.dark-theme .tab.active {
  background: #2676c2;
  color: #fff;
}
/* Contenedor derecha (idioma, herramientas, tema) */
.tabs__right{
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 6px;
}
/* Si el widget de herramientas se inserta (por error) dentro de .tabs__right,
   evita que cuente como ítem flex y añada un hueco extra por el gap */
.tabs__right > .menu-wrap{
  display: contents;
}

/* Iconos y etiqueta en las pestañas */
.tab__iconimg{
  width:18px;
  height:18px;
  display:block;
  filter: var(--icon-filter);
  user-select:none;
  pointer-events:none;
}
.tab__label{
  line-height:1;
  font-weight:600;
  font-size:0.95rem;
}
/* Botones de icono (derecha) */
.iconbtn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--menu-border);
  border-radius: 8px;
  background: var(--menu-bg);
  color: var(--menu-fg);
  cursor: pointer;
}
.iconbtn:hover{ filter: brightness(.98); }
.iconbtn:active{ transform: translateY(1px); }
.iconbtn__img{
  width:18px; height:18px; display:block; filter:var(--icon-filter);
}

/* ===== Toolbar (scroll horizontal + overflow “⋯”) ========================= */
.toolbar {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;                 /* una línea */
  overflow-x: auto;
  overflow-y: visible;               /* que no recorte vertical */
  -webkit-overflow-scrolling: touch;
  padding: 6px 8px;

  /* variables (light) */
  --toolbar-bg: #f8fafc;
  --toolbar-border: #cbd5e1;

  background: var(--toolbar-bg);
  border-bottom: 1px solid var(--toolbar-border);
}

.dark-theme .toolbar {
  /* variables (dark) */
  --toolbar-bg: #0f172a;
  --toolbar-border: #1e293b;
}

/* Fades (cuando hay overflow) */
.toolbar.scrollable::before,
.toolbar.scrollable::after {
  content: "";
  position: sticky;
  top: 0;
  width: 22px;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  display: none;
}
.toolbar.scrollable::before {
  left: 0;
  background: linear-gradient(to right, var(--toolbar-bg), transparent);
}
.toolbar.scrollable::after {
  margin-left: auto;
  background: linear-gradient(to left, var(--toolbar-bg), transparent);
}
.toolbar.has-left-fade::before { display: block; }
.toolbar.has-right-fade::after { display: block; }

/* Paleta para menús flotantes (reutilizada por ⋯) */
:root {
  /* Tabla */
  --tbl-bg: #ffffff;
  --tbl-text: #334155;         /* slate-700 */
  --tbl-muted: #64748b;        /* slate-500 */
  --tbl-border: #cbd5e1;       /* slate-300 */
  --tbl-header-bg: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  --tbl-header-text: #0f172a;  /* slate-900 */
  --tbl-row-odd: #f8fafc;
  --tbl-row-hover: #e2e8f0;
  --tbl-accent: #1d4ed8;       /* blue-700 */
  --tbl-radius: 12px;

  /* Resaltado de búsquedas en tabla */
  --tbl-match-hit-bg: #fff6bf;
  --tbl-match-hit-border: #f59e0b;
  --tbl-match-current-bg: #bfdbfe;
  --tbl-match-current-border: #2563eb;
  --tbl-match-text: #111827;
  /* filtro por defecto para iconos (light) */
  --icon-filter: none;

  /* Menú overflow (⋯) */
  --menu-bg: #ffffff;
  --menu-fg: #0f172a;
  --menu-border: #e5e7eb;
  --menu-item-hover: #f3f4f6;
  --menu-sep: #e5e7eb;
}
.dark-theme {
  /* Tabla */
  --tbl-bg: #0f172a;           /* slate-900 */
  --tbl-text: #cbd5e1;         /* slate-300 */
  --tbl-muted: #94a3b8;        /* slate-400 */
  --tbl-border: #334155;       /* slate-700 */
  --tbl-header-bg: linear-gradient(180deg, #111827 0%, #0f172a 100%);
  --tbl-header-text: #e5e7eb;  /* slate-200 */
  --tbl-row-odd: rgba(148,163,184,0.06);
  --tbl-row-hover: rgba(148,163,184,0.12);
  --tbl-accent: #93c5fd;       /* blue-300 */

  /* Resaltado de búsquedas */
  --tbl-match-hit-bg: rgba(245, 158, 11, 0.22);
  --tbl-match-hit-border: rgba(251, 191, 36, 0.9);
  --tbl-match-current-bg: rgba(59, 130, 246, 0.30);
  --tbl-match-current-border: rgba(96, 165, 250, 1);
  --tbl-match-text: #e5e7eb;

  /* filtro para iconos en dark: invertir a claro */
  --icon-filter: invert(1) brightness(1.1) contrast(1.05);
  /* Menú ⋯ */
  --menu-bg: #111827;
  --menu-fg: #e5e7eb;
  --menu-border: #374151;
  --menu-item-hover: #1f2937;
  --menu-sep: #374151;
}
/* Menú genérico desplegable (reutiliza paleta de menú) */
.dropdown-menu{
  position: fixed;
  z-index: 9999;
  min-width: 200px;
  max-height: 60vh;
  overflow: auto;
  background: var(--menu-bg);
  color: var(--menu-fg);
  border: 1px solid var(--menu-border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.dropdown-item{
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: 0;
  text-align: left;
  color: inherit;
  cursor: pointer;
}
.dropdown-item:hover{ background: var(--menu-item-hover); }
.dropdown-item[aria-current="true"]{
  font-weight: 700;
  outline: 2px solid var(--tbl-accent);
  outline-offset: -2px;
}

/* Menú "Más" de pestañas: cada opción con icono + texto */
#tabsMoreMenu .dropdown-item{
  display:flex;
  align-items:center;
  gap:8px;
}
#tabsMoreMenu .dropdown-item img{
  width:16px;height:16px;display:block;
  filter:var(--icon-filter);
}

/* Botón “⋯” con contraste y estados */
.toolbar__more-btn {
  position: sticky; right: 0;
  flex: 0 0 auto;
  z-index: 3;
  padding: 6px 12px;
  border-radius: 10px;
  line-height: 1;
  cursor: pointer;
  border: 1px solid var(--menu-border);
  background: var(--menu-bg);
  color: var(--menu-fg);
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.toolbar__more-btn:hover { filter: brightness(0.98); }
.toolbar__more-btn:active { transform: translateY(1px); }
.toolbar__more-btn[hidden] { display: none !important; }

/* Menú flotante siempre por encima y con buen contraste */
.toolbar__more-menu {
  position: fixed;           /* evita que lo corte el overflow */
  z-index: 9999;
  min-width: 200px;
  max-height: 60vh;
  overflow: auto;
  background: var(--menu-bg);
  color: var(--menu-fg);
  border: 1px solid var(--menu-border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  display: none;
}
.toolbar__more-menu.open { display: block; }
.toolbar__more-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: 0;
  color: var(--menu-fg);
  text-align: left;
  cursor: pointer;
}
.toolbar__more-item img{
  width:18px;
  height:18px;
  display:block;
  filter: var(--icon-filter);
}
.toolbar__more-item .label{
  flex:1;
}
.toolbar__more-item:hover { background: var(--menu-item-hover); }
.toolbar__more-sep {
  height: 1px;
  background: var(--menu-sep);
  margin: 6px 8px;
}

/* Inputs/botones dentro de toolbar (heredado) */
.toolbar button { padding: 4px 8px; cursor: pointer; }
.toolbar input[type="text"] { padding: 4px; flex: 1; min-width: 120px; }
/* ===== Botones “icono + etiqueta” dentro de la toolbar =================== */
.toolbar .tool-btn{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:6px;
  min-width:92px;
  height:56px;
  padding:6px 8px;
  border-radius:12px;
  border:1px solid var(--menu-border);
  background:var(--menu-bg);
  color:var(--menu-fg);
  box-shadow:0 1px 2px rgba(0,0,0,.06);
  cursor:pointer;
  user-select:none;
  text-align:center;
  white-space:nowrap;
  transition:transform .05s ease, filter .12s ease, background .12s ease, border-color .12s ease;
}
.toolbar .tool-btn:hover{
  /* Light theme: hover más oscuro y evidente */
  background:#e5e7eb;           /* slate-200 */
  border-color:#d1d5db;         /* slate-300 */
  box-shadow:0 0 0 1px rgba(0,0,0,.04) inset, 0 2px 6px rgba(0,0,0,.06);
}
.dark-theme .toolbar .tool-btn:hover{
  /* Dark theme: aclarar el botón para que destaque */
  background:#1f2937;           /* slate-800 */
  border-color:#475569;         /* slate-600 */
  box-shadow:0 0 0 1px rgba(255,255,255,.06) inset, 0 2px 6px rgba(0,0,0,.35);
}
.toolbar .tool-btn:active{ transform:translateY(1px); }
.toolbar .tool-btn:focus-visible{
  outline:2px solid var(--tbl-accent);
  outline-offset:2px;
}
.toolbar .tool-btn__iconimg{
  width: 20px;
  height: 20px;
  display: block;
  filter: var(--icon-filter);
  user-select: none;
  pointer-events: none;
  margin: 0;
  padding: 0;
  vertical-align: middle;
}
.toolbar .tool-btn__icon{
  font-size:26px;
  line-height:1;
}
.toolbar .tool-btn__label{
  font-size:11px;
  line-height:1.15;
}


/* ===== Tabs content ======================================================= */
.tab-content {
  display: none;
  flex: 1;
  overflow: hidden;
}
.tab-content.active {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ===== Editor / CodeMirror =============================================== */
#editorContainer { flex: 1; overflow: auto; }
.CodeMirror {
  height: 100% !important;
  font-size: 14px;
  line-height: 1.4em;
  padding: 0;
}
/* Resaltado temporal de la línea en el editor */
.CodeMirror .cm-highlighted-line {
  background-color: rgba(255, 255, 0, 0.4);
  transition: background-color 0.3s ease;
}

/* ===== Zona gráfica/Árbol/Inspector ====================================== */
.tree-area {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* Splitter */
#splitter { width: 5px; background: #ccc; cursor: col-resize; }
body.dark-theme #splitter { background: #555; }

/* Tree container */
#treeContainer {
  flex: 1;
  overflow: auto;
  padding: 0.5em;
  background: #fefefe;
  border-top: 1px solid #ccc;
  border-right: 1px solid #ccc;
}
.dark-theme #treeContainer { background: #2b2b2b; }

/* Inspector panel */
#inspector {
  width: 300px;
  max-width: 80%;
  min-width: 150px;
  overflow: auto;
  border-left: 1px solid #ccc;
  background: #fff;
}
body.dark-theme #inspector {
  background: #333;
  border-color: #555;
}
#inspector table { width: 100%; border-collapse: collapse; }
#inspector th, #inspector td {
  border: 1px solid #ccc;
  padding: 4px 6px;
  text-align: left;
}
.dark-theme #inspector th, .dark-theme #inspector td { border: 1px solid #555; }
#inspector td.navigable { cursor: pointer; text-decoration: underline; }
#inspector td.navigable:hover { background-color: rgba(173, 216, 230, 0.2); }
#inspector table tbody { background-color: #ffffff; }
body.dark-theme #inspector table tbody { background-color: #333333; }

/* Botones nav del inspector */
#inspectorNav { display: flex; gap: 6px; margin-bottom: 6px; }
#inspectorNav button {
  padding: 4px 8px;
  border: 1px solid #aaa;
  border-radius: 4px;
  background: #e9e9e9;
  cursor: pointer;
}
#inspectorNav button:hover { background: #d9d9d9; }
.dark-theme #inspectorNav button {
  background: #555; border-color: #777; color: #fff;
}
.dark-theme #inspectorNav button:hover { background: #666; }

/* ===== Árbol (UL/LI con líneas) ========================================== */
.json-tree {
  list-style: none;
  margin: 0;
  padding-left: 20px;
  position: relative;
}
.json-tree li {
  position: relative;
  margin: 0;
  padding: 0 0 0 20px;
  line-height: 20px;
  cursor: default;
}
.json-tree li .toggle-box {
  display: inline-block;
  width: 16px;
  text-align: center;
  margin-right: 4px;
  cursor: pointer;
}
.json-tree li.collapsed > ul { display: none; }
.selected-node { background: rgba(173, 216, 230, 0.5); }

/* Líneas */
.json-tree li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8px;
  width: 0;
  height: 100%;
  border-left: 1px solid #888;
}
.json-tree li::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 8px;
  width: 12px;
  border-top: 1px solid #888;
}
.json-tree li:last-child::before { height: 10px; }
/* El nivel raíz no lleva líneas */
#treeContainer > .json-tree > li::before,
#treeContainer > .json-tree > li::after { content: none; }
body.dark-theme .json-tree li::before,
body.dark-theme .json-tree li::after { border-color: #666; }

/* Valores con colores */
.value-object  { color: #b58900; }
.value-array   { color: #268bd2; }
.value-string  { color: #2aa198; }
.value-number  { color: #d33682; }
.value-boolean { color: #6c71c4; }
.value-null    { color: #cb4b16; }

/* Colores en el árbol (contenedor) */
#treeContainer .value-object  { color: #b5651d; }
#treeContainer .value-array   { color: #008b8b; }
#treeContainer .value-string  { color: #008000; }
#treeContainer .value-number  { color: #0000cd; }
#treeContainer .value-boolean { color: #800080; }
#treeContainer .value-null    { color: #a9a9a9; }

/* Llaves/corchetes */
#treeContainer .brace-color   { color: #ff8c00; font-weight: bold; }
#treeContainer .bracket-color { color: #1e90ff; font-weight: bold; }

/* Modo oscuro: colores árbol */
body.dark-theme #treeContainer .value-object  { color: #ffb347; }
body.dark-theme #treeContainer .value-array   { color: #40e0d0; }
body.dark-theme #treeContainer .value-string  { color: #90ee90; }
body.dark-theme #treeContainer .value-number  { color: #87cefa; }
body.dark-theme #treeContainer .value-boolean { color: #dda0dd; }
body.dark-theme #treeContainer .value-null    { color: #d3d3d3; }
body.dark-theme #treeContainer .brace-color   { color: #ffa500; font-weight: bold; }
body.dark-theme #treeContainer .bracket-color { color: #00bfff; font-weight: bold; }

/* ===== Barra de estado ==================================================== */
.statusbar {
  display: flex;
  align-items: center;
  padding: 4px 8px;
  border-top: 1px solid #ccc;
  background: #eee;
  position: relative; /* permite centrar cookies-policy por posición absoluta */
}
.dark-theme .statusbar {
  background: #333;
  border-top: 1px solid #555;
}
.statusbar select { margin-left: 6px; margin-right: 10px; }
#statusBar { flex: 1; }
#statusInfo {
  margin-left: auto;
  font-size: 0.9em;
  color: #555;
  white-space: nowrap;
}
body.dark-theme #statusInfo { color: #ccc; }

/* ===== Overlay drag & drop =============================================== */
#overlayDrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 2em;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* ===== Selector de idioma ================================================= */
/* (obsoleto) .lang-switch eliminado en favor de botón + menú */

/* ===== Tabla (panel) ====================================================== */
#tabTable { background: var(--tbl-bg); color: var(--tbl-text); }
#tabTable .table-message {
  margin: 12px;
  padding: 10px 12px;
  border: 1px solid var(--tbl-border);
  border-radius: 10px;
  background: transparent;
  color: var(--tbl-muted);
  font-size: 0.95rem;
}

/* Tabla base */
#tabTable .data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--tbl-bg);
  color: var(--tbl-text);
  font-variant-numeric: tabular-nums;
}
/* Borde exterior y celdas */
#tabTable .data-table thead th:first-child,
#tabTable .data-table tbody td:first-child { border-left: 1px solid var(--tbl-border); }
#tabTable .data-table thead th,
#tabTable .data-table tbody td {
  border-right: 1px solid var(--tbl-border);
  border-bottom: 1px solid var(--tbl-border);
  padding: 8px 12px;
  vertical-align: middle;
  max-width: 480px;
  word-break: break-word;
}

/* Header enfático y sticky */
#tabTable .data-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--tbl-header-bg);
  color: var(--tbl-header-text);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: left;
  white-space: nowrap;
  backdrop-filter: saturate(110%);
  box-shadow: inset 0 -2px 0 0 var(--tbl-border);
}
/* Esquinas */
#tabTable .data-table thead th:first-child { border-top-left-radius: var(--tbl-radius); }
#tabTable .data-table thead th:last-child  { border-top-right-radius: var(--tbl-radius); }
#tabTable .data-table tbody tr:last-child td:first-child { border-bottom-left-radius: var(--tbl-radius); }
#tabTable .data-table tbody tr:last-child td:last-child  { border-bottom-right-radius: var(--tbl-radius); }

/* Zebra + hover */
#tabTable .data-table tbody tr:nth-child(odd) td { background: var(--tbl-row-odd); }
#tabTable .data-table tbody tr:hover td { background: var(--tbl-row-hover); }

/* Alineación numérica (si se marca desde JS) */
#tabTable .data-table td[align="right"] { text-align: right; }

/* Toolbar y estado dentro del panel tabla */
#tabTable .toolbar {
  gap: 8px; padding: 8px 6px;
  border-bottom: 1px solid var(--tbl-border);
  background: transparent;
}
#tabTable .status { font-size: 0.9rem; color: var(--tbl-muted); }

/* Scroll de contenedor */
#tableContainer { scrollbar-width: thin; scrollbar-color: var(--tbl-border) transparent; }
#tableContainer::-webkit-scrollbar { height: 10px; width: 10px; }
#tableContainer::-webkit-scrollbar-thumb { background: var(--tbl-border); border-radius: 10px; }
#tableContainer::-webkit-scrollbar-track { background: transparent; }

/* Resaltados búsqueda */
#tableContainer td { scroll-margin: 72px; }
#tableContainer td.match-hit {
  background: var(--tbl-match-hit-bg) !important;
  color: var(--tbl-match-text) !important;
  outline: 2px solid var(--tbl-match-hit-border);
  outline-offset: -2px;
  transition: background .15s ease, outline-color .15s ease;
}
#tableContainer td.match-current {
  background: var(--tbl-match-current-bg) !important;
  outline: 2px solid var(--tbl-match-current-border);
  outline-offset: -2px;
  position: relative;
}
#tableContainer td.match-current.match-pulse {
  animation: tblMatchPulse 500ms ease-out 1;
}
@keyframes tblMatchPulse {
  0%   { box-shadow: 0 0 0 0 rgba(37,99,235,0.55); }
  100% { box-shadow: 0 0 0 12px rgba(37,99,235,0); }
}

/* ===== Mensajes y varios ================================================== */
#errorMsg { margin-left: 8px; color: red; font-size: 0.9em; }
.inspector-nav-btn .icon-green { color: #008000; }
body.dark-theme .inspector-nav-btn .icon-green { color: #00ff66; }

/* ===== Cookies policy centrado en la statusbar =========================== */
.cookies-policy{
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 50%;
  transform-origin: center;
  translate: -50% -50%;          /* centra vertical y horizontal */
  max-width: 62%;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: auto;          /* los enlaces siguen siendo clicables */
  font-size: .8em;
  color: var(--tbl-muted);
}
.cookies-policy a{
  color: var(--tbl-muted);
  text-decoration: underline;
}
.cookies-policy a:hover{
  color: var(--tbl-text);
  filter: brightness(1.05);
}

/* Ajuste responsive específico para la barra de estado:
   En pantallas pequeñas, mover la política de cookies 20px hacia arriba. */
@media (max-width: 2048px){
  .cookies-policy{
    position: relative;
    top: -40px;                   /* sube 20 px */
    z-index: 2;
    margin: 0;
    overflow: unset;
  }
  .cookies-policy span{
    position: absolute;
    right: 0px;
  }
}

@media (max-width: 800px){
  /* Oculta las etiquetas de Formato y Código en pantallas <800px */
  .statusbar label[for="statusFormat"],
  .statusbar label[for="statusLang"]{
    display: none;
  }
  /* Ajusta márgenes de los selects al desaparecer sus labels */
  #statusFormat, #statusLang{
    margin-left: 0;
  }
}

/* ===== JSON Graph Canvas (light/dark por variables) ===== */

/* Light (default) */
:root {
  --bg:        #f8fafc;   /* slate-50 */
  --panel:     #ffffff;   /* blanco tarjetas */
  --panel-2:   #f1f5f9;   /* slate-100 */
  --line-1:    #cbd5e1;   /* slate-300 */
  --line-2:    #94a3b8;   /* slate-400 */
  --border:    #cbd5e1;   /* slate-300 */
  --fg-1:      #0f172a;   /* slate-900 */
  --fg-2:      #334155;   /* slate-700 */
  --fg-3:      #64748b;   /* slate-500 */
  --fg-key:    #1d4ed8;   /* azul para claves */
  --btn-bg:        #f1f5f9; /* slate-100 */
  --btn-bg-hover:  #e2e8f0; /* slate-200 */
}

/* Dark (activado con <body class="dark-theme">) */
body.dark-theme {
  --bg:        #0b1220;
  --panel:     #0f172a;
  --panel-2:   #0a0f1a;
  --line-1:    #334155;
  --line-2:    #1f2937;
  --border:    #1e293b;
  --fg-1:      #e5e7eb;
  --fg-2:      #cbd5e1;
  --fg-3:      #94a3b8;
  --fg-key:    #93c5fd;
  --btn-bg:        #111827;
  --btn-bg-hover:  #1f2937;
}

/* ===== Componentes ===== */

.json-graph-container {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px;
  color: var(--fg-1);
  background: var(--bg);
  box-sizing: border-box;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

.json-graph-left { display: flex; flex-direction: column; gap: 8px; }

.json-graph-label { font-size: 12px; color: var(--fg-3); }

.json-graph-textarea {
  width: 100%;
  height: 320px;
  padding: 12px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--fg-1);
  outline: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  resize: vertical;
}

.json-graph-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.json-graph-btn {
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--btn-bg);
  color: var(--fg-1);
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.json-graph-btn:hover { background: var(--btn-bg-hover); }

.json-graph-status { font-size: 12px; min-height: 1.2em; }
.json-graph-status.ok  { color: #16a34a; } /* verde */
.json-graph-status.err { color: #dc2626; } /* rojo */

.json-graph-right { display: flex; flex-direction: column; gap: 8px; }

.json-graph-canvas-wrap {
  position: relative;
  width: 100%;
  height: 620px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  overflow: hidden;
}

.json-graph-footer { font-size: 12px; color: var(--fg-3); }

/* Título / encabezado opcional */
.json-graph-title {
  font-weight: 700;
  font-size: 20px;
  color: var(--fg-1);
  margin: 0 0 8px 0;
}
.json-graph-subtitle {
  font-size: 13px;
  color: var(--fg-3);
  margin: 0 0 8px 0;
}
