/* Kimi K3 course — router / load-balancing explorer and activation plotter.
   Shared file: both are width-axis widgets used together in lesson 7. */

/* ─── Router simulator ─────────────────────────────────── */

.rsim {
  background: #fbfaf4;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1.1rem 1.3rem 1rem;
  margin: 2rem 0;
}

.rs-modes { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }

.rs-m {
  font-family: var(--mono);
  font-size: 0.73rem;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  transition: all 0.12s;
}
.rs-m:hover { border-color: var(--width); color: var(--width); }
.rs-m.is-on {
  border-color: var(--width);
  background: var(--width-bg);
  color: var(--width);
  font-weight: 600;
}

.rs-tag {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--width);
  color: var(--paper);
  border-radius: 2px;
  padding: 0.05rem 0.28rem;
  margin-left: 0.35rem;
  vertical-align: 1px;
}

/* Load bars, one column per expert */
.rs-bars {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 8rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.5rem 0.6rem;
}

.rs-col {
  flex: 1;
  display: flex;
  align-items: flex-end;
  height: 100%;
  cursor: help;
}

.rs-col i {
  display: block;
  width: 100%;
  background: var(--width);
  border-radius: 1px 1px 0 0;
  transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 1px;
}
.rs-col.is-hot i  { background: var(--warn); }
.rs-col.is-dead i { background: var(--warn); min-height: 2px; opacity: 0.35; }

.rs-target {
  position: absolute;
  left: 0.6rem; right: 0.6rem;
  height: 0;
  border-top: 1px dashed var(--seq);
  opacity: 0.7;
  pointer-events: none;
}
.rs-target::after {
  content: attr(data-label);
  position: absolute;
  right: 0;
  top: -1.05rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--seq);
}

.rs-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem;
  margin: 0.85rem 0;
}

.rs-k {
  display: block;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.15rem;
  line-height: 1.3;
}

.rs-stats b {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}
.rs-stats b.rs-bad { color: var(--warn);   }
.rs-stats b.rs-mid { color: var(--depth);  }
.rs-stats b.rs-ok  { color: var(--vision); }

.rs-actions { display: flex; gap: 0.45rem; flex-wrap: wrap; }

.rs-go, .rs-reset {
  font-family: var(--mono);
  font-size: 0.73rem;
  border-radius: 3px;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  transition: all 0.12s;
}
.rs-go {
  color: var(--paper);
  background: var(--width);
  border: 1px solid var(--width);
}
.rs-go:hover:not(:disabled) { filter: brightness(1.12); }
.rs-go:disabled { opacity: 0.35; cursor: not-allowed; }
.rs-reset {
  color: var(--ink-soft);
  background: none;
  border: 1px solid var(--rule);
}
.rs-reset:hover { border-color: var(--ink-soft); color: var(--ink); }

.rs-note {
  font-size: 0.87rem;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0.9rem 0 0;
  min-height: 4.2em;
}
.rs-note b { color: var(--ink); }
.rs-note q { font-style: italic; }
.rs-dead-t { color: var(--warn); font-weight: 600; }

/* ─── Activation plotter ───────────────────────────────── */

.aplot {
  background: #fbfaf4;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1.1rem 1.3rem 1rem;
  margin: 2rem 0;
}

.ap-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}

.ap-legend { display: flex; gap: 1rem; }

.ap-l {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.ap-l::before {
  content: "";
  width: 0.85rem;
  height: 2px;
  background: var(--c);
  border-radius: 1px;
}

.ap-zoom { display: flex; gap: 0.35rem; }

.ap-z {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
}
.ap-z:hover { border-color: var(--width); color: var(--width); }
.ap-z.is-on {
  border-color: var(--width);
  background: var(--width-bg);
  color: var(--width);
  font-weight: 600;
}

.ap-svg {
  display: block;
  width: 100%;
  height: auto;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
}

.aplot .ap-tbl { margin: 0.9rem 0 0; font-size: 0.83rem; }
.aplot .ap-tbl th { font-size: 0.62rem; padding-bottom: 0.3rem; }
.aplot .ap-tbl td { padding: 0.3rem 0.7rem 0.3rem 0; }
.aplot .ap-tbl td:first-child { font-family: var(--mono); }
.ap-d { color: var(--warn); font-weight: 600; }

.ap-note {
  font-size: 0.87rem;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0.85rem 0 0;
  min-height: 3.2em;
}

@media (max-width: 34rem) {
  .rs-stats { grid-template-columns: repeat(2, 1fr); }
  .rs-bars { height: 6rem; }
}

@media print {
  .rsim, .aplot { background: #fff; page-break-inside: avoid; }
  .rs-modes, .rs-actions, .ap-zoom { display: none; }
  .rs-note, .ap-note { min-height: 0; }
}
