/* BitSize Deep Learning — builds on python_patterns/patterns.css + python_data/data.css +
   python_ml/ml.css (the same components: steps, chunks, check kinds, mlchart pictures) with a rose
   accent, the training loop as the strip, the always-visible shape tracker and the kit. */
.px.dl, .px-panel.dl { --px-accent: #BE185D; --px-accent-2: #EC4899; --px-soft-bg: #FDF2F8; --mc-a: #DB2777; }
.px.dl code { background: #FCE7F3; }
.dl .px-callout--teal { background: #FDF2F8; border-color: #F9CFE3; color: #831843; }
.dl .px-cta:hover { background: #9D174D; }

/* the training loop: six slots and a way back round */
.dl-loop { position: relative; padding-bottom: 22px; }
.dl-loop::after { content: '↺ every batch, again'; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  font: 700 11px var(--px-mono); letter-spacing: .06em; color: #A8A29E; white-space: nowrap;
  background: var(--px-paper, #fff); padding: 0 8px; z-index: 1; }
.dl-loop::before { content: ''; position: absolute; left: 8%; right: 8%; bottom: 8px; height: 10px; border: 2px dashed #E7D9DF;
  border-top: 0; border-radius: 0 0 12px 12px; }

/* the shape tracker on every chunk: what goes in → what comes out */
.dl-shape { display: inline-flex; align-items: center; gap: 6px; justify-self: start; margin-top: 8px; padding: 3px 10px;
  border-radius: 999px; background: color-mix(in srgb, var(--sc) 12%, #fff); color: var(--sc);
  font: 700 12.5px var(--px-mono); line-height: 1.5; max-width: 100%; overflow-wrap: anywhere; text-align: left; }
.dl-shape i { font-style: normal; opacity: .7; }
.dl-engine { margin: 6px 0 0; font-size: 13px; color: var(--px-soft); }

/* When: the shape rule and the classic mistake */
.dl-when--shape { background: #F8FAFC; }
.dl-when--mistake { background: #FFF7ED; border-color: #FED7AA; }
.dl-card-shape { font-family: var(--px-mono); color: var(--sc); }

/* tensor pictures inside "read the picture" options: one still frame, no player */
.dl-pic .vz-controls, .dl-pic .vz-say { display: none; }
.dl-pic .vz-stage { min-height: 0; }

/* the map: the kit shelves reuse the toolbox styles */
.dl .ml-continue { --pc: #BE185D; }
.dl-hero-demo { margin: 0; padding: 12px; border-radius: 16px; background: #fff; border: 1px solid #F5D7E5;
  box-shadow: 0 18px 40px -30px rgba(131, 24, 67, .6); display: grid; gap: 8px; }
.dl-hero-demo__cap { display: flex; justify-content: space-between; gap: 8px; font: 700 12.5px var(--px-mono); color: #831843; }
.dl-hero-demo__cap b { color: #9CA3AF; font-weight: 600; }
.dl-hero-demo__grid { display: grid; grid-template-columns: repeat(16, 1fr); gap: 1px; border-radius: 8px; overflow: hidden;
  background: #F3E8EE; aspect-ratio: 1; max-width: 220px; width: 100%; justify-self: center; }
.dl-hero-demo__grid span { display: grid; place-items: center; font: 600 6.5px var(--px-mono); color: transparent;
  background: rgb(190 24 93 / var(--a, 0)); transition: background .25s, color .25s; }
.dl-hero-demo.is-numbers .dl-hero-demo__grid span { color: #831843; background: rgb(252 231 243 / calc(.35 + var(--a, 0) * .65)); }
@media (prefers-reduced-motion: reduce) { .dl-hero-demo__grid span { transition: none; } }

/* the Network Builder: the layer stack, input to output, with the shape after each row */
.dl-bstack { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.dl-brow { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 10px;
  padding: 8px 10px 8px 14px; border-radius: 12px; border: 1.5px solid color-mix(in srgb, var(--sc) 35%, #fff); background: #fff;
  animation: ml-pop .3s ease both; }
.dl-brow::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--sc); }
.dl-brow + .dl-brow::after { content: '↓'; position: absolute; left: 22px; top: -13px; font-size: 11px; color: #A8A29E; }
.dl-brow.is-fixed { background: color-mix(in srgb, var(--sc) 6%, #fff); border-style: dashed; }
.dl-brow__name { display: grid; gap: 1px; min-width: 0; }
.dl-brow__name b, .dl-brow__name code { font: 700 13px var(--px-mono); color: var(--sc); background: none !important; padding: 0; }
.dl-brow__name small { font-size: 12px; color: var(--px-soft); }
.dl-brow .dl-shape { margin-top: 0; white-space: nowrap; }
.dl-brow__knob { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.dl-brow__knob code { background: none !important; padding: 0; color: var(--px-soft); }
.dl-brow__knob select { font: 600 13px var(--px-mono); padding: 3px 6px; border-radius: 8px; border: 1.5px solid var(--px-line); background: #fff; color: inherit; }
.dl-brow__ctl { display: inline-flex; gap: 2px; }
.dl-brow__ctl .px-ghost { min-width: 30px; padding: 3px 6px; }
.dl-brow__ctl .px-ghost:disabled { opacity: .35; cursor: default; }
.dl-brow.is-fixed .dl-shape { grid-column: 4; }
.dl-badd { display: grid; gap: 6px; margin-bottom: 12px; }
.dl-badd > b, .dl-blabel { display: block; font: 800 11px var(--px-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--px-faint); margin-bottom: 6px; }
.dl-badd__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dl-badd__chips .ml-bchip { display: inline-flex; align-items: baseline; gap: 4px; }
.dl-badd__chips .ml-bchip:disabled { opacity: .45; cursor: not-allowed; }
.dl-btrain { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; padding-bottom: 12px; }
@media (max-width: 700px) {
  .dl-btrain { grid-template-columns: minmax(0, 1fr); }
  .dl-brow { grid-template-columns: minmax(0, 1fr) auto; }
  .dl-brow__knob, .dl-brow__ctl { grid-row: 2; }
  .dl-brow__ctl { justify-self: end; }
  .dl-brow.is-fixed .dl-shape { grid-column: 2; }
}
.dl-toolcards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .dl-toolcards { grid-template-columns: minmax(0, 1fr); } }

/* the Shape Lab: one row per layer with its arguments, output shape and weight count */
.dl-slin { display: grid; gap: 4px; margin: 0 0 12px; max-width: 420px; }
.dl-slin > span { font: 800 11px var(--px-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--px-faint); }
.dl-slin input { font: 600 15px var(--px-mono); padding: 8px 10px; border-radius: 10px; border: 1.5px solid var(--px-line); background: #fff; color: inherit; }
.dl-slin input[aria-invalid="true"] { border-color: #E11D48; }
.dl-slin small { color: var(--px-soft); font-size: 12.5px; }
.dl-sltable { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 5px; }
.dl-slrow { display: grid; grid-template-columns: 2.2em minmax(9em, 1.1fr) minmax(0, 2fr) auto 5.5em auto; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 12px; border: 1.5px solid #F3E2EA; background: #fff; font-size: 13px; }
.dl-slrow.is-in { background: #F8FAFC; border-style: dashed; border-color: #CBD5E1; }
.dl-slrow.is-off { opacity: .45; }
.dl-slrow.is-bad { border-color: #FDA4AF; background: #FFF1F2; }
.dl-slrow__n { font: 700 11px var(--px-mono); color: var(--px-faint); text-align: right; }
.dl-slrow__name { display: grid; gap: 1px; min-width: 0; }
.dl-slrow__name code, .dl-slrow__name b { font: 700 13px var(--px-mono); color: #BE185D; background: none !important; padding: 0; }
.dl-slfx { grid-column: 2 / -1; margin-top: -4px; font: 11.5px var(--px-mono); color: var(--px-soft); }
.dl-slrow__f { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.dl-slf { display: inline-flex; align-items: center; gap: 4px; }
.dl-slf code { background: none !important; padding: 0; color: var(--px-soft); font-size: 11.5px; }
.dl-slf input, .dl-slf select { width: 4.4em; font: 600 13px var(--px-mono); padding: 3px 5px; border-radius: 7px; border: 1.5px solid var(--px-line); background: #fff; color: inherit; }
.dl-slrow .dl-shape { --sc: #BE185D; margin-top: 0; white-space: nowrap; }
.dl-slrow.is-bad .dl-shape { --sc: #E11D48; }
.dl-slrow__p { font: 600 12.5px var(--px-mono); color: var(--px-soft); text-align: right; font-variant-numeric: tabular-nums; }
.dl-slerr { grid-column: 2 / -1; display: grid; gap: 4px; }
.dl-slerr code { display: block; background: #fff !important; border: 1px solid #FECDD3; color: #9F1239; padding: 6px 8px; border-radius: 8px;
  font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.dl-slerr p { margin: 0; font-size: 13px; color: #881337; }
.dl-sltotal { margin: 4px 0 14px; font-size: 14px; color: var(--px-soft); }
.dl-sltotal .is-bad { color: #BE123C; }
@media (max-width: 700px) {
  .dl-slrow { grid-template-columns: 1.6em minmax(0, 1fr) auto; gap: 6px 8px; }
  .dl-slrow__f { grid-column: 2 / -1; }
  .dl-slrow__p { grid-column: 2; text-align: left; }
  .dl-slrow .dl-brow__ctl { grid-column: 3; justify-self: end; }
  .dl-slrow.is-in .dl-slrow__p, .dl-slrow.is-in > span:nth-child(3), .dl-slrow.is-in > span:last-child { display: none; }
}

/* the Error decoder */
.dl-edin { width: 100%; box-sizing: border-box; font: 13.5px/1.5 var(--px-mono); padding: 10px 12px; border-radius: 12px;
  border: 1.5px solid var(--px-line); background: #fff; color: inherit; resize: vertical; margin-bottom: 12px; }
.dl-edin:focus { outline: 2px solid #F9A8D4; border-color: #BE185D; }
.dl-edhit { margin: 0 0 8px; color: #047857; font-size: 14px; }
.dl-edcard { display: grid; gap: 10px; padding: 4px 0 14px; }
.dl-edcard h3 { margin: 0; font: 700 15px var(--px-mono); color: #9D174D; overflow-wrap: anywhere; }
.dl-edcard > p { margin: 0; line-height: 1.6; max-width: 70ch; }
.dl-edpair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dl-edpair figure, .dl-edcard figure { margin: 0; min-width: 0; }
.dl-edcard figcaption { font: 800 11px var(--px-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--px-faint); margin-bottom: 4px; }
.dl-edpair figure:first-child figcaption { color: #BE123C; }
.dl-edpair figure:last-child figcaption, .dl-edcard > figure figcaption { color: #047857; }
.dl-edcard pre.ml-code { margin: 0; overflow-x: auto; font-size: 12.5px; }
.dl-edex code { overflow-wrap: anywhere; }
.dl-edles { justify-self: start; font-weight: 700; font-size: 14px; }
.dl-edles.is-soon { font-weight: 400; color: var(--px-soft); }
.dl-edgroup { margin: 16px 0 6px; font-size: 15px; }
.dl-eddet { border-top: 1px solid #F3E2EA; }
.dl-eddet summary { cursor: pointer; padding: 9px 2px; list-style-position: inside; }
.dl-eddet summary code { background: none !important; padding: 0; font-size: 13px; color: #831843; overflow-wrap: anywhere; }
@media (max-width: 700px) { .dl-edpair { grid-template-columns: minmax(0, 1fr); } }

/* ── the Which architecture? chooser: the Statistics chooser's components (stats.css), in this app's rose ── */
.dl .st-ch-trail li + li::before { color: #F472B6; }
.dl .st-ch-trail button { border-color: #F9CFE3; background: #FDF2F8; color: #831843; }
.dl .st-ch-trail button:hover { border-color: #BE185D; }
.dl .st-ch-opt:hover:not(:disabled) { background: #FDF2F8; }
.dl .st-ch-res { border-color: #F5B8D3; box-shadow: 0 10px 30px -18px rgba(190, 24, 93, .55); }
.dl .st-ch-res h2 { color: #831843; }
.dl .st-ch-code pre { color: #FCE7F3; }
.dl .st-when__box--alt { border-color: #F9CFE3; background: #FFF7FB; } .dl .st-when__box--alt h3 { color: #BE185D; }
.dl .st-ch-all summary { color: #831843; }
.dl .st-ch-n { color: #F472B6; min-width: 3ch; }
