
        /* =====================================================================
           THEME / LAYOUT
           FIX (rev9 - background): html/body are intentionally left WITHOUT a
           forced background/color here. That lets your site's real page
           background (set globally, or brought in by nav.html's own
           stylesheet) show through naturally around the tool. Only the tool's
           own content shell (.app) is force-styled with !important, so the
           tool itself always stays readable and on-theme no matter what the
           surrounding page looks like.
           ===================================================================== */
        :root{
          --bg:#0f1115; --panel:#171a21; --panel-2:#1f2430; --border:#353c4a;
          --text:#e7ebf3; --muted:#9aa4b2; --accent:#4ea1ff; --accent-2:#82c4ff;
          --success:#2fb67c; --danger:#ff6b6b; --warn:#e0b23a; --override:#b083ff;
          --shadow:0 14px 36px rgba(0,0,0,.28);
    
          --nav-visible-height: 64px;
        }
        *{box-sizing:border-box}
        body{margin:0;font-family:Inter,system-ui,sans-serif;min-height:100vh}
    
        /* .app = the tool's own opaque shell. Forced dark theme lives here only,
           so the surrounding page (outside .app) is free to show your site's
           actual background. */
    
        /* =====================================================================
           THEME OVERRIDE PATCH - append inside the tool's own <style> block.
           theme.css defines unscoped `input, select, button` rules (width:100%,
           min-height:34px, padding, border-radius) that leak into this tool
           and are never fully contested by its own CSS - so they apply
           regardless of <link> placement. Prefixing every selector with .app
           raises specificity from (0,0,1) to (0,1,1), which always beats
           theme.css's plain element selectors no matter what order the
           stylesheets load in. This makes the fix permanent and order-proof.
           ===================================================================== */
        .app input,
        .app select,
        .app button,
        .app .file-btn {
          width: auto !important;
          min-height: 0 !important;
        }
    
        .app input[type=text],
        .app select {
          padding: 5px 8px !important;
          border-radius: 6px !important;
        }
    
        .app button,
        .app .file-btn {
          padding: 7px 12px !important;
          border-radius: 8px !important;
        }
    
        /* the two search inputs and the sort <select> are meant to size to their
           container, not the page - re-apply intentional widths explicitly */
        #paramSearch, #excludeSearch, #pathSearch {
          width: 100% !important;
        }
        /* end of patch */
        .app{
          display:grid;
          grid-template-rows:auto auto auto auto 1fr;
          min-height:100vh;
          background:var(--bg) !important;
          color:var(--text) !important;
        }
    
        .app header {
          position: static;
          top: auto;
          right: auto;
    
          display: block;
          overflow: visible;
          max-height: none;
          opacity: 1;
          transform: none;
    
          padding: 16px 22px 10px;
          border-bottom: 1px solid var(--border);
          border-radius: 0;
          background: linear-gradient(180deg, var(--panel-2), var(--bg));
        }
    
    
    
        /* The header is fixed now, so reserve space at the top of the app. */
        .app {
          padding-top: 8px;
        }
    
        .app header h1 {
          margin: 0 0 3px;
          font-size: 16px;
        }
    
        .app header .sub {
          font-size: 11px;
          line-height: 1.35;
        }
    
        /* Keep the section navigation particularly compact. */
        .quicknav {
          position: fixed;
          /*top: var(--quicknav-top, 72px);*/
            top: 72px; /* JavaScript replaces this immediately */
    
          right: 12px;
          z-index: 950;
    
          display: grid;
          grid-template-columns: repeat(4, 1fr);
          width: min(360px, calc(100vw - 24px));
          height: 24px;
    
          overflow: visible;
          visibility: visible;
          opacity: 1;
          transform: none;
    
          border: 1px solid var(--border);
          border-radius: 6px;
          background: var(--panel-2);
          box-shadow: var(--shadow);
    
          transition: none;
        }
    
        .quicknav a {
          display: grid;
          place-items: center;
    
          min-width: 0;
          border-right: 1px solid var(--border);
          color: var(--muted);
          text-decoration: none;
    
          font-size: 10px;
          font-weight: 700;
          letter-spacing: .04em;
          line-height: 1;
        }
    
        .quicknav a:last-child {
          border-right: 0;
        }
    
        @media (max-width: 760px) {
          .quicknav {
            right: 6px;
            width: calc(100vw - 12px);
          }
        }
    
    
        .quicknav a {
          display: grid;
          place-items: center;
    
          min-width: 0;
          border-right: 1px solid var(--border);
          color: var(--muted);
          text-decoration: none;
    
          font-size: 10px;
          font-weight: 700;
          letter-spacing: .04em;
          line-height: 1;
        }
    
        .quicknav a:last-child {
          border-right: 0;
        }
    
        .quicknav a:nth-child(1) {
          background: color-mix(in srgb, var(--accent), transparent 92%);
        }
    
        .quicknav a:nth-child(2) {
          background: color-mix(in srgb, var(--warn), transparent 94%);
        }
    
        .quicknav a:nth-child(3) {
          background: color-mix(in srgb, var(--override), transparent 94%);
        }
    
        .quicknav a:nth-child(4) {
          background: color-mix(in srgb, var(--success), transparent 94%);
        }
    
        .quicknav a:hover,
        .quicknav a:focus-visible {
          background: color-mix(in srgb, var(--accent), transparent 80%);
          color: var(--text);
          outline: none;
        }
    
        @media (max-width: 760px) {
          .quicknav {
            right: 6px;
            width: calc(100vw - 12px);
          }
        }
        .sub{margin:0;color:var(--muted) !important;font-size:14px}
    
        .filebar{display:grid;grid-template-columns:1fr 1fr;gap:14px;padding:14px 22px;border-bottom:1px solid var(--border);background:var(--bg-2, #12161e) !important}
        .filebox{background:var(--panel) !important;border:1px solid var(--border);border-radius:12px;padding:12px;position:relative;box-shadow:var(--shadow)}
        .filebox.dragover{border-color:var(--accent);background:rgba(78,161,255,.08) !important}
        .filebox h3{margin:0 0 8px;font-size:14px;display:flex;justify-content:space-between;align-items:center;color:var(--text) !important}
        .filebox .meta{font-size:12px;color:var(--muted) !important;min-height:34px}
        .filebox .badge{display:inline-block;padding:2px 8px;border-radius:999px;font-size:11px;font-weight:600;margin-right:6px}
        .badge.udt{background:rgba(78,161,255,.18);color:var(--accent-2)}
        .badge.tags{background:rgba(47,182,124,.18);color:var(--success)}
        .badge.err{background:rgba(255,107,107,.18);color:var(--danger)}
        .filebox .row{display:flex;gap:8px;margin-top:8px}
        .app button,.app .file-btn{appearance:none;border:1px solid var(--border);background:var(--panel-2) !important;color:var(--text) !important;
          border-radius:8px;padding:7px 12px;cursor:pointer;font:inherit;font-size:13px}
        .app button:hover,.app .file-btn:hover{border-color:var(--accent)}
        .file-btn input{display:none}
        .primary{background:var(--accent) !important;color:#08111d !important;border-color:transparent;font-weight:600}
        .primary:hover{background:var(--accent-2) !important}
    
        .controls{display:flex;flex-wrap:wrap;gap:14px;align-items:flex-start;padding:12px 22px;border-bottom:1px solid var(--border);background:var(--bg-2, #12161e) !important}
        .ctrl-group{background:var(--panel) !important;border:1px solid var(--border);border-radius:10px;padding:10px 12px;box-shadow:var(--shadow)}
        .ctrl-group h4{margin:0 0 6px;font-size:12px;color:var(--muted) !important;text-transform:uppercase;letter-spacing:.04em}
        .ctrl-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap;font-size:13px;color:var(--text) !important}
        .app select,.app input[type=text]{background:var(--panel-2) !important;border:1px solid var(--border);color:var(--text) !important;border-radius:6px;padding:5px 8px;font:inherit}
        #paramPanel,#excludePanel{max-height:180px;overflow:auto;min-width:220px}
        #paramList,#excludeList{display:grid;gap:4px;margin-top:6px}
        #folderPanel {
          max-height: 180px;
          overflow: auto;
          min-width: 220px;
        }
    
        #folderList {
          display: grid;
          gap: 4px;
          margin-top: 6px;
        }
        .param-item{display:flex;align-items:center;gap:8px;font-size:12.5px;color:var(--text) !important}
    
        .filter-item{display:flex;align-items:center;gap:6px;font-size:12.5px;white-space:nowrap;color:var(--text) !important}
        .filter-item .swatch{width:12px;height:12px;border-radius:3px;display:inline-block}
        .sw-diff{background:rgba(224,178,58,.6)}
        .sw-override{background:rgba(176,131,255,.6)}
        .sw-onlyA{background:rgba(78,161,255,.6)}
        .sw-onlyB{background:rgba(47,182,124,.6)}
        .sw-match{background:rgba(154,164,178,.5)}
    
        main{padding:16px 22px 40px;background:var(--bg) !important}
        .group{margin-bottom:14px;border:1px solid var(--border);border-radius:12px;overflow:hidden;background:var(--panel) !important;box-shadow:var(--shadow)}
        .group-head{display:flex;justify-content:space-between;align-items:center;padding:10px 14px;background:var(--panel-2) !important;cursor:pointer;user-select:none;color:var(--text) !important}
        .group-head .gtitle{font-weight:600;font-size:14px}
        .group-head .gtype{font-size:12px;color:var(--muted) !important;margin-left:8px}
        .group-head .gcount{font-size:12px;color:var(--muted) !important}
        .group-body{display:block}
        .group.collapsed .group-body{display:none}
    
        /* FIX (rev9 - equal column widths): table-layout:fixed + explicit
           <colgroup> percentages (written per-table at render time) guarantee
           the File A and File B value columns are always identically wide,
           regardless of how long the values inside them are. */
        table{width:100%;border-collapse:collapse;font-size:13px;color:var(--text) !important;table-layout:fixed}
        th,td{padding:7px 10px;border-bottom:1px solid var(--border);text-align:left;vertical-align:top;overflow-wrap:break-word}
        th{background:var(--bg-2, #141822) !important;color:var(--muted) !important;font-weight:600;font-size:11.5px;text-transform:uppercase;letter-spacing:.03em;position:sticky;top:0}
        td.path-cell{color:var(--muted) !important;font-size:12px}
        td.val-cell{cursor:copy;font-family:Consolas,Monaco,"Courier New",monospace;word-break:break-word}
        td.val-cell:hover{outline:1px dashed var(--accent);outline-offset:-2px}
        tr.status-diff td.val-cell{background:rgba(224,178,58,.14) !important}
        tr.status-override td.val-cell.b{background:rgba(176,131,255,.18) !important}
        tr.status-onlyA td.val-cell.a{background:rgba(78,161,255,.14) !important}
        tr.status-onlyB td.val-cell.b{background:rgba(47,182,124,.14) !important}
        .status-tag{font-size:10.5px;padding:1px 6px;border-radius:999px;font-weight:600}
        .status-tag.match{color:var(--muted) !important}
        .status-tag.diff{background:rgba(224,178,58,.2);color:var(--warn) !important}
        .status-tag.override{background:rgba(176,131,255,.2);color:var(--override) !important}
        .status-tag.onlyA{background:rgba(78,255,255,.2);color:var(--accent-2) !important}
        .status-tag.onlyB{background:rgba(47,182,124,.2);color:var(--success) !important}
        .empty{color:var(--muted) !important;padding:20px;text-align:center}
        #status{position:fixed;bottom:14px;right:18px;background:var(--panel-2) !important;border:1px solid var(--border);
          padding:8px 14px;border-radius:8px;font-size:13px;box-shadow:var(--shadow);opacity:0;transition:opacity .2s;color:var(--text) !important;z-index:9999}
        #status.show{opacity:1}
        /* =========================================================================
           CSS - add this to the tool's <style> block
           ========================================================================= */
    
        #diffModal{
          position:fixed; inset:0; z-index:10000; display:none;
          background:rgba(0,0,0,.6); backdrop-filter:blur(2px);
          align-items:center; justify-content:center; padding:24px;
        }
        #diffModal.show{ display:flex; }
        .diff-panel{
          background:var(--panel); border:1px solid var(--border); border-radius:14px;
          width:100%; max-width:1200px; max-height:90vh; display:flex; flex-direction:column;
          box-shadow:var(--shadow); overflow:hidden;
        }
        .diff-panel-head{
          display:flex; justify-content:space-between; align-items:center;
          padding:12px 18px; border-bottom:1px solid var(--border); background:var(--panel-2);
        }
        .diff-panel-head h3{ margin:0; font-size:14px; color:var(--text); }
        .diff-panel-head .hint{ font-size:11.5px; color:var(--muted); }
        .diff-close-btn{ appearance:none; border:1px solid var(--border); background:var(--panel-2);
          color:var(--text); border-radius:8px; padding:5px 10px; cursor:pointer; font-size:12px; }
        .diff-close-btn:hover{ border-color:var(--accent); }
        .diff-panel-head{ flex-wrap:wrap; gap:8px; }
        .diff-nav{ display:flex; align-items:center; gap:8px; margin-left:auto; }
        .diff-nav button{ appearance:none; border:1px solid var(--border); background:var(--panel-2);
          color:var(--text); border-radius:8px; padding:5px 10px; cursor:pointer; font-size:12px; }
        .diff-nav button:hover{ border-color:var(--accent); }
        .diff-nav button:disabled{ opacity:.4; cursor:not-allowed; }
        .diff-nav .diff-counter{ font-size:12px; color:var(--muted); font-family:Consolas,Monaco,"Courier New",monospace; min-width:5ch; text-align:center; }
    
        .diff-scroll{ flex:1; overflow:auto; }
        .diff-header-row{ display:grid; grid-template-columns:1fr 1fr; position:sticky; top:0; z-index:1; background:var(--panel-2); }
        .diff-col-label{ padding:6px 12px; font-size:11px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); border-bottom:1px solid var(--border); }
        .diff-col-label.b{ border-left:1px solid var(--border); }
    
        .diff-grid{ display:grid; grid-template-columns:1fr 1fr; }
        .diff-cell{ font-family:Consolas,Monaco,"Courier New",monospace; font-size:12.5px;
          padding:2px 12px; white-space:pre-wrap; word-break:break-word; min-height:1.5em; }
        .diff-cell.b{ border-left:1px solid var(--border); }
    
        .diff-equal{ color:var(--text); }
        .diff-empty{ background:repeating-linear-gradient(45deg, transparent, transparent 6px, rgba(255,255,255,.02) 6px, rgba(255,255,255,.02) 12px); }
        .diff-removed{ background:rgba(255,107,107,.16); color:var(--text); }
        .diff-added{ background:rgba(47,182,124,.16); color:var(--text); }
        .diff-modified{ background:rgba(224,178,58,.16); color:var(--text); }
        .diff-single{ padding:14px 18px; font-family:Consolas,Monaco,"Courier New",monospace; font-size:12.5px; white-space:pre-wrap; word-break:break-word; }
    
        @keyframes diff-flash-anim { 0%,100%{ box-shadow:inset 0 0 0 2px transparent; } 50%{ box-shadow:inset 0 0 0 2px var(--accent); } }
        .diff-flash{ animation: diff-flash-anim 0.5s ease 2; }
        .diff-col:last-child{ border-right:none; }
        .diff-col-label{ position:sticky; top:0; background:var(--panel-2); padding:6px 12px;
          font-size:11px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted);
          border-bottom:1px solid var(--border); }
        .diff-line{ font-family:Consolas,Monaco,"Courier New",monospace; font-size:12.5px;
          padding:2px 12px; white-space:pre-wrap; word-break:break-word; min-height:1.5em; }
        .diff-equal{ color:var(--text); }
        .diff-empty{ background:repeating-linear-gradient(45deg, transparent, transparent 6px, rgba(255,255,255,.02) 6px, rgba(255,255,255,.02) 12px); }
        .diff-removed{ background:rgba(255,107,107,.16); color:var(--text); }
        .diff-added{ background:rgba(47,182,124,.16); color:var(--text); }
        .diff-modified{ background:rgba(224,178,58,.16); color:var(--text); }
        .diff-single{ padding:14px 18px; font-family:Consolas,Monaco,"Courier New",monospace;
          font-size:12.5px; white-space:pre-wrap; word-break:break-word; }
        /* =========================================================================
           1. CSS - add to the same block as the other #diffModal rules
           ========================================================================= */
    
    
        body.modal-open{ overflow:hidden; }
    
        /* or v2 CSS - update the scroll-lock rule to cover both html and body: */
        /*
        html.modal-open, body.modal-open { overflow: hidden; height: 100%; }
        */
    
            /*-- CSS - add to the <style> block: */
        .quicknav{
          display:grid;
          grid-template-columns:repeat(4, 1fr);
          height:24px;
          margin-top:10px;
          overflow:hidden;
          border:1px solid var(--border);
          border-radius:6px;
          background:var(--panel-2);
        }
        .quicknav a{
          display:grid;
          place-items:center;
          min-width:0;
          border-right:1px solid var(--border);
          color:var(--muted);
          text-decoration:none;
          font-size:10px;
          font-weight:700;
          letter-spacing:.04em;
          line-height:1;
          transition:background .15s,color .15s;
        }
        .quicknav a:last-child{ border-right:0; }
        .quicknav a:nth-child(1){ background:color-mix(in srgb,var(--accent),transparent 92%); }
        .quicknav a:nth-child(2){ background:color-mix(in srgb,var(--warn),transparent 94%); }
        .quicknav a:nth-child(3){ background:color-mix(in srgb,var(--override),transparent 94%); }
        .quicknav a:nth-child(4){ background:color-mix(in srgb,var(--success),transparent 94%); }
        .quicknav a:hover,
        .quicknav a:focus-visible{
          background:color-mix(in srgb,var(--accent),transparent 80%);
          color:var(--text);
          outline:none;
    
        }
        #folderFilters {
          min-width: min(360px, 100%);
        }
    
        .filter-section-head {
          display: flex;
          align-items: center;
          justify-content: space-between;
          gap: 10px;
        }
    
        .filter-section-head h3 {
          margin: 0;
        }
    
        .folder-filter-actions {
          display: flex;
          gap: 5px;
        }
    
        .folder-filter-actions button {
          padding: 3px 7px;
          border: 1px solid var(--border);
          border-radius: 4px;
          background: var(--panel-2);
          color: var(--muted);
          cursor: pointer;
          font-size: 11px;
        }
    
        .folder-filter-actions button:hover {
          color: var(--text);
          border-color: var(--accent);
        }
    
    
    
        .folder-filter-list {
          display: grid;
          grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
          gap: 4px 10px;
    
          max-height: 180px;
          overflow-y: auto;
    
          padding: 7px;
          border: 1px solid var(--border);
          border-radius: 6px;
          background: color-mix(in srgb, var(--panel-2), transparent 35%);
        }
    
        .folder-filter-item {
          display: flex;
          align-items: center;
          min-width: 0;
          gap: 6px;
    
          color: var(--text);
          cursor: pointer;
          font-size: 12px;
        }
    
        .folder-filter-item input {
          flex: 0 0 auto;
          margin: 0;
        }
    
        .folder-filter-item span {
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
        }
    
    
        .loading-overlay {
      position: fixed;
      inset: 0;
      background: rgba(3, 7, 16, .72);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 9998;
    }
    .loading-overlay.active {
      display: flex;                 /* only visible when .active is added */
    }
    
    .loading-panel {
      min-width: 260px;
      max-width: 360px;
      padding: 14px 18px 12px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: var(--panel-2);
      box-shadow: var(--shadow);
      color: var(--text);
      font-size: 13px;
    }
    
    .loading-spinner {
      width: 18px;
      height: 18px;
      border-radius: 999px;
      border: 2px solid rgba(255,255,255,.15);
      border-top-color: var(--accent);
      animation: spin 0.7s linear infinite;
      margin-bottom: 8px;
    }
    
    .loading-text {
      margin-bottom: 6px;
    }
    
    .loading-bar {
      width: 100%;
      height: 4px;
      border-radius: 999px;
      background: rgba(255,255,255,.08);
      overflow: hidden;
    }
    
    .loading-bar-fill {
      width: 0%;
      height: 100%;
      border-radius: inherit;
      background: var(--accent);
      transition: width .15s linear;
    }
    
    @keyframes spin {
      to { transform: rotate(360deg); }
    }

    