/* MD_FILE_VERSION: 1.0.032 | CHANGED: 2026-05-20 18-33-21 */
/* Copyright Information
 * =====================
 * Copyright (c) 2026, The Scripps Research Institute
 * Developed by Dr. Gennadii Grabovyi
 */

/* Analogs table sticky header + frozen original row */
#analogsTbl thead th {
  position: sticky;
  top: 0;
  background: var(--thead);
  /* Tight but readable padding; symmetric so text stays centered while leaving room for the sort arrow */
  padding: 8px 24px;
  z-index: 6;
  user-select: none;
  cursor: pointer;
  text-align: center;
  vertical-align: middle;
  /* Keep headers single-line and avoid forced breaks so columns size to content */
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}
#analogsTbl td {
  padding: 6px 8px;
  background: var(--row);
  vertical-align: middle;
  text-align: center;
  /* Keep data cells single-line by default; inner helpers (e.g., stack-links) can manage vertical layout */
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}
#analogsTbl td.num { text-align: center; }
#analogsTbl tr:nth-child(odd) td { background: var(--row-alt); }

/* ===== Frozen columns (left-pinned block) ===== */
#tbl thead th.frozen-col,
#tbl tbody td.frozen-col{
  position: sticky;
  left: 0;                 /* actual pixel offsets set via JS */
  background-clip: padding-box;
}

/* Keep header above everything; body cells above normal cells */
#tbl thead th.frozen-col{ z-index: 30; }
#tbl tbody td.frozen-col{ z-index: 4; }

/* While dragging a column, ensure the dragged column stays above other sticky cells.
   Without this, equal z-index values allow DOM order to win, which can cause the dragged
   frozen-column cells to appear *under* neighbors when dragging to the right. */
body.md-col-dragging #tbl thead th.md-col-dragging-col{ z-index: 70; }
/* Keep normal-row drag previews below sticky frozen/compare rows so scrolled rows can't "cover" them. */
body.md-col-dragging #tbl tbody td.md-col-dragging-col{ z-index: 5; }
/* But the dragged cells inside sticky rows must stay above other sticky cells while dragging. */
body.md-col-dragging #tbl tbody tr.frozen-row td.md-col-dragging-col{ z-index: 22; }
body.md-col-dragging #tbl tbody tr.frozen-row td.md-col-dragging-col.frozen-col{ z-index: 24; }

/* Faint right-edge shadow on the last frozen column to mark boundary */
#tbl thead th.frozen-boundary,
#tbl tbody td.frozen-boundary{
  box-shadow: none;
  border-right: var(--tbl-grid-frozen-boundary-w) solid var(--tbl-grid-frozen-boundary);
}

/* Keep the frozen-column boundary divider color stable in the sticky header while scrolling. */
#tbl thead th.frozen-boundary{
  background-clip: border-box;
}

  /* Frozen rows in the main molecular grid */
  #tbl tbody tr.frozen-row td{
    position: sticky;                 /* top offset will be set by JS */
    background: var(--hl-frozen) !important;    /* theme-driven */
    border-bottom: var(--tbl-grid-header-w) solid var(--tbl-grid-header);
    z-index: 6;
  }
  /* Intersection: cells that are both in a frozen row and a frozen column
     should sit above other body cells (including other frozen rows/cols). */
  #tbl tbody tr.frozen-row td.frozen-col{
    z-index: 8;
  }

/* Comparison reference row: pinned at top */
#tbl tbody tr.compare-ref-row td{
  background: var(--hl-compare) !important;   /* theme-driven */
}

/* Diff highlight vs comparison reference row (used by residue cells). */
#tbl tbody td.diff{
  box-shadow: inset 0 0 0 2px rgba(245, 158, 11, 0.85);
}

/* Selected (checked) rows: subtle bluish highlight (except for frozen/compare rows) */
  #tbl tbody tr.sel-row:not(.frozen-row):not(.compare-ref-row) td{
    background: var(--hl-selected) !important;
  }

  /* Cell range selection (Excel-like) */
  #tbl td.cell-sel, #tbl th.cell-sel{
    background: var(--hl-selected) !important;
  }
  /* subtle border to read the selected rectangle */
  #tbl td.cell-sel{
    outline: 1px solid rgba(37,99,235,0.35);
    outline-offset: -1px;
  }
  /* ensure selection header inherits sticky behavior from thead */
  /*  */

/* Frozen original row (index 0 in tbody) */
#analogsTbl tbody tr.original-row td {
  position: sticky;
  /* Slightly overlap the header border to avoid a visible gap */
  top: calc(var(--analogs-header-h, 36px) - 1px); /* dynamic header height minus 1px */
  background: var(--hl-frozen) !important; /* theme-driven */
  z-index: 5;
  border-bottom: var(--tbl-grid-header-w) solid var(--tbl-grid-header);
}

/* Small structure box for analogs */
.svgbox-sm {
  width: 140px; height: var(--analogs-row-h); display:flex; align-items:center; justify-content:center;
    background: var(--struct-bg); border:0; border-radius:0;
    /* Fallback padding (CSS % uses width for all sides; overridden below where supported) */
    padding: 5%;
    box-sizing: border-box;
}
/* True 5% per-side padding for small structure boxes (analogs modal, etc.) */
@supports (width: 1cqw) and (height: 1cqh){
  .svgbox-sm{ padding: 0; container-type: size; }
  .svgbox-sm > svg{
    width: max(0px, calc(100% - 10cqw)) !important;
    height: max(0px, calc(100% - 10cqh)) !important;
  }
}

/* Stacked link list */
.stack-links a {
  display:block; text-decoration:none; color:#2563eb; margin-bottom:4px;
  word-break:break-word;
}
.stack-links a:last-child { margin-bottom:0; }

