:root {
    --drawer-w: 520px;
    --border: #e6e6e6;
    --bg: #ffffff;
    --muted: #6b7280;
    --shadow: 0 10px 30px rgba(0,0,0,.12);
    --accent: #0b63ce;
  }
  /* ---------- Raw HTML modal ---------- */
.html-modal {
  position: fixed;
  inset: 0;
  z-index: 2100; /* above drawer */
  display: none;
}
.html-modal.open { display: block; }

.html-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
}

.html-modal-dialog {
  position: fixed;
  inset: 24px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.html-modal-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.html-modal-title {
  font-weight: 800;
  font-size: 14px;
}
.html-modal-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.html-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.html-toggle {
  font-size: 12px;
  color: #111;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafafa;
}

.html-modal-pre {
  margin: 0;
  padding: 12px;
  overflow-y: auto;   /* ✅ vertical scroll */
  overflow-x: hidden; /* 🚫 no horizontal scroll */
  flex: 1;
  background: #0b0f19; /* dark for code readability */
}

.html-modal-pre code {
  display: block;
  font-size: 12px;
  line-height: 1.35;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  white-space: pre-wrap; /* default wrap */
  word-break: break-word;
}
.html-modal-pre.nowrap code {
  white-space: pre;      /* no wrap */
  overflow-x: auto;      /* if you allow horizontal ONLY in nowrap mode */
}

.thumb-icon {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}
.thumb-icon.off {
  opacity: 0.25;
}
.sr-only{
  position:absolute;
  width:1px; height:1px;
  padding:0; margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}
.align_center{
    text-align: center;
}
  /* ---------- Smaller table font + tighter rows ---------- */
  #capturesTable {
    font-size: 12px;
  }
  #capturesTable thead th.dropdown {
    padding: 10px !important;
    vertical-align: middle;
    padding-right: 26px !important;
}
  #capturesTable thead th {
    padding: 8px 10px !important;
    vertical-align: bottom;
  }

  #capturesTable tbody td {
    padding: 6px 10px !important;
  }

  #capturesTable tbody tr { cursor: pointer; }
  #capturesTable tbody tr.selected {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
    background: rgba(11,99,206,.05);
  }

  .cell-domain {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
    white-space: nowrap;
  }
  .cell-clip {
    max-width: 420px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .pill {
    display: inline-block;
    padding: 1px 7px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 11px;
    line-height: 16px;
    background: #fafafa;
  }
  .pill.ok { border-color: rgba(16,185,129,.35); background: rgba(16,185,129,.08); }
  .pill.no { border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.08); }
  .pill.thumb { border-color: rgba(59,130,246,.35); background: rgba(59,130,246,.08); }

  /* ---------- Column filter dropdowns in header ---------- */
  th .col-filter {
    margin-top: 6px;
  }
  th select.col-filter {
    width: 100%;
    font-size: 11px;
    padding: 2px 6px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
  }

  /* ---------- Drawer overlays grid (no resize) ---------- */
  .drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--drawer-w);
    height: 100vh;
    background: var(--bg);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow);
    transform: translateX(102%);
    transition: transform .18s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    pointer-events: auto; /* drawer is interactive */
  }
  .drawer.open { transform: translateX(0); }

  /* Backdrop is visual only; does NOT block clicks on grid */
  .backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.10);
    z-index: 999;
    opacity: 0;
    pointer-events: none; /* IMPORTANT: allow clicking the grid while open */
    transition: opacity .18s ease;
  }
  .backdrop.open { opacity: 1; }

  .drawer-header {
    position: sticky;
    top: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .drawer-title {
    font-weight: 800;
    font-size: 15px;
    line-height: 1.1;
  }
  .drawer-sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
  }
  .drawer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .btn {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
  }
  .btn.primary {
    border-color: rgba(11,99,206,.35);
    background: rgba(11,99,206,.06);
  }

  .drawer-body {
    padding: 12px 14px 20px 14px;
    overflow: auto;
  }

  .thumb-img {
    width: 100%;
    max-height: 320px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fafafa;
  }
  .placeholder {
    padding: 10px;
    border: 1px dashed #ccc;
    border-radius: 12px;
    color: #666;
    background: #fcfcfc;
  }

  .kv {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 8px 10px;
    font-size: 12px;
  }
  .kv .k { font-weight: 700; color:#111; }
  .kv .v { word-break: break-word; }
  .kv .v.muted { color: var(--muted); }

  .section {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
  }
  .section h3 {
    font-size: 12px;
    margin: 0 0 8px 0;
    color: #111;
  }
/* Clickable thumb */
.thumb-img {
  cursor: zoom-in;
}
/* ---------- Image modal (vertical scroll only) ---------- */
.img-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
}

.img-modal.open {
  display: block;
}

/* Backdrop stays fixed */
.img-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
}

/* Dialog becomes the scroll container */
.img-modal-dialog {
  position: fixed;
  inset: 0;
  padding: 24px 16px;
  overflow-y: auto;     /* ✅ vertical scroll */
  overflow-x: hidden;   /* 🚫 no horizontal scroll */
  display: flex;
  justify-content: center;
  align-items: flex-start; /* start at top so scroll feels natural */
}

/* Image scales responsively */
#imgModalImg {
  max-width: 100%;
  height: auto;          /* allow natural height */
  border-radius: 12px;
  box-shadow: 0 15px 50px rgba(0,0,0,.35);
  background: #111;
  cursor: zoom-out;
}

/* Close button stays pinned */
.img-modal-close {
  position: fixed;
  top: 14px;
  right: 14px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.35);
  color: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 14px;
  cursor: pointer;
  z-index: 2100;
}
.img-modal-close:hover {
  background: rgba(0,0,0,.55);
}

  @media (max-width: 980px) {
    :root { --drawer-w: 92vw; }
  }
