/* Editorial chart framing, without re-colouring the original data series,
   changing its curves, or suggesting a computed personal score. */
.model-player{
  --chart-ink:#413b47;
  --chart-muted:#736b74;
  --chart-line:#e1d9d0;
  --chart-paper:#fdfbf8;
  --chart-accent:#514769;
  color:var(--chart-ink);
  border:1px solid var(--chart-line);
  border-radius:16px;
  background:var(--chart-paper);
  padding:clamp(12px,2.8%,22px);
  min-width:0;
  container-type:inline-size;
}
.model-tabs,.model-controls{
  display:flex;
  min-width:0;
  align-items:center;
  flex-wrap:wrap;
  gap:7px;
}
.model-tabs{margin:0 0 14px}
.model-controls{
  margin-top:16px;
  padding-top:14px;
  border-top:1px solid var(--chart-line);
}
.model-player button{
  font:500 .94rem/1.4 var(--sans,system-ui,sans-serif);
  min-height:44px;
  min-width:44px;
  max-width:100%;
  padding:.45rem .8rem;
  border:1px solid var(--chart-line);
  background:var(--chart-paper);
  border-radius:9px;
  color:var(--chart-ink);
  overflow-wrap:anywhere;
  cursor:pointer;
}
.model-tabs button[aria-pressed=true]{
  background:#eee6ef;
  color:#5e4266;
  border-color:#a991b0;
}
.model-controls [data-play]{
  background:var(--chart-accent);
  color:#fff;
  border-color:var(--chart-accent);
  min-width:5em;
}
.model-paper{
  min-width:0;
  padding:clamp(14px,3cqw,25px) clamp(7px,2cqw,18px) 13px;
  border:1px solid #e4d9cd;
  border-radius:11px;
  background:
    radial-gradient(ellipse at 16% 8%,#fffdf8 0%,transparent 74%),
    linear-gradient(120deg,#f8f2e9,#f0ebe5 90%);
}
.model-key,.model-axis{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:7px 16px;
  font-size:.87rem;
  line-height:1.55;
  padding:0 3%;
  color:var(--chart-muted);
}
.model-key{margin-bottom:4px}
.model-key span{
  display:inline-flex;
  align-items:center;
  gap:.42rem;
  min-height:28px;
  padding:4px 9px;
  border:1px solid #e4dcd1;
  border-radius:30px;
  background:#fffcf7;
  color:var(--chart-ink);
}
.model-key span:before{
  content:'';
  display:block;
  flex:0 0 .85rem;
  height:.19rem;
  border-radius:2px;
  /* The line colour comes directly from the diagram, not from the theme. */
  background:var(--line);
}
.model-figure{min-width:0}
.model-figure svg{display:block;width:100%;height:auto}
.model-axis{justify-content:space-between}
.model-player .model-note{
  margin:16px 2px 0;
  font-size:1rem;
  line-height:1.75;
  color:var(--chart-ink);
  text-wrap:pretty;
  overflow-wrap:anywhere;
}
.model-controls input{
  flex:1 1 110px;
  width:0;
  min-width:70px;
  min-height:44px;
  accent-color:#743f5b;
  cursor:pointer;
}
.model-player :is(button,input):focus-visible{outline:2px solid #826b94;outline-offset:3px}
@container (max-width:390px){
  .model-tabs{gap:5px;margin-bottom:11px}
  .model-paper{padding:12px 4px 11px}
  .model-key,.model-axis{gap:5px 8px}
  .model-key span{padding:3px 7px}
  .model-controls{
    display:grid;
    grid-template-columns:minmax(72px,1fr) minmax(45px,2fr) minmax(52px,1fr);
    align-items:stretch;
  }
  .model-controls input{width:100%;min-width:0}
  .model-controls [data-play],.model-controls [data-reset]{min-width:0;width:100%}
}