/* Constrain Boc/Fmoc lists so rows don't grow; scroll inside the cell */
#analogsTbl td.col-boc .stack-links,
#analogsTbl td.col-fmoc .stack-links{
  max-height: var(--analogs-row-h);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px; /* space for scrollbar */
}

/* ---- Analogs filters UI ---- */
#analogsFiltersBar{
  display:none;            /* shown only when filters active */
  gap:8px; flex-wrap:wrap; align-items:center; margin:6px 0 8px;
}
.filter-chip{
  display:inline-flex; align-items:center; gap:6px;
  padding:4px 8px; border:1px solid var(--line-dark); border-radius:999px;
  background:#eef2ff; color:#1e3a8a; font-size:12px;
}
.filter-chip button{
  border:0; background:transparent; cursor:pointer; color:#1e3a8a; font-weight:700;
}

/* ===== Right-click menus (context menus + submenus) ===== */
.md-menu{
  position:fixed;
  display:none;
  min-width:0;
  width:max-content;
  background:var(--panel);
  border:1px solid var(--line-dark);
  border-radius:8px;
  box-shadow:0 8px 24px rgba(0,0,0,0.18);
  overflow:hidden;
}

/* z-index order */
#ctxMenu{ z-index:60; }
#analogsHdrMenu,
#colHdrMenu,
#rowMenu,
#tabRenameMenu{ z-index:70; }
#colHdrDataViewMenu{ z-index:71; }
#colHdrDataViewExtMenu,
#rtumsMenu{ z-index:72; }
#colHdrFilterSelection,
#searchCompoundsFilterSelection,
#reagentsCatalogFilterSelection,
#reagentsCatalogSearchSettingsMenu{ z-index:73; }
#reagentsCatalogRecentWindowMenu,
#mdStructFilterMenu{ z-index:74; }

/* ===== User comments modal ===== */
.md-comments-modal{
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.42);
  z-index: 140;
  padding: 18px;
}
.md-comments-modal.md-open{ display: flex; }
.md-comments-card{
  width: min(760px, 100%);
  max-height: min(82vh, 920px);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line-dark);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
  overflow: hidden;
}
.md-comments-head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
}
.md-comments-title-wrap{ min-width: 0; }
.md-comments-title{
  font-size: 18px;
  font-weight: 700;
}
.md-comments-subtitle{
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  word-break: break-word;
}
.md-comments-close-x{
  flex: 0 0 auto;
  min-width: 84px;
}
.md-comments-error{
  margin: 10px 16px 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(185, 28, 28, 0.18);
  background: rgba(254, 242, 242, 0.9);
  color: #991b1b;
  font-size: 13px;
}
.md-comments-body{
  flex: 1 1 auto;
  overflow: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.md-comments-actions{
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
}
.md-comments-empty{
  padding: 18px 14px;
  border: 1px dashed var(--line-dark);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}
.md-comment-card{
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 92%, white 8%);
}
.md-comment-meta{
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.md-comment-text{
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
}
.md-comment-textarea{
  width: 100%;
  min-height: 96px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  background: var(--panel);
  color: var(--fg);
  font: inherit;
  line-height: 1.45;
}
.md-comment-textarea-lg{
  min-height: 160px;
}
.md-comment-card-actions{
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.md-comments-display{
  cursor: pointer;
}
.md-comments-scrollbox{
  min-height: 40px;
}

/* ===== Internal auth / admin modals ===== */
.md-auth-modal{
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.42);
  z-index: 145;
  padding: 18px;
}

.md-auth-modal.md-open{
  display: flex;
}

.md-auth-welcome-card{
  --md-dlg-width: 480px;
  width: min(480px, calc(100vw - 28px));
}

.md-auth-welcome-hdr{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.md-auth-welcome-form{
  margin-top: 8px;
  row-gap: 8px;
}

.md-auth-welcome-actions{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: nowrap;
}

.md-auth-welcome-actions-left{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

@media (max-width: 720px){
  .md-auth-welcome-actions{
    flex-wrap: wrap;
  }
  .md-auth-welcome-actions-left{
    flex-wrap: wrap;
  }
}

.md-auth-dialog-card{
  --md-dlg-width: 460px;
  width: min(460px, calc(100vw - 28px));
}

.md-auth-dialog-actions{
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.md-auth-admin-card{
  width: min(1440px, calc(100vw - 28px));
  max-height: min(92vh, 1080px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line-dark);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}

.md-auth-admin-header{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.md-auth-admin-title-wrap{
  min-width: 0;
}

.md-auth-admin-title{
  font-size: 24px;
  font-weight: 400;
  line-height: 1.1;
}

.md-auth-admin-actions{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.md-auth-inline-error{
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(185, 28, 28, 0.18);
  background: rgba(254, 242, 242, 0.92);
  color: #991b1b;
  font-size: 13px;
}

.md-auth-confirm-actions{
  justify-content: flex-end;
}

@media (max-width: 900px){
  .md-auth-admin-card{
    width: min(100vw, calc(100vw - 16px));
    max-height: calc(100vh - 16px);
    padding: 14px;
  }
  .md-auth-admin-title{
    font-size: 24px;
  }
}

/* Menu row base style */
.md-menu > button,
.md-menu > .md-menu-row{
  box-sizing:border-box;
  width:100%;
  text-align:left;
  padding:8px 10px;
  border:0;
  margin:0;
  background:var(--panel);
  color:var(--fg);
  cursor:pointer;
  white-space:nowrap;
  border-radius:0 !important; /* override global button rounding */
  transition: background-color .12s ease, color .12s ease;
}
.md-menu > button{ display:block; }
.md-menu > .md-menu-row{ display:flex; align-items:center; gap:6px; }
.md-menu > .md-menu-row > span{ white-space:nowrap; }

/* Thin full-width separators between rows (no trailing separator) */
.md-menu > button,
.md-menu > .md-menu-row{
  border-bottom:1px solid var(--line-dark);
}
.md-menu > button.md-menu-item-last,
.md-menu > .md-menu-row.md-menu-item-last,
.md-menu > button:last-child,
.md-menu > .md-menu-row:last-child{
  border-bottom:0;
}

.md-menu > button:disabled{
  cursor:not-allowed;
  opacity:0.55;
}

.md-menu .md-menu-danger{
  color:#b91c1c;
  font-weight:700;
}

/* Hover */
.md-menu > button:hover:not(:disabled),
.md-menu > .md-menu-row:hover{
  background-color:#f1f5f9;
}
:root[data-theme="dark"] .md-menu > button:hover:not(:disabled),
:root[data-theme="dark"] .md-menu > .md-menu-row:hover{
  background-color: var(--bg);
}

/* Active selection highlight (Data view + EXT submenus) */
#colHdrDataViewMenu .active,
#colHdrDataViewExtMenu .active{
  background-color: color-mix(in srgb, var(--accent) 14%, var(--panel)) !important;
  box-shadow: inset 3px 0 0 var(--accent);
}
#colHdrDataViewMenu .active:hover,
#colHdrDataViewExtMenu .active:hover{
  background-color: color-mix(in srgb, var(--accent) 18%, var(--panel)) !important;
}

.md-menu-input{
  width:44px;
  padding:1px 6px;
  border:1px solid var(--line-dark);
  border-radius:6px;
  background:#bfdbfe;
  color:#0f172a;
  font: inherit;
  line-height: 1.2;
}
.md-menu-input.md-dp-box{
  width:28px;
  padding:1px 0;
  text-align:center;
  cursor:text;
}
.md-menu-input:focus{
  outline: 2px solid #3b82f6;
  outline-offset: 1px;
}
:root[data-theme="dark"] .md-menu-input{
  background:#1e3a8a;
  color:#e0e7ff;
  border-color:#3b82f6;
}

.md-dv-ext-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width: 2.2em;
  padding:1px 6px;
  border:1px solid var(--line-dark);
  border-radius:6px;
  background:#bfdbfe;
  color:#0f172a;
  cursor:pointer;
  user-select:none;
}
:root[data-theme="dark"] .md-dv-ext-badge{
  background:#1e3a8a;
  color:#e0e7ff;
  border-color:#3b82f6;
}

.md-dv-kind-badge{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:1px;
  min-width: 7.2em;
  padding:2px 8px;
  border:1px solid var(--line-dark);
  border-radius:8px;
  background:#bfdbfe;
  color:#0f172a;
  cursor:pointer;
  user-select:none;
  font: inherit;
  line-height: 1.05;
  flex: 0 0 auto;
}
.md-dv-kind-badge:focus{
  outline: 2px solid #3b82f6;
  outline-offset: 1px;
}
.md-dv-kind-badge .md-dv-kind-main{
  font-weight:400;
  font-size:12px;
}
.md-dv-kind-badge .md-dv-kind-sub{
  font-size:10px;
  opacity:0.85;
}
:root[data-theme="dark"] .md-dv-kind-badge{
  background:#1e3a8a;
  color:#e0e7ff;
  border-color:#3b82f6;
}

/* Data view menu: disable report until Avg/SD kinds match */
#colHdrDataViewMenu .md-dv-disabled{
  cursor:not-allowed;
  opacity:0.55;
}
#colHdrDataViewMenu .md-dv-disabled:hover{
  background: var(--panel);
}
:root[data-theme="dark"] #colHdrDataViewMenu .md-dv-disabled:hover{
  background: var(--panel);
}

