 #app {
    font-family: system-ui, -apple-system, sans-serif;
    max-width: 420px; margin: 0 auto; color: #1a1d24;
    background: #ffffff; border-radius: 14px; padding: 16px;
  }

  #marginalApp {
    font-family: system-ui, -apple-system, sans-serif;
    max-width: 420px; margin: 0 auto 24px; color: #1a1d24;
    background: #ffffff; border-radius: 14px; padding: 16px;
  }
  #marginalCanvasWrap { position: relative; padding-left: 22px; padding-bottom: 22px; }
  #cvMarginal {
    width: 100%; height: auto; aspect-ratio: 1; display: block;
    background: #ffffff; border-radius: 10px; cursor: crosshair;
  }
  .axisLabelY {
    position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    font-size: 15px; color: #1a1d24;
  }
  .axisLabelX {
    position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
    font-size: 15px; color: #1a1d24;
  }
  #marginalApp .caption {
    font-size: 13px; color: #5a6072; text-align: center; margin: 10px 0 0;
  }

  #histApp {
    max-width: 680px; box-sizing: border-box; margin: 0 auto 24px;
    background: #ffffff; border-radius: 14px; padding: 16px;
  }
  #histCanvases { display: flex; gap: 0; }
  #histCanvases canvas { height: auto; width: auto; min-width: 0; display: block; }
  /* flex-grow proportionnel à la largeur logique (attribut width) de chaque canvas, aspect-ratio assorti
     -> les 3 canvas gardent automatiquement la même hauteur affichée quelle que soit la largeur du conteneur */
  #cvHist1, #cvHist2 { flex: 220 1 0; aspect-ratio: 220 / 420; }
  #cvCoupling { flex: 280 1 0; aspect-ratio: 280 / 420; }
  #histApp .caption { font-size: 13px; color: #5a6072; text-align: center; margin: 10px 0 0; }

  #canvasWrap { position: relative; }
  #cv {
    width: 100%; height: auto; aspect-ratio: 1; display: block;
    background: #ffffff;
    border-radius: 10px;
  }
  #tBadge {
    position: absolute; top: 10px; left: 12px;
    background: rgba(255,255,255,.85); padding: 4px 10px; border-radius: 7px;
    font-size: 13px; font-variant-numeric: tabular-nums; color: #111827;
    border: 1px solid #e2e4ea;
  }

  .controls { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
  #playBtn {
    width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
    background: linear-gradient(135deg,#374151,#111827); color: #fff; font-size: 14px;
    flex-shrink: 0; transition: transform .12s;
  }
  #playBtn:hover:not(:disabled) { transform: scale(1.06); }
  #playBtn:disabled { opacity: .4; cursor: default; }
  input[type=range] { accent-color: #374151; cursor: pointer; }
  #scrub { flex: 1; }
  .mono { font-variant-numeric: tabular-nums; font-size: 13px; color: #5a6072; min-width: 64px; }

  body {
    font-family: "Computer Modern Serif", serif;
    max-width: 730px;
    margin: 0 auto;
    padding: 2rem 1rem;
  }
  pre.pseudocode {
    font-family: "Courier New", Courier, monospace;
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    line-height: 1.5;
    font-size: 0.9rem;
  }
  .data-table-wrap {
    box-sizing: border-box;
    width: 90%;
    overflow-x: auto;
    margin: 1.25rem auto;
  }
  table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
  }
  table.data-table thead th {
    text-align: left;
    padding: 0.5rem 1rem 0.5rem 0;
    font-weight: 600;
    border-bottom: 1px solid #333;
  }
  table.data-table tbody td {
    padding: 0.5rem 1rem 0.5rem 0;
    border-bottom: 1px solid #ddd;
  }
