* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  overscroll-behavior: none;
  background: #f4efe6;
  color: #2d2a26;
  font-family: "IBM Plex Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  overflow: hidden;
}
@media (max-width: 760px) {
  body {
    overflow: auto;
  }
}

sub, sup {
  font-size: 0.72em;
  line-height: 0;
}

button {
  font-family: inherit;
  color: inherit;
}

.Respiration {
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr);
  height: 100vh;
}
@media (max-width: 760px) {
  .Respiration {
    height: auto;
  }
}

.Header {
  display: flex;
  align-items: center;
  height: 48px;
  padding-right: 20px;
}
.Header-Title .Intro-Title {
  margin: 0 16px 0 2px;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.Logo {
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 22px;
}
.Logo-Text {
  font-family: Quicksand, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "BIZ UDGothic", meiryo, sans-serif;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.5;
  color: #1f2328;
  cursor: pointer;
  user-select: none;
}

@keyframes menu-slide-in {
  from {
    opacity: 0;
    transform: translateX(-48px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.Menu {
  position: fixed;
  top: 48px;
  left: 0;
  z-index: 10003;
  display: none;
  flex-direction: column;
  max-width: 320px;
  max-height: calc(100vh - 48px - 12px);
  background: #ffffff;
  border-radius: 0 20px 20px 0;
  box-shadow: 0 0 3px 1px #f7f7f7;
  font-family: BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "BIZ UDGothic", meiryo, sans-serif;
  overflow-y: scroll;
  overscroll-behavior-y: none;
  scrollbar-width: none;
}
.Menu::-webkit-scrollbar {
  display: none;
}
.Menu[data-open] {
  display: flex;
  animation: menu-slide-in 0.25s;
}

.MenuMain {
  padding: 16px 0;
}
.MenuMain-Link {
  height: 36px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0 24px;
  font-size: 14px;
  line-height: 22px;
  color: #1f2328;
  text-decoration: none;
  white-space: nowrap;
}

.MenuFooter {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 24px;
  border-top: 1px solid #f9f9f9;
}
.MenuFooter-Legal {
  display: flex;
  align-items: center;
  gap: 16px;
}
.MenuFooter-Link {
  font-size: 12px;
  line-height: 18px;
  color: #1f1f1f;
  text-decoration: none;
}
.MenuFooter-Copyright {
  margin: 0;
  font-size: 12px;
  line-height: 18px;
  color: #1f1f1f;
}

.ModeLink {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: #efe7db;
}
.ModeLink-Item {
  padding: 6px calc(16px + 3px);
  border-radius: 999px;
  color: #6f675e;
  font-size: 13px;
  text-decoration: none;
}
.ModeLink-Item:hover {
  color: #2d2a26;
}
.ModeLink-Item[data-active] {
  background: #fbf8f2;
  color: #2d2a26;
}

.Workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 372px;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
}
@media (max-width: 1100px) {
  .Workspace {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}
@media (max-width: 760px) {
  .Workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
  }
}

.Stage {
  grid-column: 1;
  grid-row: 1;
  min-height: 0;
  padding: 0 12px 0 16px;
}
@media (max-width: 760px) {
  .Stage {
    height: 72vh;
    padding: 0 8px;
  }
}
.Stage-Canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.Stage-Canvas[data-pointer] {
  cursor: pointer;
}

.Control {
  grid-column: 1;
  grid-row: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) auto minmax(0, 1.5fr);
  gap: 22px;
  align-items: start;
  margin: 6px 12px 14px 16px;
  padding: 16px calc(18px + 3px);
  border-radius: 18px;
  background: #fbf8f2;
}
@media (max-width: 1100px) {
  .Control {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .Control .Count {
    grid-column: 1/span 2;
  }
}
@media (max-width: 760px) {
  .Control {
    grid-row: auto;
    grid-template-columns: minmax(0, 1fr);
    margin: 8px;
  }
}
.Control-Setting {
  display: grid;
  gap: 14px;
}
.Control-Action {
  min-height: 36px;
  padding: 8px 14px;
  border: none;
  border-radius: 12px;
  background: #e2ecf2;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.Control-Action:hover {
  background: #d5e3ec;
}

.Slider {
  display: grid;
  gap: 4px;
}
.Slider-Head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}
.Slider-Label {
  font-weight: 500;
}
.Slider-Value {
  color: #6f675e;
  font-variant-numeric: tabular-nums;
}
.Slider-Input {
  width: 100%;
  height: 22px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
}
.Slider-Input::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: #e3d6c4;
}
.Slider-Input::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border-radius: 50%;
  background: #2d2a26;
  -webkit-appearance: none;
}
.Slider-Input::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: #e3d6c4;
}
.Slider-Input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 50%;
  background: #2d2a26;
}
.Slider-Input:focus-visible {
  outline: 2px solid #ecd2b8;
  outline-offset: 2px;
}

