/* Exact transform.tools–inspired shell (original CSS) */
:root {
  --tf-blue: #0070f3;
  --tf-blue-dark: #005cc5;
  --tf-bg: #ffffff;
  --tf-sidebar-bg: #fafafa;
  --tf-border: #e5e7eb;
  --tf-text: #111827;
  --tf-muted: #6b7280;
  --tf-hover: #f3f4f6;
  --tf-active: #e8f0fe;
  --tf-sidebar-w: 240px;
  --tf-top-h: 48px;
  --tf-pane-bar-h: 40px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: var(--font);
  color: var(--tf-text);
  background: var(--tf-bg);
  overflow: hidden;
}
a { color: var(--tf-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Top bar — solid blue like transform */
.tf-top {
  height: var(--tf-top-h);
  background: var(--tf-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
}
.tf-brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff !important;
  text-decoration: none !important;
  letter-spacing: -0.02em;
}
.tf-top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.85rem;
}
.tf-top-actions a {
  color: rgba(255,255,255,0.92) !important;
  text-decoration: none !important;
}
.tf-top-actions a:hover { color: #fff !important; }
.tf-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.35rem;
  cursor: pointer;
  padding: 4px 8px;
  margin-right: 4px;
}

/* Shell */
.tf-shell {
  display: flex;
  height: 100vh;
  padding-top: var(--tf-top-h);
}

/* Sidebar */
.tf-sidebar {
  width: var(--tf-sidebar-w);
  min-width: var(--tf-sidebar-w);
  background: var(--tf-sidebar-bg);
  border-right: 1px solid var(--tf-border);
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--tf-top-h));
  z-index: 50;
}
.tf-search-wrap {
  padding: 10px 12px;
  border-bottom: 1px solid var(--tf-border);
  background: #fff;
}
.tf-search {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--tf-border);
  border-radius: 6px;
  font-size: 0.875rem;
  outline: none;
  background: #fff;
  color: var(--tf-text);
}
.tf-search:focus {
  border-color: var(--tf-blue);
  box-shadow: 0 0 0 3px rgba(0,112,243,0.15);
}
.tf-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0 24px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.tf-cat {
  margin: 0;
  padding: 0;
}
.tf-cat-title {
  position: sticky;
  top: 0;
  z-index: 25;
  padding: 12px 16px;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #58a6ff;
  background: #0d1117;
  border-bottom: 1px solid #21262d;
  box-shadow: 0 4px 12px rgba(0,0,0,.35);
}
.tf-cat-title strong {
  color: inherit;
  font-weight: 800;
}
.tf-tool-link {
  display: block;
  padding: 6px 16px 6px 18px;
  font-size: 0.875rem;
  color: #374151;
  text-decoration: none !important;
  border-left: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tf-tool-link:hover { background: var(--tf-hover); }
.tf-tool-link.active {
  background: var(--tf-active);
  border-left-color: var(--tf-blue);
  color: var(--tf-blue);
  font-weight: 600;
}
.tf-sidebar-foot {
  padding: 10px 14px;
  border-top: 1px solid var(--tf-border);
  font-size: 0.72rem;
  color: var(--tf-muted);
  background: #fff;
  line-height: 1.45;
}

/* Main */
.tf-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: calc(100vh - var(--tf-top-h));
  background: #fff;
  position: relative;
}
.tf-workspace {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Welcome */
.tf-welcome {
  max-width: 720px;
  margin: 48px auto;
  padding: 0 24px;
  text-align: center;
}
.tf-welcome h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}
.tf-welcome p {
  color: var(--tf-muted);
  line-height: 1.6;
  margin: 0 0 28px;
}
.tf-welcome-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  text-align: left;
}
.tf-welcome-card {
  border: 1px solid var(--tf-border);
  border-radius: 8px;
  padding: 14px;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tf-welcome-card:hover {
  border-color: var(--tf-blue);
  box-shadow: 0 4px 14px rgba(0,112,243,0.1);
}
.tf-welcome-card strong {
  display: block;
  font-size: 0.875rem;
  margin-bottom: 4px;
}
.tf-welcome-card span {
  font-size: 0.75rem;
  color: var(--tf-muted);
}

/* Tool body fills workspace */
.tf-tool-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.tf-tool-body .dth-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--tf-border);
  background: #fafafa;
  flex-shrink: 0;
}
.tf-tool-body .dth-toolbar .btn,
.tf-tool-body .btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: var(--tf-blue);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
}
.tf-tool-body .btn:hover { background: var(--tf-blue-dark); }
.tf-tool-body .btn-secondary {
  background: #fff;
  color: #374151;
  border-color: var(--tf-border);
}
.tf-tool-body .btn-secondary:hover { background: var(--tf-hover); }

