.three-flavor-triangle {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  width: min(1450px, 100%);
  margin: 0.12rem auto 0;
  color: #eef3f8;
  font: 16px/1.18 system-ui, sans-serif;
}

.three-flavor-triangle * { box-sizing: border-box; }

.three-flavor-triangle__controls,
.three-flavor-triangle__visual {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(6, 10, 16, 0.96);
}

.three-flavor-triangle__control + .three-flavor-triangle__control {
  margin-top: 7px;
}

.three-flavor-triangle__label,
.three-flavor-triangle__control label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
  color: #d4e1ea;
  font-size: 0.9em;
}

.three-flavor-triangle__control output {
  color: #7cc7ff;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
}

.three-flavor-triangle input[type="range"] {
  display: block;
  width: 100%;
  margin: 2px 0 0;
  accent-color: #58b8ff;
}

.three-flavor-triangle__buttons,
.three-flavor-triangle__transport {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 5px;
}

.three-flavor-triangle button {
  min-height: 30px;
  padding: 4px 5px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: #e8f1f9;
  font: 700 0.84em/1 system-ui, sans-serif;
  cursor: pointer;
}

.three-flavor-triangle button:hover,
.three-flavor-triangle button:focus-visible { border-color: #72c8ff; }

.three-flavor-triangle button.is-active {
  border-color: #58b8ff;
  background: #58b8ff;
  color: #06101a;
}

.three-flavor-triangle__readout {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 7px;
  margin-top: 8px;
  padding: 7px 9px;
  border-radius: 7px;
  background: rgba(88, 184, 255, 0.1);
  color: #d7e6ef;
  font-size: 0.82em;
}

.three-flavor-triangle__readout strong {
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.three-flavor-triangle__transport { margin-top: 8px; }

.three-flavor-triangle__plot {
  position: relative;
  width: min(100%, 960px);
  height: 417px;
  margin: 0 auto;
}

.three-flavor-triangle__plot svg {
  display: block;
  width: 100%;
  height: 100%;
}

.three-flavor-triangle__grid path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 1.3;
}

.three-flavor-triangle__grid path:first-child {
  stroke: rgba(255, 255, 255, 0.67);
  stroke-width: 2.2;
}

.three-flavor-triangle__trail {
  fill: none;
  stroke: rgba(126, 226, 174, 0.72);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.three-flavor-triangle__halo {
  fill: rgba(126, 226, 174, 0.18);
  stroke: rgba(126, 226, 174, 0.55);
  stroke-width: 1.5;
}

.three-flavor-triangle__point {
  fill: #7ee2ae;
  stroke: #061018;
  stroke-width: 2.4;
}

.three-flavor-triangle__vertex {
  position: absolute;
  font-size: 17px;
  font-weight: 750;
  white-space: nowrap;
}

.three-flavor-triangle__vertex--e {
  top: 0;
  left: 50%;
  color: #58b8ff;
  transform: translateX(-50%);
}

.three-flavor-triangle__vertex--mu {
  bottom: 0;
  left: 13%;
  color: #ffc85c;
}

.three-flavor-triangle__vertex--tau {
  right: 13%;
  bottom: 0;
  color: #dd8bff;
}

.three-flavor-triangle__probabilities {
  display: grid;
  gap: 6px;
  padding: 8px 18px 0;
}

.three-flavor-triangle__probabilities > div {
  display: grid;
  grid-template-columns: 155px minmax(0, 1fr) 58px;
  align-items: center;
  gap: 10px;
  color: #e7eef4;
  font-size: 17px;
}

.three-flavor-triangle__probabilities > div:nth-child(1) > span { color: #58b8ff; }
.three-flavor-triangle__probabilities > div:nth-child(2) > span { color: #ffc85c; }
.three-flavor-triangle__probabilities > div:nth-child(3) > span { color: #dd8bff; }

.three-flavor-triangle__bar-bg {
  height: 15px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.three-flavor-triangle__bar-bg > div {
  height: 100%;
  border-radius: inherit;
}

.three-flavor-triangle__probabilities > div:nth-child(1) .three-flavor-triangle__bar-bg > div { background: #58b8ff; }
.three-flavor-triangle__probabilities > div:nth-child(2) .three-flavor-triangle__bar-bg > div { background: #ffc85c; }
.three-flavor-triangle__probabilities > div:nth-child(3) .three-flavor-triangle__bar-bg > div { background: #dd8bff; }

.three-flavor-triangle__probabilities strong {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.three-flavor-triangle__status {
  margin-top: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(126, 226, 174, 0.09);
  color: #d5eee1;
  font-size: 16px;
  text-align: center;
}

.three-flavor-triangle__status strong { color: #fff; }

@media (max-width: 900px) {
  .three-flavor-triangle {
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 9px;
    font-size: 13px;
  }
  .three-flavor-triangle__controls,
  .three-flavor-triangle__visual { padding: 8px; }
  .three-flavor-triangle__plot { height: auto; aspect-ratio: 760 / 330; }
  .three-flavor-triangle__vertex { font-size: 13px; }
  .three-flavor-triangle__probabilities > div {
    grid-template-columns: 110px minmax(0, 1fr) 48px;
    font-size: 13px;
  }
}
