/* Styles for the Chapter 10 heterogeneous-belief widget (ex:robust_borovicka,
   label fig:jarda_widget). Moved verbatim from the inline <style> block in
   book/10_exploring_recursive_utility.md. */
  .jarda-widget,
  .jarda-widget * {
    box-sizing: border-box;
  }

  .jarda-widget {
    margin: 1.5rem 0 2rem;
    color: #1a1a18;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  }

  .jarda-panel {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    background: #ffffff;
    padding: 1.25rem;
  }

  .jarda-title {
    margin: 0 0 0.15rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
  }

  .jarda-subtitle {
    margin: 0 0 1rem;
    color: #66645f;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.9rem;
    font-style: italic;
    line-height: 1.45;
  }

  .jarda-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    position: sticky;
    top: 0;
    z-index: 6;
    background: #ffffff;
    padding: 0.5rem 0;
  }

  .jarda-control-wide {
    grid-column: 1 / -1;
  }

  .jarda-control,
  .jarda-stat {
    border-radius: 8px;
    background: #f4f3f0;
    padding: 0.75rem;
  }

  .jarda-label {
    margin-bottom: 0.4rem;
    color: #66645f;
    font-size: 0.78rem;
    line-height: 1.2;
  }

  .jarda-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
  }

  .jarda-row input[type="range"] {
    flex: 1;
    min-width: 0;
    height: 4px;
    border-radius: 999px;
    outline: none;
    background: #d3d1c7;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
  }

  .jarda-row input[type="range"]::-webkit-slider-thumb {
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #534ab7;
    box-shadow: 0 0 0 1px rgba(83, 74, 183, 0.4);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
  }

  .jarda-row input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #534ab7;
    cursor: pointer;
  }

  .jarda-value {
    min-width: 2.6rem;
    color: #1a1a18;
    font-size: 0.92rem;
    font-weight: 600;
    text-align: right;
  }

  .jarda-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.6rem;
    margin-bottom: 0.85rem;
  }

  .jarda-stat-value {
    color: #1a1a18;
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
  }

  .jarda-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .jarda-plot {
    display: none;
    min-width: 0;
    border-radius: 8px;
    background: #f4f3f0;
    padding: 0.6rem 0.6rem 0.5rem;
  }

  .jarda-plot-full {
    grid-column: 1 / -1;
  }

  .jarda-plot-title {
    margin: 0 0 0.4rem 0.1rem;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
  }

  .jarda-chart {
    position: relative;
    width: 100%;
    height: 220px;
  }

  .jarda-chart-tall {
    height: 300px;
  }

  .jarda-note {
    margin: 0.65rem 0 0;
    color: #74716a;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.82rem;
    font-style: italic;
    line-height: 1.4;
    text-align: center;
  }

  .jarda-fallback {
    display: none;
    margin-top: 0.75rem;
    color: #7a2f1f;
    font-size: 0.85rem;
  }

  @media (max-width: 640px) {
    .jarda-panel {
      padding: 1rem;
    }

    .jarda-controls,
    .jarda-grid {
      grid-template-columns: 1fr;
    }

    .jarda-stats {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .jarda-chart {
      height: 200px;
    }

    .jarda-chart-tall {
      height: 260px;
    }
  }

  @media (prefers-color-scheme: dark) {
    .jarda-widget {
      color: #e8e6e0;
    }

    .jarda-panel {
      border-color: rgba(255, 255, 255, 0.12);
      background: #242422;
    }

    .jarda-controls {
      background: #242422;
    }

    .jarda-subtitle,
    .jarda-label,
    .jarda-note {
      color: #b0ada5;
    }

    .jarda-control,
    .jarda-stat,
    .jarda-plot {
      background: #2e2e2b;
    }

    .jarda-value,
    .jarda-stat-value {
      color: #e8e6e0;
    }

    .jarda-row input[type="range"] {
      background: #444441;
    }

    .jarda-fallback {
      color: #ffb39e;
    }
  }