/* Split panes — full height like transform */
.tf-tool-body .dth-split,
body.tf-layout .dth-split {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 0 !important;
  flex: 1 !important;
  min-height: 0 !important;
  height: 100% !important;
  border: none !important;
}
body.tf-layout .dth-pane {
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  height: 100% !important;
  background: #fff !important;
  border: none !important;
  border-radius: 0 !important;
  border-right: 1px solid var(--tf-border) !important;
  overflow: hidden !important;
}
body.tf-layout .dth-pane:last-child { border-right: none !important; }
body.tf-layout .dth-pane-bar {
  height: var(--tf-pane-bar-h);
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 12px !important;
  background: #fff !important;
  border-bottom: 1px solid var(--tf-border) !important;
  font-size: 0.8125rem !important;
  font-family: var(--font) !important;
  color: #374151 !important;
  flex-shrink: 0 !important;
}
body.tf-layout .dth-pane-bar .pane-title {
  font-weight: 600 !important;
  color: #111827 !important;
}
body.tf-layout .dth-pane-bar button {
  background: #fff !important;
  border: 1px solid var(--tf-border) !important;
  color: #374151 !important;
  border-radius: 6px !important;
  padding: 4px 10px !important;
  font-size: 0.75rem !important;
  cursor: pointer;
}
body.tf-layout .dth-pane-bar button:hover { background: var(--tf-hover) !important; }

/* Editors — solid readable + mono */
body.tf-layout .dth-editor,
body.tf-layout textarea.dth-editor,
body.tf-layout textarea#dth-in {
  flex: 1 !important;
  width: 100% !important;
  min-height: 0 !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 12px 14px !important;
  border: none !important;
  border-radius: 0 !important;
  resize: none !important;
  background: #ffffff !important;
  color: #1f2937 !important;
  -webkit-text-fill-color: #1f2937 !important;
  caret-color: #0070f3 !important;
  font-family: var(--mono) !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
  tab-size: 2;
  white-space: pre;
  overflow: auto !important;
}
body.tf-layout .dth-editor:focus { outline: none; }
body.tf-layout .dth-editor-out,
body.tf-layout pre.dth-hl,
body.tf-layout pre#dth-out {
  flex: 1 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 12px 14px !important;
  overflow: auto !important;
  background: #fafafa !important;
  color: #1f2937 !important;
  font-family: var(--mono) !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
  white-space: pre !important;
  border: none !important;
}

