:root{
  --bg:#0b1220;
  --panel:#131a2a;
  --muted:#8fa1c9;
  --accent:#4cc9f0;
  --danger:#ff5d5d;
  --ok:#5dd39e;
  --border:#1f2a44;
}

html,body{height:100%;margin:0}

body{
/*
  background:var(--bg);
  color:#e6eefc;
*/
  font-family:Inter, system-ui, Segoe UI, Roboto, Arial, sans-serif;
  margin: 0; padding: 0;
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

header {
  background: #1976d2; color: white;
  padding:.75rem 1rem;
  position:sticky;top:0;z-index:10
  border-bottom:1px solid var(--border);
}

nav a {
  color: white; margin-right: 1em;
  text-decoration: none;
}

main {
  padding: 1em;
  flex:1 0 auto;
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}

.page_header{
  display:flex;
  flex-direction: column;
  gap:.5rem;
  align-items: flex-start;
  padding:.75rem 1rem;
  background:var(--panel);
  border-bottom:1px solid var(--border);
  position:sticky;
  top:0;
  z-index:10
}
.page_header h1{
  font-size:1rem;
  margin:0 1rem 0 0;
  color:#e6eefc;
  opacity:.92
}

.toolbar{
  display:flex;gap:.5rem;align-items:center;padding:.75rem 1rem;
  background:var(--panel);border-bottom:1px solid var(--border);
  position:sticky;top:0;z-index:10
}
.toolbar h1{
  font-size:1rem;
  margin:0 1rem 0 0;
  color:#e6eefc;
  opacity:.92
}

.btn{
  border:1px solid #2a3658;background:#182136;color:#e6eefc;
  padding:.45rem .75rem;border-radius:.7rem;cursor:pointer;user-select:none;display:block;font-size:12px
}
.btn:hover{border-color:var(--accent)}
.btn.primary{background:#21405a;border-color:var(--accent)}
.btn.danger{border-color:#ff7a7a;background:#3a1d24}
.btn.danger:hover{border-color:#ff0000}
.btn.ok{border-color:var(--ok);background:#1f3a2f}
.spacer{flex:1}
.hint{font-size:.85rem;color:var(--muted);margin-left:.25rem}

#grid{height:calc(100vh - 64px)}
/* Compact grid */
#grid{font-size:12px}
#grid .ag-cell{padding-top:0px !important;padding-bottom:2px !important}
#grid .ag-center-cols-container .ag-cell{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#grid .ag-row{line-height:1}
.cell-disabled{opacity:.35;pointer-events:none}
.caret{cursor:pointer;display:inline-block;width:1em;text-align:center;margin-right:.25rem}
/* Errors highlight */
#grid .ag-cell.invalid{
  background: rgba(255,93,93,0.12);
  box-shadow: inset 0 -1px 0 rgba(255,93,93,0.35);
}
#grid .ag-row.row-invalid .ag-cell[col-id="structure"]{
  border-left: 3px solid #ff5d5d;
}
#grid .ag-cell.na-span{
  background: rgba(100,100,100,0.08);
  text-align: center;
  font-style: italic;
}
#grid .ag-cell.struct-dim{
  background: rgba(200,200,200,0.08);
}

footer{
  margin-top:auto;
  padding:.0rem .75rem;
  background:var(--panel);
  border-top:1px solid var(--border);
  color:var(--muted);
  font-size:.85rem;
}

.help-container {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  margin: 1rem 0 1rem 0;
  padding: 0;
}

.help-menu {
  width: 220px;
  flex-shrink: 0;
}

.help-menu h2 {
  font-size: 1.1rem;
  margin-top: 0.5rem;
}

.help-menu a {
  display: block;
  padding: 0.4rem 0;
  color: #333;
  text-decoration: none;
}

.help-menu a:hover {
  color: #0078d7;
}

.help-menu a.active {
  font-weight: bold;
  color: #0078d7;
}

.help-content {
  flex-grow: 1;
}

.help-content h1,
.help-content h2,
.help-content h3 {
  margin-top: 0;
}

.help-content img {
  display: block;
  margin: 1rem auto;
  max-width: 100%;
  height: auto;
}

@media (max-width: 768px) {
  .help-container {
    flex-direction: column;
  }
  .help-menu {
    width: 100%;
    border-bottom: 1px solid #ddd;
    margin-bottom: 1rem;
  }
  .help-menu a {
    display: inline-block;
    margin-right: 1rem;
  }
}
.screenshot {
  position: relative;
  max-height: 600px;
}

.screenshot img {
  width: 100%;
  display: block;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 85%, rgba(0,0,0,0) 100%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 85%, rgba(0,0,0,0) 100%);
}

.caption {
  text-align: center;
  font-size: 0.9rem;
  color: rgba(0, 0, 0, 0.55);
  margin-top: -0.25rem;
  margin-bottom: 1.5rem;
  font-style: italic;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding-top: 0.3rem;
}

pre code {
  display: block;
  background-color: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 12px 16px;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.95em;
  line-height: 1.4;
  color: #333;
  overflow-x: auto;
  white-space: pre;
}

pre code .string { color: #d14; }
pre code .number { color: #099; }
pre code .boolean { color: #905; }
pre code .key { color: #1a1aa6; }

/* Inline JSON block */
pre.json {
  background-color: #f6f8fa;
  border-radius: 6px;
  padding: 10px 14px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.95em;
  color: #333;
  overflow-x: auto;
  display: block;
  margin: 6px 0;
  border: 1px solid #e1e4e8;
  white-space: pre;
}

/* Hover effect */
pre.json:hover {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Token colors */
pre.json .json-key { color: #b76e00; }     /* brown */
pre.json .json-string { color: #008000; }  /* green */
pre.json .json-number { color: #005cc5; }  /* blueish */
pre.json .json-boolean { color: #d73a49; } /* red */