/* ===== Filter pane: column picker menu ===== */
#colHdrFilterSelection{
  width: min(360px, 92vw);
  max-height: min(360px, 55vh);
  overflow:auto;
}
#colHdrFilterSelection .md-filter-colhdr-sticky{
  position:sticky;
  top:0;
  z-index:1;
  /* Match the Filter action button typography. */
  font-size:13px;
  font-weight:500;
  line-height:1;
  cursor:default;
  user-select:none;
  background: var(--accent);
  color:#fff;
  /* Keep the sticky row visually consistent with menu padding. */
  padding:8px 10px;
}
#colHdrFilterSelection .md-filter-colhdr-sticky:hover{
  background: var(--accent);
}

/* ===== Search Compounds pane: filter picker menu ===== */
#searchCompoundsFilterSelection{
  width: min(420px, 92vw);
  max-height: min(420px, 60vh);
  overflow:auto;
}
#searchCompoundsFilterSelection .md-filter-colhdr-sticky{
  position:sticky;
  top:0;
  z-index:1;
  font-size:13px;
  font-weight:500;
  line-height:1;
  cursor:default;
  user-select:none;
  background: var(--accent);
  color:#fff;
  padding:8px 10px;
}
#searchCompoundsFilterSelection .md-search-compounds-colhdr{
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
#searchCompoundsFilterSelection .md-search-compounds-colhdr-title{
  flex:0 1 auto;
  min-width:0;
}
#searchCompoundsFilterSelection .md-search-compounds-type-controls{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:12px;
  flex:0 0 auto;
  min-width:0;
  flex-wrap:wrap;
}
#searchCompoundsFilterSelection .md-search-compounds-type-option{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:12px;
  font-weight:500;
  line-height:1.1;
  cursor:pointer;
  user-select:none;
  white-space:nowrap;
}
#searchCompoundsFilterSelection .md-search-compounds-type-option input{
  margin:0;
  width:14px;
  height:14px;
  accent-color:#ffffff;
}
#searchCompoundsFilterSelection .md-search-compounds-type-option input:disabled{
  cursor:not-allowed;
}
#searchCompoundsFilterSelection .md-filter-colhdr-sticky:hover{
  background: var(--accent);
}

