/* Author: Xu Chen, University of Washington. Styles for the pyodide-lab shortcode (light and dark). */
.pyl {
  --pyl-bg: #ffffff; --pyl-fg: #1f2330; --pyl-muted: #5b6170; --pyl-line: rgba(0, 0, 0, .14);
  --pyl-soft: #f4f5f8; --pyl-accent: rgb(var(--color-primary-700, 4 120 87));
  --pyl-accent-fg: #ffffff; --pyl-err: #b42318;
  margin: 1.75rem 0; padding: 1rem 1.1rem 1.1rem; border: 1px solid var(--pyl-line);
  border-left: 4px solid var(--pyl-accent); border-radius: 8px; background: var(--pyl-bg);
  color: var(--pyl-fg); font-size: 15px; line-height: 1.45;
}
.dark .pyl {
  --pyl-bg: #1f2128; --pyl-fg: #e6e6ea; --pyl-muted: #a6a9b6; --pyl-line: rgba(255, 255, 255, .16);
  --pyl-soft: #282b33; --pyl-accent: rgb(var(--color-primary-400, 52 211 153)); --pyl-accent-fg: #0d1512;
  --pyl-err: #ff8a80;
}
.pyl * { box-sizing: border-box; }
.pyl-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; }
.pyl-title { font-weight: 650; font-size: 1.05rem; margin: 0; }
.pyl-intro { margin: .45rem 0 .7rem; color: var(--pyl-muted); font-size: .92rem; }
.pyl button {
  font: inherit; font-size: .92rem; padding: .42rem .9rem; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--pyl-accent); background: var(--pyl-accent); color: var(--pyl-accent-fg);
}
.pyl button.pyl-reset { background: transparent; color: var(--pyl-accent); }
.pyl button:disabled { opacity: .5; cursor: default; }
.pyl-controls {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: .55rem 1.1rem; margin: .4rem 0 .6rem;
}
.pyl-p { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.pyl-p label, .pyl-p .pyl-l { font-size: .88rem; color: var(--pyl-fg); }
.pyl-p .pyl-hint { font-size: .78rem; color: var(--pyl-muted); }
.pyl-row { display: flex; align-items: center; gap: .5rem; }
.pyl-row input[type=range] { flex: 1 1 auto; min-width: 0; accent-color: var(--pyl-accent); }
.pyl input[type=number], .pyl select, .pyl input[type=file] {
  font: inherit; font-size: .88rem; color: var(--pyl-fg); background: var(--pyl-soft);
  border: 1px solid var(--pyl-line); border-radius: 5px; padding: .2rem .35rem;
}
.pyl input[type=number] { width: 6.2rem; flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.pyl input[type=file] { max-width: 100%; }
.pyl-p-checkbox label { display: flex; align-items: center; gap: .45rem; }
.pyl-p-checkbox input { accent-color: var(--pyl-accent); width: 1.05rem; height: 1.05rem; }
.pyl-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: .2rem 0 .7rem; }
.pyl-status { font-size: .84rem; color: var(--pyl-muted); flex: 1 1 260px; }
.pyl-status[data-kind=error] { color: var(--pyl-err); }
.pyl-busy .pyl-figs { opacity: .55; transition: opacity .15s; }
.pyl-summary { margin: 0 0 .8rem; }
.pyl-sumhead { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--pyl-muted); margin-bottom: .3rem; }
.pyl-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: .35rem .9rem; margin: 0;
}
.pyl-summary .pyl-kv { background: var(--pyl-soft); border-radius: 6px; padding: .35rem .55rem; }
.pyl-kv .k { display: block; font-size: .78rem; color: var(--pyl-muted); }
.pyl-kv .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.pyl pre {
  margin: 0; padding: .6rem .75rem; background: var(--pyl-soft); color: var(--pyl-fg); border-radius: 6px;
  font: 12.5px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap;
  overflow-wrap: anywhere; max-height: 32rem; overflow: auto;
}
.pyl-figs {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: .9rem;
}
.pyl-figs figure { margin: 0; min-width: 0; }
.pyl-figs img { display: block; width: 100%; height: auto; border-radius: 4px; background: #fff; }
.pyl-live .pyl-figs img { background: transparent; }
.pyl-figs figcaption { font-size: .82rem; color: var(--pyl-muted); margin-top: .3rem; }
.pyl details { margin-top: .7rem; }
.pyl summary { cursor: pointer; font-size: .9rem; color: var(--pyl-accent); }
.pyl details > pre, .pyl details > div { margin-top: .45rem; }
.pyl-callline { display: block; margin-top: .35rem; font: 12px/1.4 ui-monospace, Menlo, monospace; color: var(--pyl-muted); overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .pyl { padding: .8rem .75rem; font-size: 14px; }
  .pyl input[type=number] { width: 5.4rem; }
}
/* Lab pages: wide display equations scroll inside their own box on phones instead of widening the page. */
.katex-display { overflow-x: auto; overflow-y: hidden; padding: 2px 0; }
