/**
 * /illustrious-18/ -- Hi-Lo deviations reference + interactive tool.
 * Consumes tokens.css; chrome + prose come from casino-v2.css + article.css.
 * Prefix: .dev-  (mirrors the .bse- strategy-engine idiom).
 */

.dev-hero {
  background:
    radial-gradient(120% 140% at 100% 0, rgba(255,255,255,0.06), transparent 60%),
    linear-gradient(160deg, var(--bji-navy-900), var(--bji-navy-800) 70%);
  color: var(--bji-text-inverse);
  padding: var(--bji-space-6) 0 var(--bji-space-7);
}
.dev-hero .crumbs { font-size: var(--bji-text-xs); color: var(--bji-text-inverse-muted); margin-bottom: var(--bji-space-4); }
.dev-hero .crumbs a { color: var(--bji-text-inverse-muted); text-decoration: none; }
.dev-hero .crumbs a:hover { color: #fff; }
.dev-hero h1 {
  font-size: var(--bji-text-3xl);
  font-weight: var(--bji-weight-black);
  line-height: var(--bji-leading-tight);
  margin: 0 0 var(--bji-space-3);
  color: #fff;
}
.dev-hero .tagline {
  font-size: var(--bji-text-lg);
  color: var(--bji-text-inverse-muted);
  max-width: 46rem;
  margin: 0;
}
.dev-hero .byline {
  display: flex; align-items: center; gap: var(--bji-space-2);
  margin: var(--bji-space-4) 0 0;
  font-size: var(--bji-text-sm); color: var(--bji-text-inverse-muted);
}
.dev-hero .byline img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.dev-hero .byline a { color: #fff; font-weight: var(--bji-weight-semibold); border-bottom: 1px solid rgba(255,255,255,0.35); text-decoration: none; }
.dev-hero .byline a:hover { border-bottom-color: #fff; }
.dev-hero .trust { margin: var(--bji-space-2) 0 0; font-size: var(--bji-text-xs); color: var(--bji-text-inverse-muted); }
.dev-hero .trust b { color: #fff; font-weight: var(--bji-weight-semibold); }

/* ---- tool panel ---- */
.dev-tool { margin-top: calc(-1 * var(--bji-space-6)); padding-bottom: var(--bji-section-gap); }
.dev-panel {
  background: var(--bji-surface);
  border: 1px solid var(--bji-border);
  border-radius: var(--bji-radius-lg);
  box-shadow: var(--bji-shadow-md);
  padding: var(--bji-space-5);
}

/* ---- true-count controls ---- */
.dev-controls {
  display: flex; flex-direction: column; gap: var(--bji-space-3);
  padding: var(--bji-space-4) var(--bji-space-5);
  background: var(--bji-surface-sunken);
  border: 1px solid var(--bji-border);
  border-radius: var(--bji-radius-md);
}
.dev-controls-label {
  font-size: var(--bji-text-xs); font-weight: var(--bji-weight-bold);
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--bji-text-muted);
}
.dev-controls-row { display: flex; align-items: center; gap: var(--bji-space-3); flex-wrap: wrap; }
.dev-step {
  width: 2.4rem; height: 2.4rem; flex: 0 0 auto;
  border: 1px solid var(--bji-border-strong); background: var(--bji-surface);
  border-radius: var(--bji-radius-md); font-size: var(--bji-text-xl); line-height: 1;
  color: var(--bji-navy-800); cursor: pointer; font-weight: var(--bji-weight-bold);
}
.dev-step:hover { background: var(--bji-navy-900); color: #fff; border-color: var(--bji-navy-900); }
.dev-controls input[type="number"] {
  width: 4.5rem; text-align: center;
  font-size: var(--bji-text-2xl); font-weight: var(--bji-weight-black);
  color: var(--bji-navy-900);
  border: 1px solid var(--bji-border-strong); border-radius: var(--bji-radius-md);
  padding: var(--bji-space-1) var(--bji-space-2);
}
.dev-slider { flex: 1 1 220px; min-width: 160px; accent-color: var(--bji-green-500); }

.dev-summary { margin: var(--bji-space-4) 0 var(--bji-space-3); font-size: var(--bji-text-base); color: var(--bji-text); }
.dev-summary-count { font-weight: var(--bji-weight-black); color: var(--bji-green-700); font-size: var(--bji-text-lg); }
.dev-summary-tc { font-weight: var(--bji-weight-bold); color: var(--bji-navy-900); }

.dev-legend { display: flex; flex-wrap: wrap; gap: var(--bji-space-4); margin-bottom: var(--bji-space-4); font-size: var(--bji-text-xs); color: var(--bji-text-muted); }
.dev-legend-item { display: inline-flex; align-items: center; gap: var(--bji-space-2); }
.dev-swatch { width: 1rem; height: 1rem; border-radius: 3px; flex: 0 0 auto; }
.dev-swatch--active { background: var(--bji-surface); box-shadow: inset 0 0 0 2px var(--bji-navy-800); }
.dev-swatch--book { background: var(--bji-surface-sunken); border: 1px dashed var(--bji-border-strong); }
.dev-swatch--dev { background: var(--bji-green-100); box-shadow: inset 0 0 0 2px var(--bji-green-500); }

/* ---- index tables ---- */
.dev-tables { display: grid; gap: var(--bji-space-5); }
@media (min-width: 900px) { .dev-tables { grid-template-columns: 3fr 2fr; align-items: start; } }

/* Each table scrolls inside its own block on narrow screens (the nowrap play
   cells set a min-content a little wider than a phone), so the page never gains
   horizontal overflow. */
.dev-table-block { min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.dev-table-title {
  margin: 0 0 var(--bji-space-2);
  font-size: var(--bji-text-base); font-weight: var(--bji-weight-bold);
  color: var(--bji-navy-900);
}
.dev-table { width: 100%; border-collapse: collapse; font-size: var(--bji-text-sm); }
/* Table assumptions render as a muted footnote BELOW the rows (the .dev-table is
   a real display:table, so caption-side works natively). */
.dev-caption {
  caption-side: bottom; text-align: left;
  padding: var(--bji-space-2) 0 0;
  font-size: var(--bji-text-xs); font-weight: var(--bji-weight-medium);
  color: var(--bji-text-muted);
}
.dev-table thead th {
  text-align: center; font-size: var(--bji-text-xs); text-transform: uppercase;
  letter-spacing: 0.03em; color: var(--bji-text-muted); font-weight: var(--bji-weight-bold);
  padding: var(--bji-space-2); border-bottom: 2px solid var(--bji-border-strong);
}
.dev-table thead th:first-child, .dev-table thead th:nth-child(2) { text-align: left; }
.dev-row > * { padding: var(--bji-space-2); border-bottom: 1px solid var(--bji-border); vertical-align: middle; }
.dev-hand { text-align: left; font-weight: var(--bji-weight-bold); color: var(--bji-navy-900); }
.dev-up { text-align: left; color: var(--bji-text-muted); }
.dev-index { text-align: center; font-weight: var(--bji-weight-bold); color: var(--bji-navy-800); font-variant-numeric: tabular-nums; }
.dev-play { text-align: center; white-space: nowrap; color: var(--bji-text-muted); position: relative; }

/* the play cell currently correct at this count */
.dev-play.is-active {
  color: var(--bji-text); font-weight: var(--bji-weight-bold);
  box-shadow: inset 0 0 0 2px var(--bji-navy-800); border-radius: var(--bji-radius-sm);
}
/* the basic-strategy cell always carries a small marker */
.dev-play.is-book { background: var(--bji-surface-sunken); }
.dev-play.is-book::after {
  content: "book"; display: block;
  font-size: 0.62rem; font-weight: var(--bji-weight-semibold);
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--bji-text-faint); margin-top: 1px;
}
/* a row where the count overrides the book: green left accent + green active ring */
.dev-row.is-deviating .dev-hand { box-shadow: inset 3px 0 0 var(--bji-green-500); }
.dev-row.is-deviating .dev-play.is-active {
  background: var(--bji-green-100); color: var(--bji-green-700);
  box-shadow: inset 0 0 0 2px var(--bji-green-500);
}

/* ---- note under the tables ---- */
.dev-note {
  margin: var(--bji-space-5) 0 0; padding: var(--bji-space-3) var(--bji-space-4);
  background: var(--bji-surface-sunken); border-left: 4px solid var(--bji-blue-500);
  border-radius: var(--bji-radius-sm); font-size: var(--bji-text-sm); color: var(--bji-text-muted);
}

/* ---- article ---- */
.dev-article { padding-bottom: var(--bji-section-gap); }
.dev-article .dev-prose { max-width: var(--bji-prose-width); margin-inline: auto; }

/* ---- author card (mirrors .bse-author-card) ---- */
.dev-author { padding-bottom: var(--bji-section-gap); }
.dev-author-card {
  max-width: var(--bji-prose-width); margin-inline: auto;
  display: grid; grid-template-columns: 108px 1fr; gap: var(--bji-space-5);
  background: var(--bji-surface); border: 1px solid var(--bji-border);
  border-left: 4px solid var(--bji-blue-500); border-radius: var(--bji-radius-lg);
  padding: clamp(1.25rem, 1rem + 1.5vw, 2rem);
}
.dev-author-card .photo { width: 108px; height: 108px; border-radius: 50%; object-fit: cover; border: 3px solid var(--bji-blue-100); }
.dev-author-card .kicker { display: block; font-size: var(--bji-text-xs); font-weight: var(--bji-weight-bold); text-transform: uppercase; letter-spacing: 0.06em; color: var(--bji-blue-600); margin-bottom: var(--bji-space-1); }
.dev-author-card h2 { margin: 0 0 var(--bji-space-1); font-size: var(--bji-text-xl); font-weight: var(--bji-weight-bold); }
.dev-author-card .role { margin: 0 0 var(--bji-space-3); font-size: var(--bji-text-sm); font-weight: var(--bji-weight-semibold); color: var(--bji-text-muted); }
.dev-author-card .bio { margin: 0 0 var(--bji-space-3); font-size: var(--bji-text-sm); }
.dev-author-card .links { margin: 0; font-size: var(--bji-text-sm); }
@media (max-width: 560px) { .dev-author-card { grid-template-columns: 1fr; } .dev-author-card .photo { width: 84px; height: 84px; } }

/* ---- related tools (mirrors .bse-tool-grid) ---- */
.dev-tools { padding-bottom: var(--bji-section-gap); }
.dev-tools h2 { font-size: var(--bji-text-2xl); font-weight: var(--bji-weight-bold); margin: 0 0 var(--bji-space-4); }
.dev-tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--bji-space-4); }
.dev-tool-card { background: var(--bji-surface); border: 1px solid var(--bji-border); border-radius: var(--bji-radius-md); padding: var(--bji-space-4); display: flex; flex-direction: column; gap: var(--bji-space-2); }
.dev-tool-card .icon { font-size: 1.5rem; line-height: 1; }
.dev-tool-card h3 { margin: 0; font-size: var(--bji-text-base); }
.dev-tool-card h3 a { text-decoration: none; color: var(--bji-navy-800); }
.dev-tool-card p { margin: 0; font-size: var(--bji-text-sm); color: var(--bji-text-muted); }

.dev-comments { padding-bottom: var(--bji-section-gap); }
.dev-comments .cv2-container { max-width: var(--bji-prose-width); }
