.rating-reader { padding: 28px; border: 1px solid #cbdde7; border-radius: 15px; background: var(--light); }
.reader-intro { display: block; }
.reader-intro h2 { margin: 0 0 4px; font: 400 30px/1.22 Georgia, serif; }
.reader-intro p { margin: 0; color: var(--muted); font-size: 14px; }
.level-control { margin: 22px 0 17px; padding: 18px 22px 13px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.level-label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.level-label label { font-size: 16px; font-weight: 700; }
.level-label output { color: var(--accent-dark); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.level-control input[type=range] { display: block; width: 100%; min-height: 52px; margin: 6px 0 0; accent-color: var(--accent); cursor: pointer; }
.level-control input[type=range]:focus-visible, .compare-control input:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.level-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.reader-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, .8fr); gap: 18px; }
.reader-figure, .reader-result, .reader-table, .compare-control { min-width: 0; border-radius: 10px; }
.reader-figure { align-self: start; margin: 0; padding: 16px 14px 13px; border: 1px solid var(--line); background: white; }
.reader-figure svg { display: block; width: 100%; height: auto; }
.reader-figure svg text { fill: var(--muted); font: 13px Arial, sans-serif; }
.reader-figure svg .axis-title { fill: var(--ink); font-size: 15px; }
.plot-grid { stroke: #dfe9ef; stroke-width: 1; }
.plot-axis { stroke: #657b88; stroke-width: 1.3; }
.rating-path-a { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.rating-path-b { fill: none; stroke: var(--warm); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.guide-stage { stroke: var(--ink); stroke-width: 1.6; stroke-dasharray: 5 4; }
.guide-a { stroke: var(--accent); stroke-width: 1.8; stroke-dasharray: 5 4; }
.guide-b { stroke: var(--warm); stroke-width: 1.8; stroke-dasharray: 5 4; }
.selected-marker-a { fill: var(--accent); stroke: white; stroke-width: 3; }
.selected-marker-b { fill: var(--warm); stroke: white; stroke-width: 2.5; }
.reader-figure figcaption { display: flex; flex-wrap: wrap; gap: 4px 17px; margin: 8px 4px 0; color: var(--muted); font-size: 12px; }
.legend-a::before, .legend-b::before { content: ''; display: inline-block; width: 16px; height: 3px; margin-right: 7px; vertical-align: middle; background: var(--accent); }
.legend-b::before { background: var(--warm); }
.reader-side { display: flex; flex-direction: column; gap: 12px; }
.reader-result { padding: 20px 23px; background: var(--ink); color: white; }
.result-label { margin: 0; color: #c7d9e5; font-size: 13px; font-weight: 700; }
#result-live { margin: 5px 0 1px; font-size: clamp(30px, 3vw, 40px); font-weight: 700; line-height: 1.12; font-variant-numeric: tabular-nums; white-space: nowrap; }
#result-stage { margin: 0; color: #c7d9e5; font-size: 14px; }
.comparison-result { margin-top: 16px; padding-top: 13px; border-top: 1px solid #577080; }
.comparison-result p { margin: 0; color: #f4d2c7; font-size: 13px; }
.comparison-result strong { display: block; color: white; font-size: 27px; font-variant-numeric: tabular-nums; }
.comparison-result #difference-note { margin-top: 4px; color: #f4d2c7; }
.compare-control { display: flex; align-items: center; gap: 11px; min-height: 47px; padding: 9px 13px; border: 1px solid #aabfce; background: white; cursor: pointer; font-size: 14px; font-weight: 700; }
.compare-control input { width: 19px; height: 19px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.reader-table { flex: 1; padding: 14px 16px; border: 1px solid var(--line); background: white; }
.reader-table h3 { margin: 0 0 7px; font-size: 15px; }
.reader-table table, .article-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.reader-table th, .reader-table td, .article-table th, .article-table td { padding: 7px 9px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.reader-table th:first-child, .article-table th:first-child { text-align: left; }
.reader-table thead th { color: var(--muted); font-size: 12px; }
.reader-table tbody th { font-weight: 400; }
.reader-table .selected-row { background: #dcecf5; color: var(--ink); font-weight: 700; }
.reader-table .selected-row th { font-weight: 700; }
.fiction-note { margin: 16px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.noscript-note { margin: 15px 0 0; }

.rating-reader { container-type: inline-size; padding: 18px; margin: 30px 0; font-size: 16px; line-height: 1.6; }
.reader-side { display: contents; }
.reader-figure { grid-column: 1; grid-row: 1 / 3; }
.reader-result { grid-column: 2; grid-row: 1; }
.compare-control { grid-column: 2; grid-row: 2; align-self: start; }
.reader-table { grid-column: 1 / -1; }
.reader-figure svg text { font-size: 22px; }
.reader-figure svg .axis-title { font-size: 24px; }
.reader-figure svg text[transform] { display: none; }
#rating-plot::before { content: 'Stage (m)'; display: block; margin: 0 0 -8px 8px; color: var(--ink); font-size: 12px; }
#article .rating-reader h2 { margin: 0 0 4px; font-size: 28px; }
#article .rating-reader p { margin: 0; }
#article .rating-reader #result-live { margin: 5px 0 1px; }
#article .rating-reader .fiction-note { margin-top: 16px; }
@container (max-width: 550px) {
  .reader-grid { display: flex; flex-direction: column; }
  .reader-side { display: contents; }
  .reader-result { order: 1; }
  .reader-figure { order: 2; width: 100%; }
  .compare-control { order: 3; }
  .reader-table { order: 4; }
}
@container (max-width: 380px) {
  .reader-intro { display: block; }
  .level-control { padding: 12px; }
  .level-label output { font-size: 21px; }
  .reader-figure { padding: 9px 5px; }
  #rating-plot::before { content: 'Stage (m)'; display: block; margin: 0 0 -8px 8px; color: var(--ink); font-size: 12px; }
  .reader-figure svg text { font-size: 22px; }
  .reader-figure svg .axis-title { font-size: 24px; }
  .reader-figure svg text[transform] { display: none; }
  .reader-table th, .reader-table td { padding: 7px 6px; font-size: 13px; }
}
