/* styles.css */
/* ===== Base layout ===== */
body {
  font-family: Arial, sans-serif;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  height: 100vh;
  margin: 0;
  background-color: #f4f4f4;
}

.container {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  margin-left: 20px;
}

.left-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-right: 20px;
  margin-top: 20px;
}

.right-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: none;
}

/* ===== Grid (13x13) ===== */
.poker-hands-container {
  position: relative;
  padding: 4px;
  border: 4px solid black;
  background: #fff;
}

.poker-hands {
  display: grid;
  grid-template-columns: repeat(13, 50px);
  gap: 2px;
}

.cell { position: relative; width: 50px; height: 50px; }

.hand {
  width: 100%; height: 100%;
  font-weight: bold; color: #fff;
  display: flex; justify-content: center; align-items: center;
  border-radius: 5px; cursor: pointer; text-align: center;
}

.pair   { background-color: blue; }
.suited { background-color: #ffd700; color: #000; }
.offsuit{ background-color: red; }

.grayed-out {
  background-color: #d3d3d3; color: #fff;
  position: absolute; inset: 0; pointer-events: none; z-index: -1;
}

/* Ghost label left behind in the cell when a hand is moved */
.ghost-hand {
  position: absolute;
  inset: 0;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  background: #bfc7d1;
  color: #ffffff;
  opacity: 0.55;
  pointer-events: none;
  text-transform: none;
}

.hand.hide { display: none; }

/* ===== Board (Flop/Turn/River) ===== */
.flop-area { margin-top: 10px; text-align: center; }
.flop-title { font-size: 2rem; margin: 10px 0; }

.board-cards {
  display: flex; justify-content: center; align-items: center;
  width: 520px; height: 160px; padding: 6px;
  background: #fff; border-radius: 8px; border: 1px solid #ccc;
}

.card {
  width: 100px; height: 150px; background: #fff; color: #fff;
  display: flex; justify-content: center; align-items: center;
  border-radius: 5px; margin: 5px; font-weight: bold; font-size: 6rem;
  border: 1px solid black;
}

.flop-card.clubs, .turn-card.clubs, .river-card.clubs     { background-color: green; }
.flop-card.diamonds, .turn-card.diamonds, .river-card.diamonds { background-color: blue; }
.flop-card.hearts, .turn-card.hearts, .river-card.hearts   { background-color: red; }
.flop-card.spades, .turn-card.spades, .river-card.spades   { background-color: black; }

.board-buttons { margin-top: 8px; display: flex; gap: 8px; justify-content: center; }
#clear-flop { font-size: 1.1rem; padding: 8px 14px; }

.sum-all { margin-top: 10px; font-size: 1.25rem; text-align: center; }

/* ===== Controls ===== */
.edit-controls {
  display: flex; justify-content: center; gap: 10px; margin-top: 10px;
}
.edit-range-button, .done-button, .remove-all-button, .restore-button {
  padding: 10px 20px; font-size: 1rem; cursor: pointer; background: green; color: #fff;
}
.add-column-button { margin: 10px 0; }

/* ===== Range “cards” ===== */
.ranges {
  display: flex; flex-direction: column; gap: 16px;
}

.range {
  display: block; width: 100%;
  border: 2px solid #ddd; border-radius: 12px; background: #fff;
  padding: 14px 16px 18px; margin: 16px 0 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  text-align: center;
}

.range h3 { margin: 0 0 10px; font-size: 1.5rem; }
.range h4 { margin: 6px 0 12px; font-size: 1.25rem; }

/* ===== Area layout (stats left, grid right) ===== */
.area-wrap {
  --stats-w: 320px;
  --gap: 12px;
  display: grid;
  grid-template-columns: var(--stats-w) 1fr;
  gap: var(--gap);
  align-items: start;
  margin: 10px 0 6px;
}

.stats-panel.left {
  width: var(--stats-w);
}

/* ===== Stats (matching your JS output) ===== */
.stats .line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5em;
  white-space: nowrap;
  font-size: 1.5rem;
  line-height: 1.25;
  margin: 4px 0;
}