/* ===== Reagents Catalog pane: filter picker menu ===== */
#reagentsCatalogFilterSelection{
  width: min(420px, 92vw);
  max-height: min(420px, 60vh);
  overflow:auto;
}
#reagentsCatalogFilterSelection .md-filter-colhdr-sticky{
  position:sticky;
  top:0;
  z-index:1;
  font-size:13px;
  font-weight:500;
  line-height:1;
  cursor:default;
  user-select:none;
  background: var(--accent);
  color:#fff;
  padding:8px 10px;
}
#reagentsCatalogFilterSelection .md-filter-colhdr-sticky:hover{
  background: var(--accent);
}

/*  */

/*  */

/* ===== RTUMs Log Modal ===== */
#rtumsLogModal{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.45);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:80;
}
#rtumsLogModal .rtums-dlg{
  width: 900px;
  max-width: 96vw;
  background: var(--panel);
  border: 1px solid var(--line-dark);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  overflow: hidden;
}
#rtumsLogModal .rtums-hdr{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border-bottom:1px solid var(--line-dark);
}
#rtumsLogModal .rtums-title{
  font-weight:700;
  font-size:14px;
}
#rtumsLogModal .rtums-body{
  max-height: 60vh;
  overflow:auto;
}
#rtumsLogTbl{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  table-layout:fixed;
}
#rtumsLogTbl th,
#rtumsLogTbl td{
  padding:8px 10px;
  vertical-align:top;
}
#rtumsLogTbl th{
  position:sticky;
  top:0;
  z-index:1;
  background:var(--panel);
  user-select:none;
  cursor:pointer;
  text-align:left;
}
#rtumsLogTbl th[data-key="ts"]{ width: 230px; }
#rtumsLogTbl th.sort-asc::after{ content:" \25B2"; font-size:11px; opacity:0.85; }
#rtumsLogTbl th.sort-desc::after{ content:" \25BC"; font-size:11px; opacity:0.85; }
#rtumsLogTbl td.ts{
  font-family: ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono","Courier New",monospace;
  white-space:nowrap;
}
#rtumsLogTbl td.msg{
  white-space:pre-wrap;
  word-break:break-word;
}
#rtumsLogTbl tbody tr:nth-child(odd) td{ background: var(--row-alt); }
#rtumsLogTbl tbody tr:nth-child(even) td{ background: var(--row); }

/* Range slider popover */
#rangePopover{
  position:fixed;
  z-index:75;
  display:none;
  width:min(430px, 96vw);
  max-width:96vw;
  background:var(--panel);
  border:1px solid var(--line-dark);
  border-radius:12px;
  box-shadow:0 10px 32px rgba(0,0,0,0.22);
  padding:10px 12px;
}

#rangePopover .rg-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:6px; }
#rangePopover .rg-title{
  font-size:14px;
  font-weight:700;
  letter-spacing:0.1px;
  line-height:1.2;
  flex:1;
  min-width:0;
}
#rangePopover .rg-actions-top{ display:flex; align-items:center; justify-content:flex-end; gap:8px; flex-wrap:nowrap; }

#rangePopover .rg-btn{
  box-sizing:border-box;
  width:88px;
  height:32px;
  padding:0 10px;
  border-radius:8px;
  font-size:14px;
  line-height:1;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  white-space:nowrap;
}
#rangePopover .rg-btn.primary{ font-weight:700; }
#rangePopover .rg-btn.rg-outline{ color:var(--fg); }
#rangePopover .rg-btn.rg-danger{ background:#EA580C; border:0; color:#fff; font-weight:700; }

.rg-row{ display:flex; align-items:center; gap:10px; }
.rg-box{ width:52px }

.rg-box input{
  width:100%;
  padding:4px 6px;
  border-radius:6px;
  border:1px solid var(--line-dark);
  text-align:center;
  font:12px/1.2 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;
}

/* Completely remove native spinners in Edge/Chrome */
.rg-box input[type=number]::-webkit-inner-spin-button,
.rg-box input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.rg-box input[type=number] {
  -moz-appearance: textfield; /* Firefox */
}

.rg-track{
  position: relative;
  flex: 1;
  height: var(--rg-track-h);   /* use the variable */
  display: flex;
  align-items: center;
  overflow: visible;
}

/* Grey bar  sits under everything and never steals clicks */
.rg-track::before{
  content:"";
  position:absolute; left:0; right:0; top:50%;
  height: var(--rg-bar);
  transform: translateY(-50%);
  background:#cbd5e1; border-radius:999px;
  z-index:0;
  pointer-events: none;
}

/* Orange fill between handles  under the inputs, no pointer capture */
.rg-fill{
  position:absolute; left:0; width:0; top:50%;
  height: var(--rg-bar);
  transform: translateY(-50%);
  background:#7F7F7F; border-radius:999px;
  z-index:1;
  pointer-events: none;
}

.rg-track input[type="range"]{
  -webkit-appearance:none; appearance:none;
  position:absolute;
  /* extend by half of the *visual* thumb width so the whole circle is clickable at the ends */
  left:  calc(var(--rg-thumb-vis) / -2);
  right: calc(var(--rg-thumb-vis) / -2);
  top:50%;
  transform: translateY(-50%);
  width:auto;
  height: var(--rg-track-h);
  background:transparent;
  border:0; outline:none; box-shadow:none;
  margin:0; padding:0;
  z-index:2;

  /* only thumbs receive pointer events so inputs dont steal each others clicks */
  pointer-events: none;
}

