:root {
  --bg: #fbf6ee;
  --card: #ffffff;
  --border: #e8ddc8;
  --text: #3a2f22;
  --text-muted: #7a6e5c;
  --accent: #c0392b;
  --accent-strong: #a93226;
  --sidebar-bg: #fff8ea;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
}

/* 訪問者カウンター（nav.jsがbody先頭に挿入する。あえてページのテーマ配色と
   独立させた、昔ながらのLED表示風の見た目に固定している） */
.counter-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .5em;
  background: #000;
  color: #cbd5e1;
  font-size: .82rem;
  padding: .55em 1em;
}
.counter-digits {
  display: inline-flex;
  gap: 2px;
}
.counter-digit {
  background: #111;
  color: #39ff6a;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  padding: .25em .35em;
  border-radius: 3px;
  border: 1px solid #222;
  box-shadow: inset 0 0 4px rgba(57, 255, 106, .45);
  min-width: 1ch;
  text-align: center;
}

.page-layout {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
}

/* サイドバー（nav.jsがこの中にメニューを描画する） */
.site-sidebar-mount {
  flex: 0 0 220px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
}
.site-sidebar-title {
  font-size: .74rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 1rem 1.2rem .4rem;
  letter-spacing: .05em;
  border-top: 1px solid var(--border);
  margin-top: .3rem;
}
.site-sidebar-title:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 1.2rem;
}
.site-sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0 .7rem 1.5rem;
}
.site-sidebar li + li { margin-top: .2rem; }
.site-sidebar a {
  display: block;
  padding: .6em .7em;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: .88rem;
}
.site-sidebar a:hover { background: rgba(0,0,0,.05); }
.site-sidebar a.active {
  background: var(--card);
  color: var(--accent-strong);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.page-content { flex: 1 1 auto; min-width: 0; }

header {
  text-align: center;
  padding: 2.5rem 1.5rem 2rem;
}
header .icon { font-size: 2.5rem; }
header h1 {
  margin: .3em 0 .2em;
  font-size: clamp(1.5rem, 4.5vw, 2.1rem);
}
header p {
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 auto;
  font-size: .95rem;
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

section { margin-bottom: 2.5rem; }
section > h2 {
  display: flex;
  align-items: center;
  gap: .5em;
  font-size: 1.3rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: .5em;
  margin-bottom: 1.2em;
  color: var(--accent);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.3rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(58,47,34,.05);
}
.card h3 { margin: 0 0 .5em; font-size: 1.02rem; }
.card p { margin: 0; font-size: .95rem; }
.card p + p { margin-top: .6em; }

.tip {
  background: #fff8e6;
  border: 1px solid #f0dca0;
  border-radius: 10px;
  padding: .8em 1em;
  font-size: .88rem;
  margin-top: .8em;
}
.caution {
  background: #fdecea;
  border: 1px solid #f3c2bd;
  border-radius: 10px;
  padding: .8em 1em;
  font-size: .88rem;
  margin-top: .8em;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: 10px;
  overflow: hidden;
  font-size: .9rem;
}
th, td {
  padding: .7em .8em;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
th { background: #f3ead7; }

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.compare-grid .card h3 {
  display: flex;
  align-items: center;
  gap: .4em;
}

.note {
  font-size: .85rem;
  color: var(--text-muted);
  margin-top: -.5em;
}

.ratio-badge {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  font-weight: 700;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
  background: #fff3d6;
  border: 1px solid #e8a013;
  color: #7a5230;
  padding: .3em .8em;
  border-radius: 999px;
  margin: .4em 0;
}

footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .82rem;
}
footer h2 { font-size: 1rem; color: var(--text); }
footer ol { padding-left: 1.2em; }
footer a { color: var(--accent); }

/* モバイル用ハンバーガーボタン・背景オーバーレイ（nav.jsが挿入する）
   デスクトップでは常に非表示。 */
.mobile-menu-toggle {
  display: none;
}
.mobile-menu-backdrop {
  display: none;
}

@media (max-width: 720px) {
  .page-layout { display: block; }

  .mobile-menu-toggle {
    display: block;
    position: sticky;
    top: 0;
    z-index: 30;
    width: 100%;
    text-align: left;
    padding: .8em 1.2rem;
    background: var(--sidebar-bg);
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
  }

  .mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    z-index: 39;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }
  .mobile-menu-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
  }

  /* サイドバーはオフキャンバス化：普段は画面外、開いた時だけスライドイン */
  .site-sidebar-mount {
    flex: none;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: min(80vw, 300px);
    max-width: 300px;
    border-right: 1px solid var(--border);
    z-index: 40;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: 2px 0 12px rgba(0,0,0,.15);
  }
  .site-sidebar-mount.open {
    transform: translateX(0);
  }

  .compare-grid { grid-template-columns: 1fr; }
}