.stats .line:first-child {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.stats .stat-label {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.stats .stat-count {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  margin-left: 0.5em;
}

.betting-pct {
  margin-top: 8px;
  font-size: 2rem;
  font-weight: 700;
}

#sum-br-value, #sum-br-sb, #sum-cr-value, #sum-cr-sb { display: none; }

/* ===== Drop areas ===== */
.drop-area {
  position: relative;
  background: #fafafa; border: 1px dashed #cfcfcf; border-radius: 8px;
  padding: 6px; color: #007bff; z-index: 1;
  overflow-x: auto;
}

/* sticky banner label */
.drop-area::before {
  content: attr(data-label);
  position: sticky;
  left: 0; top: 0;
  display: inline-block;
  background: #0d6efd; color: #fff;
  font-weight: 700; font-size: 0.9rem;
  padding: 4px 8px; border-radius: 6px;
  margin: 4px; z-index: 3;
}

.drop-area-grid {
  display: grid;
  grid-template-columns: repeat(10, 52px);
  grid-template-rows: repeat(3, 52px);
  gap: 2px;
  margin-left: auto;
}

.drop-zone {
  width: 52px; height: 52px; border: 1px dashed #007bff;
  display: flex; justify-content: center; align-items: center;
}

.drop-area.hovered { border-color: #0056b3; z-index: 2; }

/* ===== Suit-combo popover ===== */
.suit-combinations {
  position: absolute; background: #fff; border: 1px solid #ccc;
  box-shadow: 0 0 10px rgba(0,0,0,0.1); padding: 5px; z-index: 1000;
}

.suit-combo {
  width: 50px; height: 50px; display: flex; justify-content: center; align-items: center;
  margin: 2px; cursor: pointer; z-index: 2; text-decoration: none;
}

.suit-combo-inner {
  width: 100%; height: 100%; display: flex; justify-content: center; align-items: center;
  border-radius: 5px; font-weight: bold;
}

.suit-combo.pair .suit-combo-inner {
  background: linear-gradient(to bottom, blue 25%, white 25%, white 75%, blue 75%);
  color: black;
}
.suit-combo.suited .suit-combo-inner {
  background: linear-gradient(to bottom, #ffd700 25%, white 25%, white 75%, #ffd700 75%);
  color: black;
}
.suit-combo.offsuit .suit-combo-inner {
  background: linear-gradient(to bottom, red 25%, white 25%, white 75%, red 75%);
  color: black;
}

.suit-combo.disabled { text-decoration: line-through; color: #d3d3d3; pointer-events: none; }

.suit.red { color: red; }
.suit.black { color: black; }
.suit.blue { color: blue; }
.suit.green{ color: green; }

.suit-combinations.pair   { display: grid; grid-template-columns: repeat(3, 50px); grid-template-rows: repeat(2, 50px); }
.suit-combinations.suited { display: grid; grid-template-columns: repeat(2, 50px); grid-template-rows: repeat(2, 50px); }
.suit-combinations.offsuit{ display: grid; grid-template-columns: repeat(3, 50px); grid-template-rows: repeat(4, 50px); }

/* ===== Drop-area banner labels (for any drop-area[data-label]) ===== */
.drop-area[data-label] {
  position: relative;
  padding-top: 32px; /* room for the banner */
}

.drop-area[data-label]::before {
  content: attr(data-label);
  position: absolute;
  top: 6px;
  left: 8px;
  right: 8px;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: #334;
  background: #eef3ff;
  border: 1px solid #c8d7ff;
  border-radius: 6px;
  padding: 4px 8px;
  pointer-events: none;
}

/* ===== Drop Dock tray (distinct from main drop areas) ===== */
.dock-area {
  background: #fafafa;
  border: 1px dashed #cfcfcf;
  border-radius: 8px;
  padding: 6px;
  min-height: 60px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* Dock uses the same .drop-zone elements for DnD targets, but styled lighter and in a flowing row */
.dock-area .drop-zone {
  width: 52px;
  height: 52px;
  border: 1px dashed #aab7cf;   /* lighter dotted look */
  display: flex;
  justify-content: center;
  align-items: center;
}



/* Helpful if something was clipping the dock */
body { overflow-x: hidden; }


/* ----- Drop-area banners ----- */
.drop-area.drop-area-grid{
  position: relative;
  padding-top: 30px;                 /* space for the banner */
  background: #fff;
  border: 1px solid #d9e1f2;
  border-radius: 14px;
  box-shadow: 0 1px 0 rgba(16,24,40,.02);
}

/* The colored banner strip (text comes from data-label) */
.drop-area.drop-area-grid::before{
  content: attr(data-label);
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 28px;
  display: flex; align-items: center;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .2px;
  color: #0f172a;
  background: var(--area-color, #eef2ff);
  border-radius: 14px 14px 0 0;
  border-bottom: 1px dashed rgba(15,23,42,.15);
}

/* Light dotted grid stays visible below the banner */
.drop-area.drop-area-grid .drop-zone{
  border: 1px dashed rgba(15,23,42,.15);
}

/* Hover state pop */
.drop-area .drop-zone.hovered{
  outline: 2px solid var(--area-accent, #6366f1);
  outline-offset: -2px;
}

/* Per-area theme colors (tweak to taste) */
#betting-value{
  --area-color: #ffe1e3;   /* soft red */
  --area-accent: #ef4444;
}
#betting-semi-bluffs{
  --area-color: #ffedd5;   /* soft orange */
  --area-accent: #f59e0b;
}
#checking-value{
  --area-color: #dcfce7;   /* soft green */
  --area-accent: #22c55e;
}
#checking-semi-bluffs{
  --area-color: #dbeafe;   /* soft blue */
  --area-accent: #3b82f6;
}

/* Optional: make the H4 “Value / Semi-Bluffs” labels subtler now that we have banners */
.range h4{
  margin: 6px 0 14px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}
.range .sum-stat{
  font-weight: 700;
  color: #0f172a;
}







/* ----- Drop-area banners ----- */
.drop-area.drop-area-grid {
  position: relative;
  padding-top: 32px; /* space for the banner */
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* The colored banner strip */
.drop-area.drop-area-grid::before {
  content: attr(data-label);
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 30px;
  display: flex; align-items: center;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .2px;
  color: #ffffff;
  background: var(--area-color, #6366f1);
  border-radius: 14px 14px 0 0;
  border-bottom: 1px dashed rgba(255,255,255,0.4);
}

/* Hover outline */
.drop-area .drop-zone.hovered {
  outline: 2px solid var(--area-accent, #4f46e5);
  outline-offset: -2px;
}

/* Stronger colors */
#betting-value {
  --area-color: #dc2626;  /* vivid red */
  --area-accent: #b91c1c;
}
#betting-semi-bluffs {
  --area-color: #d97706;  /* vivid orange */
  --area-accent: #b45309;
}
#checking-value {
  --area-color: #16a34a;  /* vivid green */
  --area-accent: #15803d;
}
#checking-semi-bluffs {
  --area-color: #2563eb;  /* vivid blue */
  --area-accent: #1d4ed8;
}

/* Optional: tweak range labels for contrast */
.range h4 {
  margin: 6px 0 14px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}





/* === Consistent, punchy banner colors by role === */
.drop-area {
  position: relative;
  border: 2px solid transparent; /* will be set per-role below */
}

/* Banner ribbon */
.drop-area::before {
  content: attr(data-label);
  position: sticky;
  top: -1px;
  display: block;
  padding: 6px 10px;
  font-weight: 700;
  letter-spacing: .2px;
  color: #fff;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  box-shadow: 0 3px 10px rgba(0,0,0,.15);
  z-index: 1;
  background: var(--banner, #555);
}

/* Bet — Value (green) */
.drop-area[data-role="bet-value"] {
  --banner: linear-gradient(135deg, #1db954, #169a43);
  border-color: #169a43;
}

/* Bet — Semi-Bluffs (teal) */
.drop-area[data-role="bet-sb"] {
  --banner: linear-gradient(135deg, #00c2b8, #009e96);
  border-color: #009e96;
}

/* Check — Value (orange) */
.drop-area[data-role="check-value"] {
  --banner: linear-gradient(135deg, #ff8a00, #e06d00);
  border-color: #e06d00;
}

/* Check — Semi-Bluffs (purple) */
.drop-area[data-role="check-sb"] {
  --banner: linear-gradient(135deg, #8a56ff, #6a3de6);
  border-color: #6a3de6;
}

/* Help button */
.btn.help-btn { margin-left: .5rem; }

/* Modal shell */
.modal[aria-hidden="true"] {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.modal {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center;
  font: 14px/1.45 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
.modal__backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,.45);
}
.modal__dialog {
  position: relative; width: min(920px, 92vw); max-height: 88vh; overflow: auto;
  background: #121212; color: #eee; border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
  border: 1px solid rgba(255,255,255,.08);
}
.modal__header, .modal__footer { padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.modal__footer { border-top: 1px solid rgba(255,255,255,.08); border-bottom: none; display: flex; justify-content: space-between; align-items: center; }
.modal__header { display: flex; align-items: center; justify-content: space-between; }
.modal__close {
  background: transparent; border: 0; color: #bbb; font-size: 26px; cursor: pointer; line-height: 1;
}
.modal__content { padding: 16px 18px 8px; }

/* Tabs */
.modal__tabs { display: flex; gap: 8px; padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
.tab {
  background: #1b1b1b; color: #bbb; border: 1px solid rgba(255,255,255,.08);
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
}
.tab.is-active { background: #1f3d29; color: #e8ffe8; border-color: rgba(120,200,140,.4); }

/* Panels */
.tabpanel { display: none; padding: 12px 4px; }
.tabpanel.is-active { display: block; }

/* Lists */
.help-list { margin: 0; padding-left: 18px; }
.help-list li { margin: 6px 0; }
.kv { list-style: none; padding-left: 0; margin: 0; }
.kv li { display: grid; grid-template-columns: 190px 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px dashed rgba(255,255,255,.08); }
.kv li span:first-child { color: #9ad19a; }
.note { margin-top: 10px; color: #b8f3b8; }
.subnote { margin-top: 8px; color: #cfcfcf; font-size: 12px; }

/* Inline hint badges (optional) */
.hint {
  font-size: 12px; background: #1f3d29; color: #dfffe0; border: 1px solid rgba(120,200,140,.35);
  padding: 3px 6px; border-radius: 6px; display: inline-block; margin-left: 6px;
}

/* --- Dock placement & scrolling --- */
:root {
  /* default; JS below will compute this dynamically */
  --dock-top: 72px;
}



/* If the dock lives in a narrow column, make it fill that column */
.dock-column, .dock-wrapper {
  display: block;
}


:root { --dock-top: 72px; }  /* JS will update this value */

/* Canonical Dock */
#drop-dock {
  position: fixed;                  /* floats over the layout at the right */
  right: 18px;
  top: var(--dock-top);             /* sits below your header/toolbars */
  width: 220px;
  display: grid;
  gap: 12px;
  z-index: 50;

  /* keep it fully visible */
  max-height: calc(100vh - var(--dock-top) - 12px);
  overflow: auto;
  padding-right: 8px;               /* avoid overlayed scrollbar */
}

/* Dock slot visuals — keep ONE version */
#drop-dock .dock-slot {
  position: relative;
  background: #ffffff;
  border: 1px dashed rgba(15,23,42,.15);
  border-radius: 12px;
  padding: 36px 10px 10px;
  min-height: 64px;

  display: flex;
  align-items: center;
  justify-content: center;
  font: 600 13px/1 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color: #334;
  letter-spacing: .2px;
}

#drop-dock .dock-slot::before {
  content: attr(data-label);
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 28px;
  display: flex; align-items: center;
  padding: 0 10px;
  font-size: 12px; font-weight: 700;
  border-radius: 12px 12px 0 0;
  color: #ffffff;
  background: var(--slot-color, #6366f1);
  border-bottom: 1px dashed rgba(255,255,255,0.4);
}

/* Match dock slot colors to the drop-area roles */
#drop-dock .dock-slot[data-target="betting-value"]        { --slot-color:#dc2626; }
#drop-dock .dock-slot[data-target="betting-semi-bluffs"]  { --slot-color:#d97706; }
#drop-dock .dock-slot[data-target="checking-value"]       { --slot-color:#16a34a; }
#drop-dock .dock-slot[data-target="checking-semi-bluffs"] { --slot-color:#2563eb; }

/* Mark originals that have been cloned forward */
.hand.completed,
.suit-combo.completed {
  position: relative;
  outline: 3px solid #00e676;      /* bright green */
  outline-offset: -2px;
  /* keep any grayscale you want, but make sure the check is above it */
  filter: grayscale(0.6) brightness(1) !important;
}

/* Checkmark overlay on top of any gray-out */
.hand.completed::after,
.suit-combo.completed::after {
  content: "✔";
  position: absolute;
  right: 2px;
  top: 2px;
  font-weight: 900;
  font-size: 16px;
  color: #00e676;
  text-shadow: 0 0 2px rgba(0,0,0,.6);
  z-index: 3;
  pointer-events: none;
}

/* Make next-street clones look normal and non-draggable (optional) */
.clone {
  filter: none !important;
  opacity: 1;
  cursor: default;
}

/* hideable dock */
#drop-dock.hidden { display: none; }


:root {
  /* Core hues */
  --bet-value:   #E11D48; /* rose-600 */
  --bet-sb:      #F59E0B; /* amber-500 */
  --check-value: #0EA5E9; /* sky-500  */
  --check-sb:    #6366F1; /* indigo-500 */

  /* Soft backgrounds (approx 10–12% opacity equivalents) */
  --bet-value-bg:   rgba(225, 29, 72, 0.10);
  --bet-sb-bg:      rgba(245, 158, 11, 0.12);
  --check-value-bg: rgba(14, 165, 233, 0.10);
  --check-sb-bg:    rgba(99, 102, 241, 0.10);

  --text-strong: #0b1220; /* dark text on light BGs */
}

/* === DROP AREAS (grid) === */
.drop-area-grid {
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 6px;
  background: transparent;
}

/* value vs semi-bluff: hue + pattern */
.drop-area-grid[data-role="bet-value"] {
  --role: var(--bet-value); --role-bg: var(--bet-value-bg);
  border-color: var(--role);
  background: var(--role-bg);
}
.drop-area-grid[data-role="bet-sb"] {
  --role: var(--bet-sb); --role-bg: var(--bet-sb-bg);
  border-color: var(--role);
  /* subtle diagonal stripes to distinguish SB */
  background:
    repeating-linear-gradient(45deg, var(--role-bg) 0 12px, transparent 12px 24px);
}
.drop-area-grid[data-role="check-value"] {
  --role: var(--check-value); --role-bg: var(--check-value-bg);
  border-color: var(--role);
  background: var(--role-bg);
}
.drop-area-grid[data-role="check-sb"] {
  --role: var(--check-sb); --role-bg: var(--check-sb-bg);
  border-color: var(--role);
  background:
    repeating-linear-gradient(45deg, var(--role-bg) 0 12px, transparent 12px 24px);
}

/* drop-zone hover ring uses the same role color */
.drop-area-grid .drop-zone.hovered {
  outline: 3px solid var(--role);
  outline-offset: -2px;
}

/* locked state stays readable but muted */
.drop-area-grid.locked {
  filter: grayscale(0.25) brightness(0.98);
}

/* === DOCK SLOTS (match roles) === */
/* Stronger, unified styling for dock slots */
/* === DOCK SLOTS — unified look, with real banner === */
#drop-dock .dock-slot {
  position: relative;
  overflow: hidden;                 /* so the banner follows the rounded corners */
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 18px 10px 10px;          /* room for the top banner */
  margin: 8px 0;
  font-weight: 600;
  color: var(--text-strong);
  background: transparent !important;   /* we’ll set per-role below */
}

/* Hover outline keyed to role */
#drop-dock .dock-slot.hovered {
  box-shadow: 0 0 0 2px var(--role, rgba(0,0,0,.2));
}

/* The top banner strip — this is the part that was staying purple */
#drop-dock .dock-slot::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 14px;
  background: var(--role, #999);        /* set per-role below */
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
  z-index: 0;                           /* sits under the text */
}

/* Put the label text above the banner */
#drop-dock .dock-slot { z-index: 1; }

/* === Per-role tokens === */
#drop-dock .dock-slot[data-role="bet-value"] {
  --role: var(--bet-value);
  --role-bg: var(--bet-value-bg);
  border-color: var(--role) !important;
  background: var(--role-bg) !important;
}

#drop-dock .dock-slot[data-role="bet-sb"] {
  --role: var(--bet-sb);
  --role-bg: var(--bet-sb-bg);
  border-color: var(--role) !important;
  background:
    repeating-linear-gradient(45deg, var(--role-bg) 0 12px, transparent 12px 24px) !important;
}

#drop-dock .dock-slot[data-role="check-value"] {
  --role: var(--check-value);
  --role-bg: var(--check-value-bg);
  border-color: var(--role) !important;
  background: var(--role-bg) !important;
}

#drop-dock .dock-slot[data-role="check-sb"] {
  --role: var(--check-sb);
  --role-bg: var(--check-sb-bg);
  border-color: var(--role) !important;
  background:
    repeating-linear-gradient(45deg, var(--role-bg) 0 12px, transparent 12px 24px) !important;
}

.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;         /* modern responsive */
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Play button style (optional) */
.play-btn {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fff;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
}
.play-btn:hover { background: #f6f6f6; }

/* Small helper */
.video-fallback { font-size: 0.9rem; opacity: .8; }

/* typical modal layering */
/* modal scaffold */
#help-modal {
  position: fixed; inset: 0;
}
#help-modal[aria-hidden="true"] { display: none; }

#help-modal .modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 10;
}
#help-modal .modal__dialog {
  position: relative;
  z-index: 20;             /* above backdrop */
  pointer-events: auto;
}

