/* ============================================================================
 * ProvablySmart Tools — Editorial Forensic theme
 *
 * Direction: deep warm dark surface, editorial display serif (Fraunces),
 * gold accent used sparingly for emphasis, teal/coral for semantic states,
 * hairline borders, oversized monospace numerals for results, sharp 4-6px
 * radii. Inspired by financial / investigative-journalism interfaces.
 *
 * All class names + DOM structure preserved — JS keeps working unchanged.
 * ========================================================================== */

/* No remote font import: deployment must self-host fonts or use the stack below. */

.pst {
  /* ── palette ── */
  --pst-bg:         #0a0a0d;          /* canvas */
  --pst-surface:    #13131a;          /* card */
  --pst-surface-2:  #1a1a23;          /* inputs / output blocks */
  --pst-surface-3:  #20202b;          /* hover */
  --pst-line:       #26262f;          /* hairline borders */
  --pst-line-hi:    #3a3a47;          /* hover border */

  --pst-fg:         #ece8dd;          /* warm off-white body */
  --pst-fg-strong:  #ffffff;          /* headings + values */
  --pst-muted:      #7a7a8c;          /* labels + meta */
  --pst-faint:      #4d4d5c;          /* placeholder, lowest emphasis */

  --pst-accent:     #d4a017;          /* editorial gold — emphasis only */
  --pst-accent-hi:  #f0bf3d;          /* gold hover */
  --pst-accent-dim: #5a4a18;          /* gold low-intensity hover bg */

  --pst-good:       #5eead4;          /* teal — confident, not generic green */
  --pst-warn:       #f59e0b;
  --pst-bad:        #ef4444;
  --pst-info:       #93c5fd;          /* cool secondary, used sparingly */

  /* ── type stack ── */
  --pst-display:    "Fraunces", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --pst-body:       "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --pst-mono:       "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* ── metrics ── */
  --pst-radius:     6px;
  --pst-radius-sm:  4px;
  --pst-pad:        28px;
  --pst-pad-sm:     20px;
  --pst-shadow:     0 1px 0 rgba(255,255,255,0.02) inset,
                    0 12px 32px -16px rgba(0,0,0,0.7);

  font-family: var(--pst-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--pst-fg);
  background: var(--pst-surface);
  border: 1px solid var(--pst-line);
  border-radius: var(--pst-radius);
  padding: var(--pst-pad);
  margin: 28px auto;
  max-width: 900px;
  box-sizing: border-box;
  box-shadow: var(--pst-shadow);
  position: relative;
}

/* hairline gold rule above the card — editorial signature mark */
.pst::before {
  content: "";
  position: absolute;
  top: -1px; left: 24px;
  width: 36px; height: 2px;
  background: var(--pst-accent);
}

/* ═══════════════════════════════════════════════════════════════
 * HEADINGS + META
 * ═══════════════════════════════════════════════════════════ */
.pst h3 {
  margin: 0 0 8px;
  font-family: var(--pst-display);
  font-size: 30px;
  font-weight: 600;
  font-variation-settings: "opsz" 60;
  letter-spacing: -0.015em;
  line-height: 1.1;
  color: var(--pst-fg-strong);
}

