:root{
  --footer-pad-y: 8px;
  --footer-pad-x: 12px;
  --footer-safe: env(safe-area-inset-bottom, 0px);
  --footer-reserve: 3.2rem; /* 本文の下に確保する高さ（だいたいでOK） */
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans JP', sans-serif;
  line-height: 1.6;
  background: #121212;
  color: #e0e0e0;
  padding-bottom: calc(var(--footer-reserve) + var(--footer-safe));
}

h1 {
  text-align: center;
  margin: 40px 0 20px;
  font-size: 2.5rem;
  color: #e0e0e0;
}

h2 {
  text-align: left;
  margin: 32px 0 2px;
  font-size: 1.6rem;
  font-weight: 600;
  color: #e0e0e0;
  padding-bottom: 1px;
}

.content {
  max-width: 800px;
  margin: 0 auto;
}

.watermark {
  position: fixed;
  bottom: 8px;
  right: 12px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
  user-select: none;
}

a { color: #d2691e; }
a:hover { color: #ffa500; }

sup {
  font-size: 0.75em;
  line-height: 1;
  vertical-align: super;
}

footer{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;

  pointer-events: none;

  display: flex;
  justify-content: flex-end;
  align-items: center;

  padding: var(--footer-pad-y) var(--footer-pad-x);
  padding-bottom: calc(var(--footer-pad-y) + var(--footer-safe));

  background: rgba(18,18,18,0.75);

  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
}

.footer-center {
  text-align: center;
  pointer-events: auto;
}

.footer-right{
  position: static;
  right: auto;
  bottom: auto;

  pointer-events: auto;
  text-align: right;
  max-width: 100%;
  white-space: normal;
}

#footnotes {
  font-size: 0.85rem;
  color: #ccc;
}
#footnotes hr {
  border: none;
  border-top: 4px solid rgba(255, 255, 255, 0.5);
  margin: 2rem 0 1rem;
}
#footnotes ol {
  margin: 0;
  padding-left: 1.5rem;
}
#footnotes li {
  margin: 0.5rem 0;
}

/* ===== mobile tweaks ===== */
@media (max-width: 600px) {
  body { margin: 12px; }                 /* 左右の余白を詰める */
  .content { max-width: 100%; }          /* 幅制限を解除 */
  p, li { font-size: 1.08em; line-height: 1.75; } /* 文字を大きく、行間も増やす */
  h1 { font-size: 1.6em; }
  h2 { font-size: 1.25em; }
}