/* Syntax colors — VS Code Light+ */
body.tf-layout .hl-key { color: #0000ff !important; }
body.tf-layout .hl-string { color: #a31515 !important; }
body.tf-layout .hl-number { color: #098658 !important; }
body.tf-layout .hl-bool,
body.tf-layout .hl-null { color: #0000ff !important; }
body.tf-layout .hl-comment { color: #008000 !important; font-style: italic; }
body.tf-layout .hl-keyword { color: #0000ff !important; }
body.tf-layout .hl-type { color: #267f99 !important; }
body.tf-layout .hl-tag { color: #800000 !important; }
body.tf-layout .hl-attr { color: #ff0000 !important; }
body.tf-layout .hl-property { color: #001080 !important; }

body.tf-layout .dth-error-bar {
  display: none;
  padding: 8px 12px;
  background: #fff3cd;
  border-top: 1px solid #ffecb5;
  color: #856404;
  font-size: 0.8rem;
  flex-shrink: 0;
}
body.tf-layout .dth-error-bar.show { display: block; }

body.tf-layout .dth-status-ok { color: #059669; font-size: 0.8rem; margin-left: 8px; }
body.tf-layout .dth-status-err { color: #dc2626; font-size: 0.8rem; margin-left: 8px; }

/* Hide legacy chrome */
body.tf-layout .hero,
body.tf-layout .section,
body.tf-layout .header:not(.tf-top),
body.tf-layout #toolModal,
body.tf-layout .tool-guide,
body.tf-layout .seo-content { display: none !important; }

/* Thin footer strip */
.tf-footer {
  flex-shrink: 0;
  background: var(--tf-blue);
  color: rgba(255,255,255,0.9);
  font-size: 0.72rem;
  padding: 8px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.tf-footer a { color: #fff !important; text-decoration: none !important; }
.tf-footer a:hover { text-decoration: underline !important; }

/* ===== Mobile ===== */
@media (max-width: 860px) {
  .tf-menu-btn { display: inline-flex; }
  .tf-sidebar {
    position: fixed;
    left: 0;
    top: var(--tf-top-h);
    bottom: 0;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,0.12);
    background: #fff;
  }
  .tf-sidebar.open { transform: translateX(0); }
  .tf-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--tf-top-h);
    background: rgba(0,0,0,0.35);
    z-index: 40;
  }
  .tf-backdrop.show { display: block; }
  body.tf-layout .dth-split {
    grid-template-columns: 1fr !important;
    grid-template-rows: 1fr 1fr !important;
  }
  body.tf-layout .dth-pane {
    border-right: none !important;
    border-bottom: 1px solid var(--tf-border) !important;
    min-height: 200px !important;
  }
  .tf-welcome-grid { grid-template-columns: 1fr 1fr; }
  .tf-top-actions span { display: none; }
}
@media (max-width: 480px) {
  .tf-welcome-grid { grid-template-columns: 1fr; }
  .tf-brand { font-size: 1rem; }
}

/* CodeMirror fills pane like jsonlint / transform */
body.tf-layout .CodeMirror {
  height: 100% !important;
  font-family: var(--mono) !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
  border: none !important;
}
body.tf-layout .dth-pane .CodeMirror {
  flex: 1;
  min-height: 0;
}
body.tf-layout .CodeMirror-scroll {
  min-height: 100%;
}
body.tf-layout .tf-theme-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.35);
  color: #fff;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
body.tf-layout .tf-theme-btn:hover {
  background: rgba(255,255,255,0.25);
}

/* ===== Dark theme ===== */
html[data-theme="dark"] body.tf-layout {
  background: #0d1117;
  color: #e6edf3;
}
html[data-theme="dark"] body.tf-layout .tf-top {
  background: #1f6feb;
}
html[data-theme="dark"] body.tf-layout .tf-sidebar {
  background: #0d1117;
  border-right-color: #30363d;
}
html[data-theme="dark"] body.tf-layout .tf-search-wrap {
  background: #161b22;
  border-bottom-color: #30363d;
}
html[data-theme="dark"] body.tf-layout .tf-search {
  background: #0d1117;
  border-color: #30363d;
  color: #e6edf3;
}
html[data-theme="dark"] body.tf-layout .tf-tool-link {
  color: #c9d1d9;
}
html[data-theme="dark"] body.tf-layout .tf-tool-link:hover {
  background: #161b22;
}
html[data-theme="dark"] body.tf-layout .tf-tool-link.active {
  background: #1f2937;
  color: #58a6ff;
  border-left-color: #58a6ff;
}
html[data-theme="dark"] body.tf-layout .tf-cat-title {
  color: #e6edf3;
  font-weight: 800;
}
html[data-theme="dark"] body.tf-layout .tf-sidebar-foot {
  background: #161b22;
  border-top-color: #30363d;
  color: #8b949e;
}
html[data-theme="dark"] body.tf-layout .tf-main {
  background: #0d1117;
}
html[data-theme="dark"] body.tf-layout .tf-welcome h2 {
  color: #e6edf3;
}
html[data-theme="dark"] body.tf-layout .tf-welcome-card {
  background: #161b22;
  border-color: #30363d;
}
html[data-theme="dark"] body.tf-layout .tf-welcome-card strong {
  color: #e6edf3;
}
html[data-theme="dark"] body.tf-layout .dth-pane {
  background: #0d1117 !important;
  border-right-color: #30363d !important;
}
html[data-theme="dark"] body.tf-layout .dth-pane-bar {
  background: #161b22 !important;
  border-bottom-color: #30363d !important;
  color: #c9d1d9 !important;
}
html[data-theme="dark"] body.tf-layout .dth-pane-bar .pane-title {
  color: #e6edf3 !important;
}
html[data-theme="dark"] body.tf-layout .dth-pane-bar button {
  background: #21262d !important;
  border-color: #30363d !important;
  color: #c9d1d9 !important;
}
html[data-theme="dark"] body.tf-layout .dth-toolbar {
  background: #161b22 !important;
  border-bottom-color: #30363d !important;
}
html[data-theme="dark"] body.tf-layout .dth-editor,
html[data-theme="dark"] body.tf-layout textarea.dth-editor {
  background: #0d1117 !important;
  color: #e6edf3 !important;
  -webkit-text-fill-color: #e6edf3 !important;
}
html[data-theme="dark"] body.tf-layout .dth-editor-out,
html[data-theme="dark"] body.tf-layout pre#dth-out {
  background: #161b22 !important;
  color: #e6edf3 !important;
}
html[data-theme="dark"] body.tf-layout .hl-key { color: #79c0ff !important; }
html[data-theme="dark"] body.tf-layout .hl-string { color: #a5d6ff !important; }
html[data-theme="dark"] body.tf-layout .hl-number { color: #79c0ff !important; }
html[data-theme="dark"] body.tf-layout .hl-bool,
html[data-theme="dark"] body.tf-layout .hl-null { color: #ff7b72 !important; }
html[data-theme="dark"] body.tf-layout .hl-comment { color: #8b949e !important; }
html[data-theme="dark"] body.tf-layout .hl-keyword { color: #ff7b72 !important; }
html[data-theme="dark"] body.tf-layout .tf-footer {
  background: #161b22;
  color: #8b949e;
}

/* Light 3D polish */
body.tf-layout .tf-welcome-card {
  transform: perspective(800px) rotateX(0) translateY(0);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.2s;
}
body.tf-layout .tf-welcome-card:hover {
  transform: perspective(800px) rotateX(2deg) translateY(-4px);
  box-shadow: 0 12px 28px rgba(0,112,243,0.18);
}
body.tf-layout .tf-tool-link {
  transition: transform 0.15s ease, background 0.15s;
}
body.tf-layout .tf-tool-link:hover {
  transform: translateX(3px);
}
body.tf-layout .tf-brand {
  text-shadow: 0 1px 8px rgba(0,0,0,0.2);
}
body.tf-layout .btn {
  transition: transform 0.15s ease, box-shadow 0.15s;
}
body.tf-layout .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,112,243,0.35);
}
body.tf-layout .tf-top {
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

/* Mahajan chatbot always visible on transform layout */
body.tf-layout .mh-root {
  display: block !important;
  position: fixed !important;
  right: 16px !important;
  bottom: 16px !important;
  z-index: 99999 !important;
}

/* Ensure textarea always editable */
body.tf-layout .dth-editor,
body.tf-layout textarea#dth-in {
  pointer-events: auto !important;
  user-select: text !important;
  -webkit-user-select: text !important;
  opacity: 1 !important;
  color: #1f2937 !important;
  -webkit-text-fill-color: #1f2937 !important;
  caret-color: #0070f3 !important;
}

body.tf-layout .tf-cat-title {
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  color: #111827 !important;
  padding: 14px 16px 6px !important;
}
body.tf-layout .tf-cat-title strong {
  font-weight: 800 !important;
  color: #0f172a !important;
}
html[data-theme="dark"] body.tf-layout .tf-cat-title,
html[data-theme="dark"] body.tf-layout .tf-cat-title strong {
  color: #e6edf3 !important;
}

/* Category titles — colored so users spot them fast */
body.tf-layout .tf-cat-title {
  font-size: 0.7rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.07em !important;
  text-transform: uppercase !important;
  padding: 14px 16px 6px !important;
  border-left: 3px solid #0070f3;
  margin: 8px 8px 0 0;
  background: linear-gradient(90deg, rgba(0,112,243,0.08), transparent);
  color: #0070f3 !important;
  border-radius: 0 6px 6px 0;
}
body.tf-layout .tf-cat-title strong {
  font-weight: 800 !important;
  color: inherit !important;
}
/* Alternate category accent colors by order */
body.tf-layout .tf-cat:nth-child(1) .tf-cat-title { color: #0070f3 !important; border-left-color: #0070f3; background: linear-gradient(90deg, rgba(0,112,243,0.1), transparent); }
body.tf-layout .tf-cat:nth-child(2) .tf-cat-title { color: #7c3aed !important; border-left-color: #7c3aed; background: linear-gradient(90deg, rgba(124,58,237,0.1), transparent); }
body.tf-layout .tf-cat:nth-child(3) .tf-cat-title { color: #059669 !important; border-left-color: #059669; background: linear-gradient(90deg, rgba(5,150,105,0.1), transparent); }
body.tf-layout .tf-cat:nth-child(4) .tf-cat-title { color: #d97706 !important; border-left-color: #d97706; background: linear-gradient(90deg, rgba(217,119,6,0.1), transparent); }
body.tf-layout .tf-cat:nth-child(5) .tf-cat-title { color: #dc2626 !important; border-left-color: #dc2626; background: linear-gradient(90deg, rgba(220,38,38,0.1), transparent); }
body.tf-layout .tf-cat:nth-child(6) .tf-cat-title { color: #0891b2 !important; border-left-color: #0891b2; background: linear-gradient(90deg, rgba(8,145,178,0.1), transparent); }
body.tf-layout .tf-cat:nth-child(7) .tf-cat-title { color: #db2777 !important; border-left-color: #db2777; background: linear-gradient(90deg, rgba(219,39,119,0.1), transparent); }
body.tf-layout .tf-cat:nth-child(8) .tf-cat-title { color: #4f46e5 !important; border-left-color: #4f46e5; background: linear-gradient(90deg, rgba(79,70,229,0.1), transparent); }
body.tf-layout .tf-cat:nth-child(9) .tf-cat-title { color: #0d9488 !important; border-left-color: #0d9488; background: linear-gradient(90deg, rgba(13,148,136,0.1), transparent); }

/* Output JSON colors — VS Code dark/light */
body.tf-layout .hl-key { color: #9cdcfe !important; }
body.tf-layout .hl-string { color: #ce9178 !important; }
body.tf-layout .hl-number { color: #b5cea8 !important; }
body.tf-layout .hl-bool, body.tf-layout .hl-null { color: #569cd6 !important; }
body.tf-layout .hl-comment { color: #6a9955 !important; }
body.tf-layout .hl-keyword { color: #c586c0 !important; }
body.tf-layout .hl-tag { color: #569cd6 !important; }
body.tf-layout .hl-attr { color: #9cdcfe !important; }

html:not([data-theme="dark"]) body.tf-layout .hl-key { color: #0451a5 !important; }
html:not([data-theme="dark"]) body.tf-layout .hl-string { color: #a31515 !important; }
html:not([data-theme="dark"]) body.tf-layout .hl-number { color: #098658 !important; }
html:not([data-theme="dark"]) body.tf-layout .hl-bool,
html:not([data-theme="dark"]) body.tf-layout .hl-null { color: #0000ff !important; }
html:not([data-theme="dark"]) body.tf-layout .hl-keyword { color: #af00db !important; }
html:not([data-theme="dark"]) body.tf-layout .hl-tag { color: #800000 !important; }
html:not([data-theme="dark"]) body.tf-layout .hl-attr { color: #ff0000 !important; }

/* CodeMirror left pane already colorful; make right pane code-like bg in dark */
html[data-theme="dark"] body.tf-layout .dth-editor-out,
html[data-theme="dark"] body.tf-layout pre#dth-out {
  background: #1e1e1e !important;
  color: #d4d4d4 !important;
}

/* Larger VS Code-like CodeMirror */
body.tf-layout .CodeMirror {
  font-size: 15px !important;
  line-height: 1.6 !important;
  height: 100% !important;
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace !important;
}
body.tf-layout .CodeMirror-linenumber {
  font-size: 13px !important;
  min-width: 36px !important;
  color: #9ca3af;
}
body.tf-layout .dth-pane .CodeMirror {
  flex: 1;
  min-height: 0;
}
body.tf-layout .CodeMirror-hints {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 13px;
  z-index: 100000;
}

/* Colorful category titles */
body.tf-layout .tf-cat-title,
body.tf-layout .tf-cat-title strong {
  font-size: 0.7rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.07em !important;
  text-transform: uppercase !important;
  padding: 14px 16px 6px !important;
}
body.tf-layout .tf-cat:nth-child(1) .tf-cat-title strong { color: #2563eb !important; }
body.tf-layout .tf-cat:nth-child(2) .tf-cat-title strong { color: #7c3aed !important; }
body.tf-layout .tf-cat:nth-child(3) .tf-cat-title strong { color: #059669 !important; }
body.tf-layout .tf-cat:nth-child(4) .tf-cat-title strong { color: #d97706 !important; }
body.tf-layout .tf-cat:nth-child(5) .tf-cat-title strong { color: #dc2626 !important; }
body.tf-layout .tf-cat:nth-child(6) .tf-cat-title strong { color: #0891b2 !important; }
body.tf-layout .tf-cat:nth-child(7) .tf-cat-title strong { color: #db2777 !important; }
body.tf-layout .tf-cat:nth-child(8) .tf-cat-title strong { color: #4f46e5 !important; }
body.tf-layout .tf-cat:nth-child(9) .tf-cat-title strong { color: #0d9488 !important; }

/* Dark only — no light mode */
html, body.tf-layout {
  color-scheme: dark !important;
  background: #0d1117 !important;
}
html[data-theme="light"],
html:not([data-theme]) {
  color-scheme: dark !important;
}
/* hide theme toggles */
#tf-theme, .theme-toggle, button[aria-label*="theme" i],
button[aria-label*="Theme" i], .tf-top button.theme {
  display: none !important;
}
body.tf-layout .CodeMirror {
  font-size: 15px !important;
  line-height: 1.65 !important;
  font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", Consolas, monospace !important;
  background: #282a36 !important;
}
body.tf-layout .CodeMirror-gutters {
  background: #21222c !important;
  border-right: 1px solid #191a21 !important;
}
body.tf-layout .dth-pane,
body.tf-layout .dth-pane-bar {
  background: #21222c !important;
  border-color: #191a21 !important;
  color: #f8f8f2 !important;
}
body.tf-layout .dth-toolbar {
  background: #21222c !important;
  border-color: #191a21 !important;
}
body.tf-layout .tf-sidebar {
  background: #1a1b26 !important;
}
body.tf-layout .tf-top {
  background: #0070f3 !important;
}
/* Dracula-like token colors for pre fallback */
.hl-key { color: #ff79c6 !important; }
.hl-string { color: #f1fa8c !important; }
.hl-number { color: #bd93f9 !important; }
.hl-bool, .hl-null { color: #bd93f9 !important; }
.hl-keyword { color: #ff79c6 !important; }
.hl-comment { color: #6272a4 !important; }
.hl-tag { color: #ff79c6 !important; }
.hl-property { color: #8be9fd !important; }

/* Scrollable tool workspace — QR bulk / long tools */
body.tf-layout .tf-workspace,
body.tf-layout .tf-tool-body,
body.tf-layout .tf-main {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
}
body.tf-layout .tf-tool-body {
  max-height: none !important;
  height: auto !important;
  min-height: calc(100vh - 56px);
  padding-bottom: 80px !important;
}
body.tf-layout .qrb-suite {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 20px 100px;
}
body.tf-layout #qrb-bulk-out {
  min-height: 180px;
  padding-bottom: 24px;
}
body.tf-layout #qrb-preview-wrap {
  margin-bottom: 40px !important;
}
body.tf-layout #qrb-preview-wrap canvas,
body.tf-layout #qrb-bulk-out canvas {
  background: #fff !important;
  display: inline-block !important;
}
/* HTML viewer tabs dark */
body.tf-layout .hv-tab {
  background: #21222c !important;
  color: #f8f8f2 !important;
  border-bottom: 2px solid transparent !important;
}
body.tf-layout .hv-tab.active {
  color: #8be9fd !important;
  border-bottom-color: #bd93f9 !important;
  background: #282a36 !important;
}

/* CodeMirror-hint-dark-vscode — same family as VS Code suggest */
.CodeMirror-hints {
  background: #252526 !important;
  border: 1px solid #454545 !important;
  border-radius: 6px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.45) !important;
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace !important;
  font-size: 13px !important;
  max-height: 240px !important;
  z-index: 100000 !important;
  padding: 4px 0 !important;
}
.CodeMirror-hint {
  color: #cccccc !important;
  padding: 4px 12px 4px 10px !important;
  border-radius: 0 !important;
  background: transparent !important;
}
li.CodeMirror-hint-active {
  background: #04395e !important;
  color: #ffffff !important;
}
.CodeMirror-hint .CodeMirror-hint-keyword,
.CodeMirror-hint-active {
  color: #fff !important;
}



/* === STICKY CATEGORY FIX v2 — flush, opaque, no gap === */
body.tf-layout #tfNav {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
}
body.tf-layout .tf-cat-title {
  position: sticky !important;
  top: 0 !important;
  z-index: 100 !important;
  background-color: #0d1117 !important;
  background-image: none !important;
  padding: 11px 12px !important;
  margin: 0 0 0 0 !important;
  border-bottom: 1px solid #30363d !important;
  border-left-width: 3px !important;
  border-left-style: solid !important;
  box-shadow: 0 6px 10px -2px rgba(0,0,0,.55) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  font-size: 11px !important;
  line-height: 1.25 !important;
}
html:not([data-theme="dark"]) body.tf-layout .tf-cat-title {
  background-color: #fafafa !important;
  border-bottom-color: #e5e7eb !important;
  box-shadow: 0 6px 10px -2px rgba(0,0,0,.08) !important;
}
body.tf-layout .tf-cat-title strong {
  background: none !important;
  font-weight: 700 !important;
}

/* === Sticky categories flush under search (only nav scrolls) === */
.tf-sidebar {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  height: calc(100vh - var(--tf-top-h, 52px)) !important;
}
.tf-search-wrap {
  flex-shrink: 0 !important;
  position: relative !important;
  z-index: 30 !important;
  background: #0d1117 !important;
  border-bottom: 1px solid #30363d !important;
  padding: 10px 12px !important;
}
.tf-search {
  background: #161b22 !important;
  color: #e6edf3 !important;
  border: 1px solid #30363d !important;
}
#tfNav.tf-nav,
.tf-nav#tfNav,
#tfNav {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain !important;
  min-height: 0 !important;
  padding-top: 0 !important;
  margin-top: 0 !important;
}
.tf-cat {
  margin: 0 !important;
  padding: 0 !important;
}
.tf-cat-title {
  position: sticky !important;
  top: 0 !important;
  z-index: 25 !important;
  background: #0d1117 !important;
  color: #58a6ff !important;
  padding: 12px 16px 10px !important;
  margin: 0 !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  border-bottom: 1px solid #21262d !important;
  box-shadow: 0 4px 12px rgba(0,0,0,.35);
  line-height: 1.2 !important;
}
.tf-cat-title strong {
  color: #58a6ff !important;
  font-weight: 800 !important;
}
/* first category title sits tight under search */
.tf-cat:first-child .tf-cat-title {
  top: 0 !important;
}
.tf-sidebar-foot {
  flex-shrink: 0 !important;
}

[data-theme="dark"] .tf-search-wrap {
  background: #0d1117 !important;
  border-bottom: 1px solid #21262d;
}
[data-theme="dark"] .tf-search {
  background: #161b22 !important;
  color: #e6edf3 !important;
  border-color: #30363d !important;
}
[data-theme="dark"] .tf-sidebar {
  background: #0d1117 !important;
}