.rg-track input[type="range"]::-webkit-slider-runnable-track{
  height:8px;                                   /* same as your grey bar */
  background:transparent;
  border:0; box-shadow:none;
}
.rg-track input[type="range"]::-moz-range-track{
  height:8px;
  background:transparent;
  border:0; box-shadow:none;
}

.rg-track input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none; appearance:none;
  width: var(--rg-thumb);
  height: var(--rg-thumb);
  border-radius:50%;
  background:#7F7F7F;
  border: var(--rg-thumb-border) solid #6a6a6a;
  cursor:pointer;

  /* perfect vertical centering: use visual diameter (thumb + borders) */
  margin-top: calc((var(--rg-thumb-vis) - var(--rg-bar)) / -3);

  /* let the thumb, not the input, receive the click */
  pointer-events: auto;
}
.rg-track input[type="range"]::-moz-range-thumb{
  width: var(--rg-thumb);
  height: var(--rg-thumb);
  border-radius:50%;
  background:#7F7F7F;
  border: var(--rg-thumb-border) solid #6a6a6a;
  cursor:pointer;
  pointer-events: auto;
}

#rangePopover .rg-toggles{ display:flex; justify-content:flex-end; gap:10px; margin-top:10px; flex-wrap:nowrap; }
#rangePopover .rg-toggle-group{ display:flex; gap:8px; }
#rangePopover .rg-toggle[aria-pressed="true"]{ background:#00B050; border-color:#00B050; color:#fff; font-weight:700; }

/* Dont shrink printouts */
@media print{
  html, body { zoom: 1 !important; }
}

/* Firefox */
* {
  /* wider than 'thin' for better usability */
  scrollbar-width: auto;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* Chromium / Safari */
*::-webkit-scrollbar       { width: var(--scrollbar-size, 16px); height: var(--scrollbar-size, 16px); }
*::-webkit-scrollbar-track { background: var(--scrollbar-track); }
*::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
  border-radius: 8px;
  border: 3px solid transparent;   /* colored center, transparent edges */
  background-clip: content-box;
}
*::-webkit-scrollbar-corner { background: var(--scrollbar-track); }

  /* Loading ellipsis animation inside table cells */
  .ellipsis { display:inline-block; width:0ch; overflow:hidden; white-space:nowrap; vertical-align:middle; }
  .ellipsis::before { content:'...'; }
  @keyframes ellipsisAnim { 0% { width:0ch; } 33% { width:1ch; } 66% { width:2ch; } 100% { width:3ch; } }
  .loading .ellipsis { animation: ellipsisAnim 1.2s steps(3, end) infinite; }

/* ===== Simple dialog cards (Welcome/Login + small dialogs) ===== */
.dlg-export{
  width: min(var(--md-dlg-width, 300px), 94vw);
  box-sizing: border-box;
  padding: 14px 14px 12px;
  border-radius: 14px;

  /* Light glass */
  background: var(--panel);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 18px 60px rgba(0,0,0,0.25);

  backdrop-filter: blur(10px) saturate(1.20);
  -webkit-backdrop-filter: blur(10px) saturate(1.20);
}
:root[data-theme="dark"] .dlg-export{
  /* Dark glass */
  background: var(--panel);
  background: rgba(42, 44, 52, 0.78);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 18px 70px rgba(0,0,0,0.55);
}

