:root {
  color-scheme: light;
  --border: #d8e2ef;
  --ink: #172033;
  --muted: #64748b;
  --panel: #fff;
  --bg: #f6f9fc;
  --first: #dc2626;
  --second: #2563eb;
  --neutral: #8a94a6;
  --head-height: 58px;
  --options-height: 290px;
  --gap: 8px;
}
* {
  box-sizing: border-box;
}
html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}
body {
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: Helvetica, Arial, sans-serif;
  font-size: 12px;
}
body:has(.options[open]) {
  overflow-x: hidden;
  overflow-y: auto;
}
button,
select,
input,
a {
  font: inherit;
}
.wrap {
  height: 100%;
  padding: 8px;
}
.report {
  height: 100%;
  max-width: 1900px;
  margin: 0 auto;
}
.head {
  height: var(--head-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: var(--gap);
}
.title-block {
  min-width: 0;
}
.head h1 {
  margin: 0;
  font-size: 29px;
  line-height: 1.05;
  font-weight: 900;
  white-space: nowrap;
}
.sub {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.comparison-controls {
  display: flex;
  align-items: end;
  gap: 7px;
  flex: 0 0 auto;
  padding-bottom: 2px;
}
.documentation-return {
  align-self: end;
  height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border: 1px solid #b9c8da;
  border-radius: 5px;
  background: #f8fbff;
  color: #26364d;
  font-size: 10px;
  font-weight: 900;
  text-decoration: none;
}
.documentation-return:hover {
  background: #eef5fc;
}
.documentation-return[hidden] {
  display: none;
}
.comparison-controls label,
.format-row,
.selected-toolbar label {
  display: grid;
  gap: 3px;
  color: #526176;
  font-size: 10px;
  font-weight: 900;
}
.comparison-controls select {
  width: 150px;
  height: 28px;
  padding: 2px 7px;
}
.versus {
  padding: 0 1px 7px;
  color: #526176;
  font-size: 11px;
  font-weight: 900;
}
.options {
  height: var(--options-height);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 8px;
  margin-bottom: var(--gap);
}
.options:not([open]) {
  height: 34px;
}
.options > summary {
  height: 33px;
  cursor: pointer;
  padding: 8px 10px;
  font-weight: 900;
}
.options-grid {
  height: calc(var(--options-height) - 34px);
  display: grid;
  grid-template-columns: 270px 430px minmax(0, 1fr);
  grid-template-areas: "actions samples selected";
  gap: 8px;
  padding: 0 8px 8px;
  align-items: stretch;
}
.options-actions {
  grid-area: actions;
}
.options-samples {
  grid-area: samples;
}
.selected-card {
  grid-area: selected;
}
.option-col {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}
.section-title {
  margin: 0 0 5px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #46566c;
  font-weight: 900;
}
.group-title {
  margin-top: 7px;
}
.card,
.rank-card,
.volcano-card,
.selected-card,
.aggregate-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.export-stack,
.control-stack {
  display: grid;
  gap: 4px;
  padding: 6px;
}
.export-stack {
  grid-template-columns: 1fr 1fr;
}
.format-row {
  grid-column: 1/-1;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
}
.format-row select {
  width: 100%;
  height: 28px;
  padding: 2px 7px;
}
.export-stack button,
.export-stack .button-link {
  width: 100%;
  height: 28px;
  padding: 3px 7px;
  text-align: center;
  white-space: nowrap;
  font-size: 10px;
}
.button-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.color-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}
.color-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  font-size: 9px;
  font-weight: 800;
}
.color-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.color-row input[type="color"] {
  width: 28px;
  min-width: 28px;
  height: 22px;
  padding: 1px;
}
.rows-control {
  display: grid;
  grid-template-columns: 34px minmax(80px, 1fr) 50px;
  align-items: center;
  gap: 5px;
  color: #526176;
  font-size: 10px;
  font-weight: 900;
}
.rows-control input[type="number"] {
  width: 50px;
}
.sample-style-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.sample-style-group {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 5px;
}
.sample-style-group-title {
  display: flex;
  gap: 5px;
  align-items: center;
  font-weight: 900;
  margin-bottom: 4px;
}
.sample-style-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.sample-style-row {
  display: grid;
  grid-template-columns: 24px minmax(88px, 1fr) 39px 46px 46px 60px;
  gap: 4px;
  align-items: center;
  min-height: 25px;
}
.sample-style-head {
  font-size: 9px;
  font-weight: 900;
  color: #526176;
}
.sample-style-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}
.sample-style-row input,
.sample-style-row select {
  width: 100%;
  min-width: 0;
  height: 22px;
  padding: 0 2px;
  border: 1px solid #c6d3e1;
  border-radius: 4px;
  background: #fff;
}
.sample-style-row input[type="checkbox"] {
  width: 14px;
  height: 14px;
}
.sample-style-row input[type="color"] {
  width: 39px;
  padding: 1px;
}
.selected-card {
  padding: 6px;
}
.selected-toolbar {
  height: 23px;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.selected-toolbar label {
  grid-template-columns: auto 52px;
  align-items: center;
}
.selected-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 5px;
}
.selected-motif {
  min-width: 0;
  border: 1px solid #e1e8f0;
  border-radius: 7px;
  background: #fff;
  padding: 5px;
  cursor: pointer;
}
.selected-motif.active {
  outline: 2px solid #93c5fd;
}
.selected-head {
  margin-bottom: 3px;
}
.panel-tf {
  width: 100%;
  min-width: 0;
  height: 23px;
  border: 1px solid #c6d3e1;
  border-radius: 5px;
  background: #fff;
  font-size: 10px;
}
.motif-logo {
  height: 65px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 3px;
}
.motif-logo svg {
  display: block;
  width: 100%;
  height: 100%;
}
.motif-logo img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 60px;
  object-fit: contain;
}
.logo-empty {
  color: #94a3b8;
  font-size: 10px;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 5px;
}
.detail-grid p {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  color: #526176;
}
.motif-group {
  grid-column: 1/-1;
  font-size: 11px !important;
  font-weight: 900;
}
.metric-line {
  font-weight: 800;
  color: #334155 !important;
}
.dashboard {
  height: calc(
    100vh - 16px - var(--head-height) - var(--options-height) - var(--gap) * 2
  );
  display: grid;
  grid-template-columns: minmax(280px, 0.62fr) minmax(390px, 0.82fr) minmax(
      720px,
      1.65fr
    );
  grid-template-areas: "rank volcano aggregate";
  gap: var(--gap);
  align-items: stretch;
}
.report:has(.options:not([open])) .dashboard {
  height: calc(100vh - 16px - var(--head-height) - 34px - var(--gap) * 2);
}
.options[open] + .dashboard {
  min-height: 520px;
}
.dashboard > * {
  min-width: 0;
  min-height: 0;
}
.rank-card {
  grid-area: rank;
  padding: 6px;
  overflow: auto;
}
.volcano-card {
  grid-area: volcano;
  padding: 5px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.aggregate-card {
  grid-area: aggregate;
  padding: 6px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 5px;
  overflow: hidden;
}
.aggregate-grid {
  grid-column: 1;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(var(--aggregate-cols, 2), minmax(0, 1fr));
  grid-template-rows: repeat(var(--aggregate-rows, 2), minmax(0, 1fr));
  gap: 5px;
  min-width: 0;
  min-height: 0;
}
.aggregate-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  align-self: center;
  border: 1px solid #e1e8f0;
  border-radius: 7px;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
}
.aggregate-tile.active {
  outline: 2px solid #93c5fd;
}
.aggregate-legend {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 5px 10px;
  min-width: 0;
  padding: 5px 7px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  color: #334155;
}
.legend-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 3px 8px;
  min-width: 0;
}
.legend-group-title {
  grid-column: 1/-1;
  overflow: hidden;
  color: #172033;
  font-size: 10px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.legend-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 5px;
  align-items: center;
  min-width: 0;
}
.legend-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.legend-line {
  width: 32px;
  height: 0;
  border-top-width: 3px;
  border-top-style: solid;
}
.rank-card #rank-chart,
.volcano-card #chart,
.aggregate-panel {
  display: block;
  width: 100%;
  height: 100%;
}
.volcano-card #chart {
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1/1;
}
.aggregate-panel {
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1/1;
}
.plot-title {
  font-size: 15px;
  font-weight: 900;
  fill: #172033;
}
.summary-label {
  font-size: 10px;
  font-weight: 700;
  fill: #64748b;
}
.axis {
  stroke: #344256;
  stroke-width: 1.2;
}
.zero {
  stroke: #7c8798;
  stroke-width: 1.1;
  stroke-dasharray: 4 4;
}
.grid {
  stroke: #e3eaf3;
  stroke-width: 1;
}
.tick {
  font-size: 11px;
  fill: #526176;
  font-weight: 700;
}
.axis-label {
  font-size: 12px;
  fill: #243247;
  font-weight: 900;
}
.rank-bar,
.rank-name,
.pt {
  cursor: pointer;
}
.rank-bar.active {
  stroke: #111827;
  stroke-width: 1.5;
}
.pt.selected {
  filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.28));
}
.status {
  position: fixed;
  right: 8px;
  bottom: 3px;
  z-index: 20;
  margin: 0;
  padding: 2px 5px;
  background: rgba(246, 249, 252, 0.88);
  color: var(--muted);
  font-size: 9px;
  pointer-events: none;
}
button,
select,
input,
.button-link {
  border: 1px solid #b9c8da;
  border-radius: 5px;
  background: #f8fbff;
  color: #26364d;
  font-weight: 800;
}
button,
.button-link {
  cursor: pointer;
}
button:hover,
.button-link:hover {
  background: #eef5fc;
}
select,
input {
  background: #fff;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 1540px) {
  .head h1 {
    font-size: 25px;
  }
  .options-grid {
    grid-template-columns: 250px 390px minmax(0, 1fr);
  }
  .selected-grid {
    grid-template-columns: repeat(4, minmax(105px, 1fr));
  }
  .dashboard {
    height: auto;
    min-height: 620px;
    grid-template-columns: minmax(300px, 0.75fr) minmax(430px, 1fr);
    grid-template-areas: "rank volcano" "aggregate aggregate";
  }
  .rank-card,
  .volcano-card {
    height: 620px;
  }
  .aggregate-card {
    height: 650px;
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 1100px) {
  body {
    overflow: auto;
  }
  .wrap,
  .report {
    height: auto;
  }
  .head {
    height: auto;
    min-height: 58px;
    flex-wrap: wrap;
  }
  .head h1,
  .sub {
    white-space: normal;
  }
  .options,
  .options[open] {
    height: auto;
  }
  .options-grid {
    height: auto;
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "actions samples" "selected selected";
  }
  .option-col {
    max-height: none;
  }
  .selected-grid {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
  }
  .dashboard,
  .report:has(.options:not([open])) .dashboard {
    height: auto;
    min-height: 620px;
    grid-template-columns: minmax(300px, 0.75fr) minmax(430px, 1fr);
    grid-template-areas: "rank volcano" "aggregate aggregate";
  }
  .rank-card,
  .volcano-card {
    height: 620px;
  }
  .aggregate-card {
    height: 760px;
  }
}
@media (max-width: 720px) {
  body {
    overflow: auto;
  }
  .wrap {
    padding: 5px;
  }
  .head {
    display: block;
  }
  .head h1 {
    font-size: 23px;
  }
  .comparison-controls {
    margin-top: 8px;
    justify-content: flex-start;
  }
  .comparison-controls label {
    flex: 1;
  }
  .comparison-controls select {
    width: 100%;
  }
  .options-grid {
    grid-template-columns: 1fr;
    grid-template-areas: "actions" "samples" "selected";
  }
  .selected-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard,
  .report:has(.options:not([open])) .dashboard {
    display: block;
    min-height: 0;
  }
  .rank-card,
  .volcano-card,
  .aggregate-card {
    height: auto;
    min-height: 430px;
    margin-bottom: 7px;
  }
  .aggregate-card {
    display: block;
  }
  .aggregate-legend {
    margin-bottom: 6px;
    grid-template-columns: 1fr;
  }
  .aggregate-grid {
    height: auto;
    grid-template-columns: 1fr;
  }
  .aggregate-tile {
    height: 360px;
    aspect-ratio: auto;
  }
  .status {
    position: static;
    padding: 4px 7px;
  }
}