.pst h4 {
  margin: 28px 0 10px;
  font-family: var(--pst-body);
  font-size: 11px;
  font-weight: 600;
  color: var(--pst-muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.pst .pst-sub {
  font-family: var(--pst-display);
  font-size: 16px;
  font-style: italic;
  font-weight: 400;
  color: var(--pst-muted);
  max-width: 64ch;
  line-height: 1.5;
  margin: 0 0 24px;
}

.pst hr,
.pst .pst-rule {
  border: 0;
  border-top: 1px solid var(--pst-line);
  margin: 24px 0;
}

/* ═══════════════════════════════════════════════════════════════
 * FORM CONTROLS
 * ═══════════════════════════════════════════════════════════ */
.pst label {
  display: block;
  font-family: var(--pst-body);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--pst-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 14px 0 6px;
}

.pst input[type="number"],
.pst input[type="text"],
.pst input[type="search"],
.pst input[type="date"],
.pst select,
.pst textarea {
  width: 100%;
  padding: 11px 14px;
  font: inherit;
  font-size: 14px;
  color: var(--pst-fg-strong);
  background: var(--pst-surface-2);
  border: 1px solid var(--pst-line);
  border-radius: var(--pst-radius-sm);
  box-sizing: border-box;
  transition: border-color .15s ease, background .15s ease;
  font-variant-numeric: tabular-nums;
}
.pst input:hover, .pst select:hover, .pst textarea:hover {
  border-color: var(--pst-line-hi);
}
.pst input:focus, .pst select:focus, .pst textarea:focus {
  outline: none;
  border-color: var(--pst-accent);
  background: #15131a;
}
.pst input::placeholder, .pst textarea::placeholder { color: var(--pst-faint); }

.pst select {
  appearance: none;
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--pst-muted) 50%),
                    linear-gradient(135deg, var(--pst-muted) 50%, transparent 50%);
  background-repeat: no-repeat;
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px;
}

.pst input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--pst-accent);
  margin-top: 4px;
  cursor: pointer;
}

.pst input[type="range"] {
  width: 100%;
  accent-color: var(--pst-accent);
  height: 4px;
}

.pst .pst-range-label {
  display: inline-block;
  min-width: 54px;
  text-align: right;
  font-family: var(--pst-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--pst-accent);
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════════════════
 * GRID + OUTPUT BLOCKS
 * ═══════════════════════════════════════════════════════════ */
.pst .pst-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.pst .pst-out {
  margin-top: 22px;
  padding: 20px 22px;
  background: var(--pst-surface-2);
  border: 1px solid var(--pst-line);
  border-radius: var(--pst-radius-sm);
  border-left: 2px solid var(--pst-accent);
}

.pst .pst-out .pst-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 18px;
  padding: 10px 0;
  border-bottom: 1px solid var(--pst-line);
  font-size: 14px;
}
.pst .pst-out .pst-row:first-child { padding-top: 0; }
.pst .pst-out .pst-row:last-child  { border-bottom: 0; padding-bottom: 0; }

.pst .pst-out .pst-row > span:first-child {
  color: var(--pst-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.pst .pst-out .pst-row b {
  color: var(--pst-fg-strong);
  font-family: var(--pst-mono);
  font-weight: 600;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  letter-spacing: -0.01em;
}

/* Semantic row backgrounds — full-bleed inside the block */
.pst .pst-out .pst-row.pst-good { background: rgba(94,234,212,0.05); margin: 0 -22px; padding-left: 22px; padding-right: 22px; }
.pst .pst-out .pst-row.pst-warn { background: rgba(245,158,11,0.06); margin: 0 -22px; padding-left: 22px; padding-right: 22px; }
.pst .pst-out .pst-row.pst-bad  { background: rgba(239,68,68,0.07);  margin: 0 -22px; padding-left: 22px; padding-right: 22px; }

.pst .pst-good { color: var(--pst-good) !important; }
.pst .pst-warn { color: var(--pst-warn) !important; }
.pst .pst-bad  { color: var(--pst-bad)  !important; }

/* ═══════════════════════════════════════════════════════════════
 * BUTTONS
 * ═══════════════════════════════════════════════════════════ */
.pst .pst-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: var(--pst-body);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--pst-fg-strong);
  background: transparent;
  border: 1px solid var(--pst-line-hi);
  border-radius: var(--pst-radius-sm);
  cursor: pointer;
  margin: 0 6px 6px 0;
  transition: border-color .15s ease, color .15s ease, background .15s ease, transform .08s ease;
}
.pst .pst-btn:hover {
  border-color: var(--pst-accent);
  color: var(--pst-accent-hi);
  background: rgba(212,160,23,0.05);
}
.pst .pst-btn:active { transform: translateY(1px); }

.pst .pst-btn.pst-primary {
  background: var(--pst-accent);
  border-color: var(--pst-accent);
  color: #0a0a0d;
}
.pst .pst-btn.pst-primary:hover {
  background: var(--pst-accent-hi);
  border-color: var(--pst-accent-hi);
  color: #0a0a0d;
}