.Choice {
  display: grid;
  gap: 6px;
}
.Choice-Label {
  font-size: 13px;
  font-weight: 500;
}
.Choice-Row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.Choice-Option {
  min-height: 30px;
  padding: 5px calc(10px + 3px);
  border: none;
  border-radius: 10px;
  background: #efe7db;
  color: #6f675e;
  font-size: 13px;
  cursor: pointer;
}
.Choice-Option:hover {
  background: #e8dece;
}
.Choice-Option[data-selected] {
  background: #ecd2b8;
  color: #2d2a26;
}

.Playback {
  display: grid;
  gap: 12px;
  justify-items: start;
}
.Playback-Toggle, .Playback-Reset {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px calc(12px + 3px);
  border: none;
  border-radius: 12px;
  background: #efe7db;
  font-size: 13px;
  cursor: pointer;
}
.Playback-Toggle:hover, .Playback-Reset:hover {
  background: #e8dece;
}
.Playback-Toggle {
  background: #2d2a26;
  color: #fbf8f2;
}
.Playback-Toggle:hover {
  background: #45403a;
}

.Count {
  display: grid;
  gap: 10px;
  font-size: 13px;
}
.Count-Title {
  color: #6f675e;
  font-size: 12px;
  font-weight: 500;
}
.Count-Grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 14px;
}
.Count-Item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.Count-Label {
  color: #6f675e;
}
.Count-Value {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.Count-Ratio {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  color: #6f675e;
  font-variant-numeric: tabular-nums;
}

.Source {
  display: grid;
  gap: 6px;
}
.Source-Title {
  color: #6f675e;
  font-size: 12px;
  font-weight: 500;
}
.Source-Bar {
  display: flex;
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: #e3d6c4;
}
.Source-Part {
  height: 100%;
}
.Source-Part[data-source=glycolysis] {
  background: #e3a21a;
}
.Source-Part[data-source=cycle] {
  background: #dd8556;
}
.Source-Part[data-source=synthase] {
  background: #6aa39b;
}
.Source-Row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  color: #6f675e;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.Source-Key {
  position: relative;
  padding-left: 12px;
}
.Source-Key::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
}
.Source-Key[data-source=glycolysis]::before {
  background: #e3a21a;
}
.Source-Key[data-source=cycle]::before {
  background: #dd8556;
}
.Source-Key[data-source=synthase]::before {
  background: #6aa39b;
}

.Reading {
  grid-column: 2;
  grid-row: 1/span 2;
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: none;
  padding: 4px 20px 32px 4px;
}
@media (max-width: 760px) {
  .Reading {
    grid-column: 1;
    grid-row: auto;
    padding: 8px;
  }
}
.Reading-Heading {
  margin: 0 0 8px;
  color: #6f675e;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.Situation, .Place, .Legend, .Intro {
  padding: 16px calc(18px + 3px) calc(18px - 5px);
  border-radius: 18px;
  background: #fbf8f2;
}

.Situation-Text {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 24px;
}

.Place-Hint {
  margin: 0 0 8px;
  color: #6f675e;
  font-size: 13px;
  line-height: 22px;
}
.Place-Title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 500;
}
.Place-Text {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 24px;
}

.Legend-List {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}
.Legend-Item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.Legend-Item svg {
  flex: none;
}

.Intro-Text {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 24px;
}
.Intro-Guide {
  margin: 0 0 10px;
  color: #6f675e;
  font-size: 13px;
  line-height: 22px;
}