.dlg-export .hdr{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.dlg-export .hdr h3{ margin:0; font-size:18px; letter-spacing:0.2px; }
.dlg-export .actions{ display:flex; align-items:center; gap:8px; }

/* ===== Formula Column cells + modal ===== */
.md-formula-placeholder{
  color:var(--muted);
  opacity:0.72;
  font-style:italic;
}
.md-formula-soft-error{
  color:#b91c1c;
  background:rgba(254, 226, 226, 0.55);
  border-radius:6px;
  padding:2px 5px;
}
:root[data-theme="dark"] .md-formula-soft-error{
  color:#fecaca;
  background:rgba(127, 29, 29, 0.38);
}
.md-formula-modal{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  z-index:150;
  padding:18px;
  background:rgba(15, 23, 42, 0.42);
}
.md-formula-modal.md-open{ display:flex; }
.md-formula-card{
  position:relative;
  width:min(900px, calc(100vw - 36px));
  height:min(640px, calc(100vh - 36px));
  min-width:min(520px, calc(100vw - 28px));
  min-height:420px;
  display:flex;
  flex-direction:column;
  box-sizing:border-box;
  background:var(--panel);
  border:1px solid var(--line-dark);
  border-radius:14px;
  box-shadow:0 24px 60px rgba(15, 23, 42, 0.24);
  overflow:hidden;
}
.md-formula-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  border-bottom:1px solid var(--line-dark);
  background:var(--thead);
}
.md-formula-header h3{
  margin:0;
  min-width:0;
  font-size:18px;
  font-weight:700;
  letter-spacing:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.md-formula-actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex:0 0 auto;
}
.md-formula-body{
  flex:1 1 auto;
  min-height:0;
  display:grid;
  grid-template-columns:minmax(230px, 0.34fr) minmax(340px, 0.66fr);
  gap:12px;
  padding:12px;
  box-sizing:border-box;
}
.md-formula-panel{
  min-width:0;
  min-height:0;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.md-formula-panel-title{
  font-weight:400;
  font-size:18px;
  color:var(--fg);
}
.md-formula-table-wrap{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  border:1px solid var(--line-dark);
  border-radius:8px;
  background:var(--control-bg);
}
.md-formula-action-wrap{
  background:var(--panel);
  scrollbar-gutter:stable;
}
.md-formula-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  table-layout:fixed;
}
.md-formula-action-table{
  display:block;
  min-width:100%;
  border:0;
  border-right:1px solid var(--line-dark);
  border-radius:0;
  outline:0;
  box-shadow:none;
  background:transparent;
}
.md-formula-action-table tbody,
.md-formula-action-table tr,
.md-formula-action-table th,
.md-formula-action-table td{
  box-sizing:border-box;
}
.md-formula-action-table tbody{
  display:block;
}
.md-formula-action-table tr{
  display:grid;
  grid-template-columns:76px minmax(0, 1fr);
  width:100%;
}
.md-formula-action-table th,
.md-formula-action-table td{
  display:block;
  min-width:0;
}
.md-formula-action-table .md-formula-op-col{
  width:76px;
}
.md-formula-action-table .md-formula-desc-col{
  width:auto;
}
.md-formula-table tr{
  cursor:pointer;
}
.md-formula-table tr:not(.md-formula-section-row):hover,
.md-formula-table tr:not(.md-formula-section-row):focus{
  background:rgba(37, 99, 235, 0.08);
  outline:none;
}
.md-formula-action-table tr:not(.md-formula-section-row):hover{
  background:transparent;
}
.md-formula-action-table .md-props-item-cell:focus{
  outline:2px solid rgba(37,99,235,0.45);
  outline-offset:-2px;
}
.md-formula-table td{
  padding:6px 8px;
  border-bottom:1px solid var(--line);
  vertical-align:middle;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.md-formula-table tr:last-child td{
  border-bottom:0;
}
.md-formula-action-table th.md-formula-section-hdr{
  position:relative;
  background:var(--panel);
  border-bottom:var(--tbl-grid-header-w) solid var(--tbl-grid-header);
  padding:10px 10px;
  font-size:13px;
  font-weight:600;
  line-height:1.2;
  text-transform:uppercase;
  text-align:center;
  color:var(--fg);
  user-select:none;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  box-sizing:border-box;
  cursor:default;
}
:root:not([data-theme="dark"]) .md-formula-action-table th.md-formula-section-hdr{
  background:var(--props-cat-bg);
}
.md-formula-action-table th.md-formula-section-hdr::after{
  content:'';
  position:absolute;
  top:0;
  bottom:0;
  right:calc(-1 * var(--md-props-scrollbar-gutter, 0px));
  width:var(--md-props-scrollbar-gutter, 0px);
  background:inherit;
  border-bottom:var(--tbl-grid-header-w) solid var(--tbl-grid-header);
  pointer-events:none;
}
.md-formula-action-table .md-formula-section-row{
  display:block;
  position:sticky;
  top:0;
  z-index:20;
  cursor:default;
}
.md-formula-action-table .md-formula-section-hdr,
.md-formula-action-table td[colspan="2"]{
  grid-column:1 / -1;
  width:100%;
}
.md-formula-action-table .md-formula-section-row:hover,
.md-formula-action-table .md-formula-section-row:focus{
  background:transparent;
}
.md-formula-action-table .md-props-item-cell{
  font-size:13px;
  font-weight:400;
  line-height:1.2;
  color:var(--fg);
}
.md-formula-action-table tbody tr.md-formula-op-row:nth-child(even) td,
.md-formula-action-table tbody.md-formula-template-table tr:nth-child(even) td{
  background:var(--row-alt);
}
.md-formula-action-table tbody tr.md-formula-op-row:nth-child(odd) td,
.md-formula-action-table tbody.md-formula-template-table tr:nth-child(odd) td{
  background:var(--row);
}
.md-formula-action-table .md-props-item-cell:not(.md-props-empty):hover,
.md-formula-action-table tr:hover .md-props-item-cell{
  background:#f1f5f9;
}
:root[data-theme="dark"] .md-formula-action-table .md-props-item-cell:not(.md-props-empty):hover,
:root[data-theme="dark"] .md-formula-action-table tr:hover .md-props-item-cell{
  background:var(--bg);
}
.md-formula-action-table tr.md-formula-op-row:hover,
.md-formula-action-table tr.md-formula-op-row:focus{
  background:#f1f5f9;
}
.md-formula-action-table tr.md-formula-op-row:hover .md-props-item-cell,
.md-formula-action-table tr.md-formula-op-row:focus .md-props-item-cell,
.md-formula-action-table tr.md-formula-op-row:hover .md-props-item-cell:not(.md-props-empty),
.md-formula-action-table tr.md-formula-op-row:focus .md-props-item-cell:not(.md-props-empty){
  background:transparent;
}
.md-formula-action-table tr.md-formula-op-row:hover .md-formula-op-label,
.md-formula-action-table tr.md-formula-op-row:focus .md-formula-op-label{
  border-right-color:transparent;
}
:root[data-theme="dark"] .md-formula-action-table tr.md-formula-op-row:hover,
:root[data-theme="dark"] .md-formula-action-table tr.md-formula-op-row:focus{
  background:var(--bg);
}
.md-formula-op-label{
  font-weight:700;
  text-align:center;
  color:var(--fg);
}
.md-formula-template-label{
  color:var(--fg);
  font-weight:600;
}
.md-formula-action-table .md-formula-op-label,
.md-formula-action-table .md-formula-template-label{
  font-weight:400;
}
.md-formula-col-code{
  width:74px;
  font-weight:700;
  text-align:center;
  color:var(--fg);
}
.md-formula-op-desc,
.md-formula-col-name{
  color:var(--muted);
}
.md-formula-cols-table .md-formula-col-name{
  color:var(--fg);
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
}
.md-formula-col-label{
  flex:1 1 auto;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
}
.md-formula-col-meta{
  flex:0 0 auto;
  max-width:44%;
  padding:2px 6px;
  border:1px solid var(--line);
  border-radius:6px;
  background:var(--panel);
  color:var(--muted);
  font-size:11px;
  line-height:1.2;
  overflow:hidden;
  text-overflow:ellipsis;
}
.md-formula-editor-panel{
  gap:8px;
}
.md-formula-editor-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-width:0;
}
.md-formula-label{
  font-weight:400;
  font-size:18px;
}
.md-formula-format{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  min-width:0;
  flex:0 0 auto;
  flex-wrap:nowrap;
}
.md-formula-format-label{
  flex:0 0 auto;
  color:var(--muted);
  font-size:13px;
  line-height:1.15;
  white-space:nowrap;
}
.md-formula-format .md-formula-format-mode-btn,
.md-formula-format input[type="number"]{
  height:34px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--panel);
  color:var(--fg);
  font:inherit;
  font-size:13px;
  line-height:1.15;
  box-sizing:border-box;
  box-shadow:0 1px 2px rgba(15,23,42,0.06);
  transition:border-color .12s ease, box-shadow .12s ease, background-color .12s ease, color .12s ease, opacity .12s ease;
}
.md-formula-format .md-formula-format-mode{
  display:none;
}
.md-formula-format .md-formula-format-mode-btn{
  width:164px;
  max-width:164px;
  flex:0 0 164px;
  padding:6px 12px;
  display:inline-flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  overflow:hidden;
  text-align:left;
  white-space:nowrap;
  cursor:pointer;
}
.md-formula-format .md-formula-format-mode-btn::after{
  content:'';
  flex:0 0 auto;
  width:0;
  height:0;
  border-left:4px solid transparent;
  border-right:4px solid transparent;
  border-top:5px solid var(--muted);
}
.md-formula-format input[type="number"]{
  width:64px;
  flex:0 0 64px;
  padding:6px 7px;
  text-align:center;
}
.md-formula-format .md-formula-format-mode-btn:focus,
.md-formula-format input[type="number"]:focus{
  outline:none;
  border-color:rgba(37, 99, 235, 0.58);
  box-shadow:0 0 0 2px rgba(37, 99, 235, 0.18), 0 1px 2px rgba(15,23,42,0.06);
}
.md-formula-format .md-formula-format-mode-btn.md-open{
  border-color:rgba(37, 99, 235, 0.58);
  box-shadow:0 0 0 2px rgba(37, 99, 235, 0.14), 0 1px 2px rgba(15,23,42,0.06);
}
.md-formula-format input[type="number"]:disabled{
  color:var(--muted);
  background:var(--row-alt);
  border-color:var(--line);
  box-shadow:none;
  cursor:not-allowed;
  opacity:0.72;
}
.md-formula-format-menu{
  z-index:170;
  min-width:164px;
}
.md-formula-format-menu > button{
  font-size:13px;
  line-height:1.2;
}
.md-formula-format-menu > button.md-menu-selected{
  background:var(--hl-selected);
  font-weight:600;
}
:root[data-theme="dark"] .md-formula-format-menu > button.md-menu-selected{
  background:var(--hl-selected);
}
.md-formula-zeros{
  display:inline-flex;
  align-items:center;
  gap:5px;
  font-size:12px;
  color:var(--muted);
  white-space:nowrap;
}
.md-formula-expression-wrap{
  position:relative;
  width:100%;
  height:190px;
  min-height:96px;
  max-height:190px;
  flex:0 1 190px;
  border-radius:8px;
}
.md-formula-expression-wrap.md-formula-cm-active{
  overflow:hidden;
}
.md-formula-cm-host{
  width:100%;
  height:100%;
}
.md-formula-cm-host .cm-editor{
  height:100%;
  width:100%;
}
.md-formula-cm-host .cm-scroller{
  overflow:auto;
}
.md-formula-cm-host .cm-content{
  overflow-wrap:anywhere;
  word-break:normal;
}
.md-formula-cm-host .md-formula-cm-ref-highlight{
  background:#facc15;
  color:inherit;
  padding:0 1px;
  border-radius:2px;
}
.md-formula-cm-host .md-formula-cm-template-placeholder{
  background:#facc15;
  color:inherit;
  padding:0 1px;
  border-radius:2px;
  box-shadow:inset 0 -1px 0 rgba(120, 53, 15, 0.45);
}
.md-formula-cm-host .md-formula-cm-auto-value{
  background:rgba(100, 116, 139, 0.16);
  color:inherit;
  padding:0 1px;
  border-radius:2px;
  box-shadow:inset 0 -1px 0 rgba(100, 116, 139, 0.38);
}
:root[data-theme="dark"] .md-formula-cm-host .md-formula-cm-ref-highlight{
  background:rgba(250, 204, 21, 0.28);
  color:inherit;
}
:root[data-theme="dark"] .md-formula-cm-host .md-formula-cm-template-placeholder{
  background:rgba(250, 204, 21, 0.28);
  color:inherit;
  box-shadow:inset 0 -1px 0 rgba(254, 240, 138, 0.45);
}
:root[data-theme="dark"] .md-formula-cm-host .md-formula-cm-auto-value{
  background:rgba(148, 163, 184, 0.22);
  color:inherit;
  box-shadow:inset 0 -1px 0 rgba(148, 163, 184, 0.45);
}
.md-formula-expression-wrap.md-formula-cm-active .md-formula-expression-layer,
.md-formula-expression-wrap.md-formula-cm-active .md-formula-expression{
  display:none;
}
.md-formula-expression-layer,
.md-formula-expression{
  width:100%;
  height:100%;
  min-height:0;
  max-height:none;
  box-sizing:border-box;
  padding:8px 10px;
  border:1px solid var(--line-dark);
  border-radius:8px;
  font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size:13px;
  line-height:1.4;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  word-break:normal;
}
.md-formula-expression-layer{
  position:absolute;
  inset:0;
  margin:0;
  overflow:hidden;
  pointer-events:none;
  background:var(--control-bg);
  color:var(--fg);
}
.md-formula-expression{
  display:block;
  position:relative;
  resize:none;
  overflow-y:auto;
  overflow-x:hidden;
  background:transparent;
  border-color:transparent;
  color:transparent;
  caret-color:transparent;
}
.md-formula-expression:focus{
  outline:none;
}
.md-formula-expression-wrap:focus-within{
  outline:none;
}
.md-formula-expression-wrap:focus-within .md-formula-expression-layer{
  border-color:rgba(37, 99, 235, 0.58);
  box-shadow:0 0 0 1px rgba(37, 99, 235, 0.28);
}
:root[data-theme="dark"] .md-formula-expression-wrap:focus-within{
  outline:none;
}
:root[data-theme="dark"] .md-formula-expression-wrap:focus-within .md-formula-expression-layer{
  border-color:rgba(122, 162, 255, 0.7);
  box-shadow:0 0 0 1px rgba(122, 162, 255, 0.32);
}
.md-formula-expression::selection{
  background:rgba(37, 99, 235, 0.26);
  color:transparent;
}
.md-formula-expression-layer mark.md-formula-ref-highlight{
  background:#facc15;
  color:inherit;
  padding:0 1px;
  border-radius:2px;
}
.md-formula-expression-layer mark.md-formula-template-placeholder{
  background:#facc15;
  color:inherit;
  padding:0 1px;
  border-radius:2px;
  box-shadow:inset 0 -1px 0 rgba(120, 53, 15, 0.45);
}
.md-formula-expression-layer mark.md-formula-auto-value{
  background:rgba(100, 116, 139, 0.16);
  color:inherit;
  padding:0 1px;
  border-radius:2px;
  box-shadow:inset 0 -1px 0 rgba(100, 116, 139, 0.38);
}
:root[data-theme="dark"] .md-formula-expression-layer mark.md-formula-ref-highlight{
  background:rgba(250, 204, 21, 0.28);
  color:inherit;
}
:root[data-theme="dark"] .md-formula-expression-layer mark.md-formula-template-placeholder{
  background:rgba(250, 204, 21, 0.28);
  color:inherit;
  box-shadow:inset 0 -1px 0 rgba(254, 240, 138, 0.45);
}
:root[data-theme="dark"] .md-formula-expression-layer mark.md-formula-auto-value{
  background:rgba(148, 163, 184, 0.22);
  color:inherit;
  box-shadow:inset 0 -1px 0 rgba(148, 163, 184, 0.45);
}
.md-formula-caret{
  display:inline-block;
  width:0;
  height:1.22em;
  margin-left:-1px;
  border-left:2px solid var(--fg);
  vertical-align:-0.18em;
  animation:md-formula-caret-blink 1s steps(1, end) infinite;
}
:root[data-theme="dark"] .md-formula-caret{
  border-left-color:var(--fg);
}
@keyframes md-formula-caret-blink{
  0%, 49%{ opacity:1; }
  50%, 100%{ opacity:0; }
}
.md-formula-error{
  padding:6px 8px;
  border:1px solid rgba(185, 28, 28, 0.36);
  border-radius:8px;
  background:rgba(254, 226, 226, 0.78);
  color:#991b1b;
  font-size:12px;
}
:root[data-theme="dark"] .md-formula-error{
  background:rgba(127, 29, 29, 0.42);
  color:#fecaca;
  border-color:rgba(254, 202, 202, 0.34);
}
.md-formula-cols-slot{
  flex:1 1 auto;
  min-height:0;
  display:flex;
}
.md-formula-cols-slot .md-formula-table-wrap{
  width:100%;
}
.md-formula-empty-list{
  color:var(--muted);
  text-align:center;
}
.md-formula-resize-handle{
  position:absolute;
  right:-1px;
  bottom:-1px;
  width:24px;
  height:24px;
  border-radius:0 0 14px 0;
  opacity:0.9;
  cursor:nwse-resize;
  touch-action:none;
}
.md-formula-resize-handle::after{
  content:"";
  position:absolute;
  right:0;
  bottom:0;
  width:17px;
  height:17px;
  border-right:4px solid var(--line-dark);
  border-bottom:4px solid var(--line-dark);
  border-bottom-right-radius:12px;
  box-sizing:border-box;
}
body.md-formula-resizing,
body.md-formula-resizing *{
  cursor:nwse-resize;
  user-select:none;
}
@media (max-width: 760px){
  .md-formula-card{
    min-width:calc(100vw - 28px);
    width:calc(100vw - 28px);
    height:calc(100vh - 28px);
  }
  .md-formula-body{
    grid-template-columns:1fr;
    grid-template-rows:minmax(170px, 0.42fr) minmax(260px, 0.58fr);
  }
}

/* ===== SDF Import modal helpers ===== */
#sdfTagList .md-sdf-tag-row{
  padding: 6px 8px;
  border-radius: 8px;
}
#sdfTagList .md-sdf-tag-row:hover{
  background: rgba(0,0,0,0.04);
}
:root[data-theme="dark"] #sdfTagList .md-sdf-tag-row:hover{
  background: rgba(255,255,255,0.06);
}

#sdfTagList .md-sdf-tag-label{
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
  cursor:pointer;
}
#sdfTagList .md-sdf-tag-name{
  font-weight: 600;
}
#sdfTagList .md-sdf-tag-meta{
  margin-left:auto;
  font-size: 12px;
  white-space: nowrap;
}
#sdfTagList input.md-sdf-tag-cb{
  width: 16px;
  height: 16px;
}