.pst .pst-row-del {
  background: transparent;
  border: 1px solid var(--pst-line);
  width: 30px; height: 30px;
  padding: 0;
  margin: 0;
  border-radius: var(--pst-radius-sm);
  color: var(--pst-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.pst .pst-row-del:hover {
  background: rgba(239,68,68,0.08);
  color: var(--pst-bad);
  border-color: var(--pst-bad);
}

/* ═══════════════════════════════════════════════════════════════
 * TABLES
 * ═══════════════════════════════════════════════════════════ */
.pst .pst-table-wrap { overflow-x: auto; margin: 6px -4px 0; }
.pst table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
  margin-top: 4px;
}
.pst table th {
  text-align: left;
  padding: 11px 14px;
  font-family: var(--pst-body);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--pst-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--pst-surface-2);
  border-bottom: 1px solid var(--pst-line);
  border-top: 1px solid var(--pst-line);
  white-space: nowrap;
  user-select: none;
}
.pst table th:first-child { border-top-left-radius: var(--pst-radius-sm); }
.pst table th:last-child  { border-top-right-radius: var(--pst-radius-sm); }
.pst table th[data-sort] { cursor: pointer; transition: color .15s ease; }
.pst table th[data-sort]:hover { color: var(--pst-accent-hi); }
.pst table th::after { content: ""; opacity: .3; margin-left: 6px; font-size: 9px; }
.pst table th.pst-sort-asc::after  { content: "▲"; opacity: 1; color: var(--pst-accent); }
.pst table th.pst-sort-desc::after { content: "▼"; opacity: 1; color: var(--pst-accent); }

.pst table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--pst-line);
  color: var(--pst-fg);
  font-size: 13.5px;
}
.pst table tbody tr:hover td { background: rgba(212,160,23,0.04); }
.pst table tr:last-child td { border-bottom: 0; }
.pst table td.num {
  text-align: right;
  font-family: var(--pst-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 500;
  color: var(--pst-fg-strong);
}
.pst table tr.pst-hide { display: none; }

.pst .pst-filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.pst .pst-filter-bar input,
.pst .pst-filter-bar select { flex: 1; min-width: 160px; }

/* ═══════════════════════════════════════════════════════════════
 * CHECKLIST
 * ═══════════════════════════════════════════════════════════ */
.pst-checklist ul { list-style: none; margin: 0; padding: 0; }
.pst-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--pst-line);
  transition: background .15s ease;
}
.pst-checklist li:last-child  { border-bottom: 0; }
.pst-checklist li:hover       { background: rgba(212,160,23,0.025); }
.pst-checklist .pst-item-text { flex: 1; cursor: pointer; font-size: 14.5px; }
.pst-checklist .pst-item-text small {
  display: block;
  color: var(--pst-muted);
  font-size: 12.5px;
  margin-top: 5px;
  font-style: italic;
  font-family: var(--pst-display);
}

.pst-checklist .pst-progress {
  height: 3px;
  background: var(--pst-surface-2);
  border-radius: 0;
  overflow: hidden;
  margin: 0 0 20px;
  position: relative;
}
.pst-checklist .pst-progress > span {
  display: block;
  height: 100%;
  background: var(--pst-accent);
  transition: width .4s cubic-bezier(.4,0,.2,1);
}
.pst-checklist li.done .pst-item-text { color: var(--pst-muted); text-decoration: line-through; text-decoration-color: var(--pst-accent); text-decoration-thickness: 1.5px; }

/* ═══════════════════════════════════════════════════════════════
 * CANVAS CHART
 * ═══════════════════════════════════════════════════════════ */
.pst canvas {
  width: 100%;
  height: 260px;
  display: block;
  margin-top: 18px;
  background: var(--pst-surface-2);
  border: 1px solid var(--pst-line);
  border-radius: var(--pst-radius-sm);
}

/* ═══════════════════════════════════════════════════════════════
 * MONO HEX BLOCKS (PF verifier digests)
 * ═══════════════════════════════════════════════════════════ */
