body {
  height: 100vh;
  margin: 0;
  width: 100%;

  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 18px;
  display: flex;
  flex-direction: column;

  background: #fffaf0;

  overflow-y: auto;
  overflow-x: hidden;

  touch-action: pan-y;
}


.toc {
    font-weight: bold;
  overflow-y: auto;
  background: white;
  padding: 12px;

  flex: 0 0 40vh;
  min-width: 0;

  border-bottom: 1px solid #ddd;
}

.toc button {
  display: block;
  width: 100%;
  text-align: left;
  margin: 12px 0;
  padding: 12px;

  font-size: 16px;

  border: 1px solid #ddd;
  background: #fff;
  border-radius: 10px;

  box-shadow: 0 2px 0 #cfcfcf;
  transition: 0.15s;
}

.toc button:hover {
  background: #f7f7f7;
}

.toc button:active {
  transform: translateY(2px);
  box-shadow: 0 0 0 #cfcfcf;
}

.toc button.active {
  background: #fff59d;
  border-color: #f0d000;
  font-weight: bold;
}


.reader {
  flex: 1;
  overflow-y: auto;
  background: #fff8dc;
  padding: 14px;
  box-sizing: border-box;
  min-width: 0;
}

.page {
  display: none;
}

.line {
  padding: 8px;
  border-radius: 8px;

  line-height: 2.2;
  word-break: break-word;
}

.line.active {
  background: #fff59d;
  border-left: 4px solid #f59e0b;
  padding-left: 12px;
  font-weight: 500;
}


.controls {
  position: fixed;
  bottom: 0px;
  left: 0;
  width: 100%;
  box-sizing: border-box;

  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}


.controls label {
    font-size: 13px;
  display: flex;        
  align-items: center;
  gap: 8px;
  width: 85%;
  margin: 0 auto;       
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 8px 12px;
  font-size: 16px;

  border-radius: 10px;

  border: 1px solid #66b3ff;
  background: #e6f4ff;
  color: #007acc;

  box-shadow: 0 2px 0 #bbb;
  line-height: 1;
  white-space: nowrap;

  transition: 0.15s;
}

.btn:active {
  transform: translateY(2px);
  box-shadow: 0 0 0 #bbb;
}

.btn.play {
  background: #e6f4ff;
  border-color: #66b3ff;
  color: #007acc;
}

.btn.play.playing {
  background: #fff4e5;
  border-color: #f59e0b;
  color: #b45309;
}

.btn.ruby {
  position: fixed;
  top: 10px;
  right: 10px;

  padding: 4px 8px;
  font-size: 13px;

  border-radius: 8px;
}

.btn.ruby.on {
  background: #e6f4ff;
  border: 1px solid #66b3ff;
  color: #007acc;
}

.btn.ruby.off {
  background: #f2f2f2;
  border: 1px solid #ccc;
  color: #666;
}

ruby {
  ruby-position: over;
  line-height: 2.2;
}

rt {
  font-size: 0.5em;
  color: #465DAA;
}

.no-ruby rt {
  display: none;
}

input[type="range"]#speed {
  width: 120px;
  height: 5px;

  -webkit-appearance: none;
  appearance: none;

  border-radius: 5px;
  outline: none;

  background: #ddd;
}


input[type="range"]#speed::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 5px;
  background: transparent;
}

input[type="range"]#speed::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;

  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #007acc;
  cursor: pointer;

  margin-top: -5.5px; 
}
img {
  max-width: 100%;
  height: auto;
}

.line:empty,
.line.blank {
  height: 3em;
  padding: 0;
}
#toc-toggle {
  display: none;
}

body.in-reader #toc-toggle {
  display: block;
}
.fake-slider {
  width: 120px;
  height: 6px;
  border-radius: 10px;

  background: #ddd;
  position: relative;
}

.fake-slider.slow {
  --progress: 10%;
}

.fake-slider.medium {
  --progress: 50%;
}

.fake-slider.fast {
  --progress: 100%;
}
.inline-control{
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.controls-break{
  flex-basis: 100%;
  height: 0;
}

#toc-toggle{
  background: #e6f4ff;
  border: 1px solid #66b3ff;
  color: #007acc;
  box-shadow: 0 2px 0 #bbb;
  transition: 0.15s;
}

#toc-toggle:active{
  transform: translateY(2px);
  box-shadow: 0 0 0 #bbb;
}

#toc-toggle.on{
  background: #fff4e5;
  border-color: #f59e0b;
  color: #b45309;
}

#toc-toggle:hover{
  filter: brightness(1.05);
}
nav {
  line-height: 2;
  text-align: center;

}
.guide {
  text-align: center;
  font-weight: bold;
  margin: 20px 10;
  font-size: 20px;
    background: #fff59d;
    padding:12px;
}
.guide-btn {
  display: inline-block;
  padding:8px;
  font-size: 16px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 10px;
  transition: 0.1s;
}

.toc-group button:visited,
.toc-group button:active,
.toc-group button:focus{
  color: #007acc;
  outline: none;
}

.toc-group button{
  color: inherit;           
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.6;
}
#speed {
  flex: 1;     
  min-width: 0;
}
.fake-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 6px 10px;
  font-size: 16px;
  border-radius: 8px;

  border: 1px solid #66b3ff;
  background: #e6f4ff;
  color: #007acc;

  box-shadow: 0 2px 0 #bbb;

  user-select: none;
}
.fake-btn.playing {
  background: #fff4e5;
  border-color: #f59e0b;
  color: #b45309;
}
.fake-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;

  padding: 10px;
  border-radius: 12px;

  background: #f7f7f7;
  border: 1px solid #ddd;

  user-select: none;
}
.start-link {
color: #007aff;}
.start-btn {
  font-weight: bold;
}
html, body {
  height: 100%;
  overflow-x: hidden;
}

.page {
  padding-bottom: 140px; 
  box-sizing: border-box;
}