.pst .pst-hex {
  font-family: var(--pst-mono);
  font-size: 12px;
  word-break: break-all;
  background: #060608;
  color: var(--pst-good);
  padding: 14px 16px;
  border: 1px solid var(--pst-line);
  border-left: 2px solid var(--pst-good);
  border-radius: var(--pst-radius-sm);
  line-height: 1.55;
  margin-top: 6px;
}

/* Inline code */
.pst code {
  font-family: var(--pst-mono);
  font-size: 12.5px;
  background: var(--pst-surface-2);
  color: var(--pst-accent-hi);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid var(--pst-line);
}

/* ═══════════════════════════════════════════════════════════════
 * TEXTAREAS
 * ═══════════════════════════════════════════════════════════ */
.pst textarea {
  min-height: 130px;
  font-family: var(--pst-mono);
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
}

/* ═══════════════════════════════════════════════════════════════
 * MINES GRID
 * ═══════════════════════════════════════════════════════════ */
.pst-mines-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  max-width: 320px;
  margin-top: 18px;
}
.pst-mine-cell {
  aspect-ratio: 1;
  border: 1px solid var(--pst-line);
  background: var(--pst-surface-2);
  border-radius: var(--pst-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.pst-mine-cell.mine {
  background: rgba(239,68,68,0.12);
  border-color: var(--pst-bad);
  box-shadow: 0 0 14px -3px rgba(239,68,68,0.4);
}

/* ═══════════════════════════════════════════════════════════════
 * Hi-Lo + Blackjack shoe cards
 * ═══════════════════════════════════════════════════════════ */
.pst .pst-card {
  display: inline-block;
  padding: 8px 14px;
  margin: 6px 6px 0 0;
  border: 1px solid var(--pst-line-hi);
  border-radius: var(--pst-radius-sm);
  background: var(--pst-surface-2);
  font-family: var(--pst-mono);
  font-size: 13px;
  color: var(--pst-fg-strong);
  letter-spacing: 0.04em;
}

/* ═══════════════════════════════════════════════════════════════
 * Blackjack trainer (editorial "evidence cards")
 * ═══════════════════════════════════════════════════════════ */
.pst-bj-display { margin: 18px 0; }
.pst-bj-hand    { display: flex; gap: 40px; flex-wrap: wrap; }
.pst-bj-hand > div { display: flex; flex-direction: column; gap: 10px; }
.pst-bj-hand small {
  color: var(--pst-muted);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}
.pst-bj-hand b {
  display: inline-block;
  min-width: 64px;
  border: 1px solid var(--pst-line-hi);
  background: var(--pst-surface-2);
  border-radius: var(--pst-radius-sm);
  padding: 14px 18px;
  font-family: var(--pst-display);
  font-size: 30px;
  font-weight: 600;
  color: var(--pst-fg-strong);
  text-align: center;
  margin-right: 4px;
  box-shadow: 0 6px 16px -8px rgba(0,0,0,0.5);
}
.pst-bj-score {
  font-family: var(--pst-mono);
  color: var(--pst-muted);
  font-size: 13px;
  margin-top: 14px;
  padding: 11px 14px;
  background: var(--pst-surface-2);
  border: 1px solid var(--pst-line);
  border-radius: var(--pst-radius-sm);
}

/* ═══════════════════════════════════════════════════════════════
 * Session rules printable card
 * ═══════════════════════════════════════════════════════════ */
.pst-card-print {
  background: var(--pst-surface-2);
  border: 1px solid var(--pst-line);
  border-top: 3px solid var(--pst-accent);
  padding: 22px 26px;
  margin-top: 20px;
  border-radius: var(--pst-radius-sm);
}
.pst-card-print h4 {
  margin: 0 0 14px;
  font-family: var(--pst-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--pst-fg-strong);
  text-transform: none;
  letter-spacing: -0.01em;
}
.pst-card-print .pst-row {
  padding: 9px 0;
  border-bottom: 1px dashed var(--pst-line);
  display: flex;
  justify-content: space-between;
}
.pst-card-print .pst-row:last-child { border: 0; }

@media print {
  body * { visibility: hidden; }
  .pst-card-print, .pst-card-print * { visibility: visible; }
  .pst-card-print {
    position: absolute; inset: 24px;
    background: #fff !important;
    color: #000 !important;
    border: 2px solid #000;
    border-top: 4px solid #d4a017 !important;
  }
  .pst-card-print .pst-row { border-color: #999 !important; }
  .pst-card-print h4 { color: #000 !important; }
}

/* ═══════════════════════════════════════════════════════════════
 * Time-on-device
 * ═══════════════════════════════════════════════════════════ */
.pst-timer-elapsed {
  font-family: var(--pst-mono);
  font-size: 56px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-align: center;
  padding: 28px 0;
  letter-spacing: 0.04em;
  color: var(--pst-fg-strong);
  border-top: 1px solid var(--pst-line);
  border-bottom: 1px solid var(--pst-line);
  margin: 8px 0;
}
.pst-timer-banner {
  display: none;
  padding: 14px 18px;
  margin-top: 16px;
  background: rgba(245,158,11,0.08);
  border: 1px solid var(--pst-warn);
  border-left: 3px solid var(--pst-warn);
  border-radius: var(--pst-radius-sm);
  color: var(--pst-warn);
  font-weight: 600;
  font-size: 13.5px;
}

/* ═══════════════════════════════════════════════════════════════
 * Glossary
 * ═══════════════════════════════════════════════════════════ */
.pst-glossary ul { list-style: none; margin: 14px 0 0; padding: 0; }
.pst-gloss-item {
  padding: 16px 4px;
  border-bottom: 1px solid var(--pst-line);
  transition: padding-left .15s ease, border-color .15s ease;
}
.pst-gloss-item:hover {
  padding-left: 12px;
  border-left: 2px solid var(--pst-accent);
}
.pst-gloss-item b {
  display: block;
  font-family: var(--pst-mono);
  font-size: 13px;
  color: var(--pst-accent-hi);
  margin-bottom: 6px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.pst-gloss-item small {
  color: var(--pst-fg);
  font-size: 14px;
  font-family: var(--pst-display);
  font-style: italic;
  line-height: 1.55;
}

/* ═══════════════════════════════════════════════════════════════
 * CATALOG BROWSER
 * ═══════════════════════════════════════════════════════════ */
.pst-catalog {
  max-width: 1200px;
}
.pst-cat-filters {
  display: grid;
  gap: 10px;
  grid-template-columns: 2fr 1fr 1fr;
  margin: 18px 0 26px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--pst-line);
}
.pst-cat-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
}
.pst-cat-card {
  background: var(--pst-surface-2);
  border: 1px solid var(--pst-line);
  border-radius: var(--pst-radius);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.55;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
  position: relative;
  overflow: hidden;
}
.pst-cat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 28px; height: 2px;
  background: var(--pst-accent);
  opacity: 0;
  transition: opacity .18s ease, width .18s ease;
}
.pst-cat-card:hover {
  border-color: var(--pst-line-hi);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -14px rgba(0,0,0,0.6);
}
.pst-cat-card:hover::before { opacity: 1; width: 60px; }

.pst-cat-card header {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.pst-cat-card h4 {
  margin: 8px 0 0;
  font-family: var(--pst-display);
  font-size: 19px;
  font-weight: 600;
  color: var(--pst-fg-strong);
  text-transform: none;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.pst-cat-tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 100px;
  background: transparent !important;
  border: 1px solid;
  color: inherit !important;
  font-family: var(--pst-body);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.pst-cat-tier-tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 100px;
  font-family: var(--pst-body);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: transparent;
  color: var(--pst-muted);
  border: 1px solid var(--pst-line);
}
.pst-cat-tier-flagship    { color: var(--pst-accent);    border-color: var(--pst-accent); }
.pst-cat-tier-analyzer    { color: #c4a3f4;              border-color: rgba(196,163,244,0.5); }
.pst-cat-tier-utility     { color: var(--pst-muted);     border-color: var(--pst-line); }
.pst-cat-tier-educational { color: var(--pst-info);      border-color: rgba(147,197,253,0.5); }

.pst-cat-copy {
  align-self: flex-start;
  background: transparent;
  border: 1px dashed var(--pst-line-hi);
  padding: 6px 12px;
  border-radius: var(--pst-radius-sm);
  font-family: var(--pst-mono);
  font-size: 12.5px;
  color: var(--pst-accent-hi);
  cursor: pointer;
  margin-top: 4px;
  transition: all .15s ease;
}
.pst-cat-copy:hover {
  background: var(--pst-accent);
  color: #0a0a0d;
  border-style: solid;
  border-color: var(--pst-accent);
}
.pst-cat-copy.copied {
  background: var(--pst-good);
  color: #0a0a0d;
  border-color: var(--pst-good);
}
.pst-cat-copy.copied::after {
  content: " ✓ copied";
  font-family: var(--pst-body);
  margin-left: 6px;
  font-weight: 600;
}

.pst-cat-blurb {
  margin: 6px 0 2px;
  color: var(--pst-fg);
  font-size: 13.5px;
  line-height: 1.55;
}
.pst-cat-algo, .pst-cat-place {
  margin: 0;
  font-size: 12px;
  color: var(--pst-muted);
  line-height: 1.55;
  font-family: var(--pst-body);
}
.pst-cat-algo b, .pst-cat-place b {
  color: var(--pst-fg);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10.5px;
}
.pst-cat-algo b::after, .pst-cat-place b::after { content: " "; }
.pst-cat-empty {
  padding: 32px;
  text-align: center;
  color: var(--pst-muted);
  font-family: var(--pst-display);
  font-style: italic;
}

/* Category tag color overrides — outlined style */
.pst-cat-card[data-cat="pf"]         .pst-cat-tag { color: var(--pst-accent)    !important; border-color: var(--pst-accent); }
.pst-cat-card[data-cat="math"]       .pst-cat-tag { color: #c4a3f4              !important; border-color: rgba(196,163,244,0.5); }
.pst-cat-card[data-cat="bankroll"]   .pst-cat-tag { color: var(--pst-good)      !important; border-color: rgba(94,234,212,0.5); }
.pst-cat-card[data-cat="bonus"]      .pst-cat-tag { color: var(--pst-warn)      !important; border-color: rgba(245,158,11,0.5); }
.pst-cat-card[data-cat="games"]      .pst-cat-tag { color: #fb923c              !important; border-color: rgba(251,146,60,0.5); }
.pst-cat-card[data-cat="behavioral"] .pst-cat-tag { color: var(--pst-info)      !important; border-color: rgba(147,197,253,0.5); }
.pst-cat-card[data-cat="stats"]      .pst-cat-tag { color: var(--pst-bad)       !important; border-color: rgba(239,68,68,0.5); }
.pst-cat-card[data-cat="reference"]  .pst-cat-tag { color: var(--pst-muted)     !important; border-color: var(--pst-line-hi); }

/* ═══════════════════════════════════════════════════════════════
 * MISC
 * ═══════════════════════════════════════════════════════════ */
.pst ::selection { background: rgba(212,160,23,0.35); color: var(--pst-fg-strong); }

.pst-stacking .pst-out > div {
  padding: 10px 0;
  border-bottom: 1px solid var(--pst-line);
}
.pst-stacking .pst-out > div:last-of-type { border-bottom: 0; }

/* ═══════════════════════════════════════════════════════════════
 * EDITORIAL CONTENT LAYER (.pst-seo-guide)
 *
 * Long-form prose blocks editors add BELOW the tool. Mirrors the editorial-
 * forensic palette: Fraunces display headings, Inter body, JetBrains Mono
 * code, gold accent on dividers + insight callouts.
 *
 * Self-scoped under .pst-seo-guide so it only fires where you opt in.
 * ═══════════════════════════════════════════════════════════════ */
.pst-seo-guide {
  margin: 48px 0 0;
  color: #ece8dd;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  max-width: 70ch;
}

.pst-seo-guide h2 {
  font-family: "Fraunces", "Source Serif Pro", Georgia, serif;
  font-size: clamp(26px, 3.2vw, 34px);
  font-weight: 600;
  font-variation-settings: "opsz" 96;
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: #ffffff;
  margin: 56px 0 18px;
  padding-top: 28px;
  border-top: 1px solid #26262f;
  position: relative;
}
.pst-seo-guide h2::before {
  content: "";
  position: absolute;
  top: -1px; left: 0;
  width: 36px; height: 2px;
  background: #d4a017;
}
.pst-seo-guide > *:first-child { margin-top: 0; }
.pst-seo-guide > h2:first-child { padding-top: 32px; border-top: 1px solid #26262f; }

.pst-seo-guide h3 {
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #d4a017;
  margin: 32px 0 14px;
}

.pst-seo-guide h4 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 19px;
  font-weight: 600;
  font-variation-settings: "opsz" 36;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: #ffffff;
  margin: 24px 0 10px;
}

.pst-seo-guide p {
  margin: 0 0 18px;
  color: #ece8dd;
}
.pst-seo-guide p strong,
.pst-seo-guide p b { color: #ffffff; font-weight: 600; }
.pst-seo-guide a {
  color: #f0bf3d;
  text-decoration: none;
  border-bottom: 1px solid rgba(212,160,23,0.4);
  transition: color .15s ease, border-color .15s ease;
}
.pst-seo-guide a:hover { color: #ffffff; border-bottom-color: #f0bf3d; }

.pst-seo-guide ul, .pst-seo-guide ol {
  margin: 0 0 22px;
  padding-left: 0;
  list-style: none;
  counter-reset: pst-step;
}
.pst-seo-guide ul li,
.pst-seo-guide ol li {
  position: relative;
  padding: 6px 0 6px 28px;
  margin: 0;
  line-height: 1.55;
}
.pst-seo-guide ul li::before {
  content: "";
  position: absolute;
  left: 4px; top: 17px;
  width: 8px; height: 1.5px;
  background: #d4a017;
}
.pst-seo-guide ol li {
  counter-increment: pst-step;
}
.pst-seo-guide ol li::before {
  content: counter(pst-step, decimal-leading-zero);
  position: absolute;
  left: 0; top: 6px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
  color: #d4a017;
  letter-spacing: 0.04em;
}

.pst-code-block {
  display: block;
  background: #060608;
  border: 1px solid #26262f;
  border-left: 2px solid #5eead4;
  border-radius: 4px;
  padding: 14px 18px;
  margin: 18px 0 24px;
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #5eead4;
  overflow-x: auto;
  white-space: pre;
  word-break: normal;
}

.pst-seo-guide pre,
.pst-seo-guide code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
}
.pst-seo-guide p code,
.pst-seo-guide li code {
  background: #1a1a23;
  color: #f0bf3d;
  padding: 2px 6px;
  border: 1px solid #26262f;
  border-radius: 3px;
  font-size: 13px;
}

/* Insight / callout boxes */
.pst-box {
  margin: 28px 0;
  padding: 20px 24px;
  background: #13131a;
  border: 1px solid #26262f;
  border-left: 3px solid #d4a017;
  border-radius: 4px;
  color: #ece8dd;
  font-size: 15px;
  line-height: 1.6;
}
.pst-box strong { color: #f0bf3d; font-weight: 600; display: inline; margin-right: 4px; }

.pst-insight-box {
  background: linear-gradient(180deg, rgba(212,160,23,0.04) 0%, rgba(212,160,23,0) 100%), #13131a;
}

/* FAQ — clean accordion-style without JS (always-open, looks like a list of answered Q's) */
.pst-faq-container {
  margin: 24px 0 0;
  border-top: 1px solid #26262f;
}
.pst-faq-item {
  padding: 22px 0 8px;
  border-bottom: 1px solid #26262f;
}
.pst-faq-item h4 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 10px;
  line-height: 1.35;
  position: relative;
  padding-left: 22px;
}
.pst-faq-item h4::before {
  content: "Q.";
  position: absolute;
  left: 0; top: 1px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  color: #d4a017;
  letter-spacing: 0.02em;
}
.pst-faq-item p {
  margin: 0 0 18px;
  padding-left: 22px;
  position: relative;
  color: #ece8dd;
}
.pst-faq-item p:first-of-type::before {
  content: "A.";
  position: absolute;
  left: 0; top: 1px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  color: #5eead4;
  letter-spacing: 0.02em;
}

/* Blockquote — for the "pull quote" pattern editors may add */
.pst-seo-guide blockquote {
  margin: 28px 0;
  padding: 4px 0 4px 22px;
  border-left: 2px solid #d4a017;
  font-family: "Fraunces", Georgia, serif;
  font-size: 21px;
  font-style: italic;
  line-height: 1.45;
  color: #ffffff;
}

/* Images inside the guide get the same card treatment */
.pst-seo-guide img,
.pst-seo-guide figure {
  max-width: 100%;
  border-radius: 4px;
  border: 1px solid #26262f;
  margin: 22px 0;
}

@media (max-width: 720px) {
  .pst-seo-guide { font-size: 15.5px; }
  .pst-seo-guide h2 { margin-top: 40px; padding-top: 22px; }
  .pst-box { padding: 16px 18px; }
}

/* ═══════════════════════════════════════════════════════════════
 * GENERATED TOOL PAGE WRAP — section / title / breadcrumb
 *
 * Pages created by the bin/generate-pages script live inside this section.
 * Goal: match casin's content rhythm + offer an editorial title block
 * above the tool card.
 * ═══════════════════════════════════════════════════════════════ */
.ps-tool-section {
  padding-top: 56px;
  padding-bottom: 80px;
}
.ps-tool-section .container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.ps-tool-meta {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid #26262f;
}
.ps-tool-back {
  display: inline-block;
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #7a7a8c;
  text-decoration: none;
  margin-bottom: 14px;
  transition: color .15s ease;
}
.ps-tool-back:hover { color: #d4a017; }

.ps-tool-title {
  font-family: "Fraunces", "Source Serif Pro", Georgia, serif;
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 600;
  font-variation-settings: "opsz" 144;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
  color: #ffffff;
  position: relative;
  padding-left: 18px;
}
.ps-tool-title::before {
  content: "";
  position: absolute;
  left: 0; top: 12%;
  width: 3px; height: 76%;
  background: #d4a017;
}

/* Hide casin's duplicate page title on generated pages. The theme outputs an
 * H1 above the_content; our wrapper renders its own. Common casin selectors
 * for the page title — broad enough to catch variants. */
body.pst-tool-page .post-header,
body.pst-tool-page .page-header,
body.pst-tool-page .header__title,
body.pst-tool-page > main > .container > h1:first-child,
body.pst-tool-page .entry-header { display: none !important; }

/* On the catalog parent page (/tools/) we don't add the meta block. */
.ps-tool-catalog .container { padding: 56px 24px 80px; }

/* SEO intro paragraphs that editors may paste BEFORE the shortcode */
.pst-intro-lead, .ps-tool-section > .container p:first-child {
  font-family: "Fraunces", Georgia, serif;
  font-size: 19px;
  font-style: italic;
  line-height: 1.55;
  color: #ece8dd;
  max-width: 64ch;
}

@media (max-width: 720px) {
  .ps-tool-section { padding-top: 32px; padding-bottom: 48px; }
  .ps-tool-meta { margin-bottom: 20px; padding-bottom: 18px; }
}

/* ═══════════════════════════════════════════════════════════════
 * RESPONSIVE
 * ═══════════════════════════════════════════════════════════════ */
@media (max-width: 720px) {
  .pst { padding: 22px 18px; margin: 18px 0; }
  .pst h3 { font-size: 26px; }
  .pst .pst-cat-filters { grid-template-columns: 1fr; }
  .pst-bj-hand { gap: 24px; }
  .pst-bj-hand b { font-size: 24px; padding: 12px 14px; min-width: 50px; }
  .pst-timer-elapsed { font-size: 40px; padding: 22px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .pst *, .pst *::before, .pst *::after {
    transition: none !important;
    animation: none !important;
  }
}
