/* App chrome: left rail navigation + mobile drawer (all pages) */
.shell {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  min-height: 100vh;
}
.rail {
  background: #fff; color: var(--ink);
  border-right: 1px solid var(--line);
  padding: 18px 12px 20px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; min-height: 0;
  box-sizing: border-box;
  font-family: var(--font-ui);
}
.rail .logo {
  margin: 0 8px 18px; flex-shrink: 0;
}
.rail nav {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden;
  padding-right: 2px; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent;
}
.rail nav::-webkit-scrollbar { width: 5px; }
.rail nav::-webkit-scrollbar-thumb {
  background: #cbd5e1; border-radius: 999px;
}
.rail nav a {
  display: block; padding: 7px 10px; border-radius: 6px;
  color: #3d4a5c; text-decoration: none; font-size: 0.9375rem; font-weight: 600;
  margin-bottom: 1px;
}
.rail nav a:hover { background: #f3f6fa; color: var(--ink); }
.rail nav a.is-on { background: #eef4ff; color: var(--accent); }
.rail .nav-group {
  margin: 16px 0 6px; padding: 0 10px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em;
  color: #8b97a8; text-transform: none;
}
.rail .nav-group:first-child { margin-top: 0; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.rail .nav-sub {
  margin: 0 0 4px; padding: 0; background: transparent;
}
.rail .nav-sub a {
  font-size: 0.9375rem; font-weight: 600; padding: 9px 10px;
}
.rail .nav-sub a .pack-name {
  display: block; line-height: 1.35; color: inherit; font-weight: 600;
}
.rail .nav-sub a .pack-hint {
  display: none; margin-top: 3px;
  font-size: 0.75rem; font-weight: 500; color: #8b97a8; line-height: 1.3;
}
.rail .nav-sub a.is-on .pack-hint { display: block; color: #6b8fd4; }
/* Findy-like: category = Noto + chevron; packs = Plex */
.rail .pack-cat { margin: 0 0 8px; border: none; background: transparent; }
.rail .pack-cat summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 4px;
  padding: 8px 10px; border-radius: 4px;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.9375rem; font-weight: 700; letter-spacing: 0.02em;
  color: #8b97a8; background: transparent;
}
.rail .pack-cat[open] summary { color: #6b7788; }
.rail .pack-cat summary:hover { color: #5a6575; background: transparent; }
.rail .pack-cat summary::-webkit-details-marker { display: none; }
.rail .pack-cat summary::before {
  content: "▸"; flex: 0 0 auto; width: 0.75em;
  color: #a8b2c1; font-size: 0.8125rem; line-height: 1;
}
.rail .pack-cat[open] summary::before { content: "▾"; }
.rail .pack-cat-label { flex: 1 1 auto; min-width: 0; }
.rail .pack-cat-body {
  padding: 2px 0 8px; margin: 0; border: none;
}
.rail .pack-cat-body a {
  margin: 0 0 2px; padding: 9px 10px 9px 26px;
  border-radius: 6px; background: transparent;
}
.rail .pack-cat-body a:hover { background: transparent; color: inherit; }
.rail .pack-cat-body a.is-on { background: #eef4ff; color: var(--accent); }
.rail .pack-cat-body a.is-on:hover { background: #eef4ff; color: var(--accent); }
.rail .pack-cat-body a .pack-name {
  font-family: var(--font-ui);
  font-size: 0.9375rem; font-weight: 600;
}
.rail .nav-muted { color: #8b97a8 !important; font-weight: 500 !important; }
.rail .nav-add {
  color: var(--accent) !important; font-size: 0.75rem !important; font-weight: 600 !important;
}
.rail .nav-close { display: none; }
.mobile-bar { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail {
    position: fixed; top: 0; left: 0; bottom: 0; height: auto;
    width: min(86vw, 300px); z-index: 60;
    transform: translateX(-102%); transition: transform 0.2s ease;
    visibility: hidden;
  }
  body.rail-open { overflow: hidden; }
  body.rail-open .rail {
    transform: none; visibility: visible;
    box-shadow: 0 0 0 100vmax rgba(15, 23, 42, 0.38);
  }
  .rail .nav-close {
    display: block; position: absolute; top: 14px; right: 12px;
    border: 1px solid var(--line); background: #fff; border-radius: 8px;
    font: inherit; font-size: 0.8125rem; font-weight: 700; color: var(--muted, #6b7788);
    padding: 4px 10px; cursor: pointer;
  }
  .mobile-bar {
    display: flex; align-items: center; gap: 12px;
    position: sticky; top: 0; z-index: 40;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 10px 16px;
  }
  .mobile-bar .logo { font-size: 1.125rem; }
  .mobile-bar .logo .logo-mark { width: 24px; height: 24px; }
  .menu-btn {
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid var(--line); background: #fff; border-radius: 8px;
    font: inherit; font-size: 0.8125rem; font-weight: 700; color: var(--ink);
    padding: 6px 10px; cursor: pointer;
  }
  .menu-btn svg { width: 16px; height: 16px; }
  /* メモ・ご意見 on phones: a button in the top bar (never floats over the text) */
  .memo-open-btn {
    position: relative; margin-left: auto; display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 12px;
    border: 1px solid #c9dbfb; background: #eef4ff; color: var(--accent-ink, #1d4ed8); border-radius: 8px;
    font: inherit; font-size: 0.8125rem; font-weight: 700; cursor: pointer;
  }
  .memo-open-btn.has-ask::after { content: ""; position: absolute; top: -4px; right: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent, #2f6fed); border: 2px solid #fff; }
}

/* menu: マイサイト / ツール / 見本 / 設定 */
.rail nav { display: flex; flex-direction: column; }
.rail nav a.nav-site { display: flex; gap: 8px; align-items: flex-start; padding: 9px 10px; }
.rail .nav-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px #dcfce7; margin-top: 6px; flex: none; }
.rail .nav-site-body { min-width: 0; display: flex; flex-direction: column; }
.rail .nav-site-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail .nav-site-sub { font-size: 0.75rem; font-weight: 600; color: #8b97a8; line-height: 1.35; }
.rail nav a.is-on .nav-site-sub { color: #6b8fd4; }
.rail nav a.nav-indent { padding-left: 26px; font-size: 0.8125rem; color: #5b6878; }
.rail nav a.nav-indent.is-on { color: var(--accent); }
.rail nav a.nav-cta { color: var(--accent); border: 1px dashed #bfd2f8; text-align: center; }
.rail .nav-note { margin: 4px 10px 0; font-size: 0.75rem; color: #8b97a8; line-height: 1.5; }
.rail .nav-bottom { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }

/* 使い方・ヘルプ / SiteKPI について */
.nav-bottom .nav-help { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--accent-ink, #1d4ed8); background: #eef4ff; border-radius: 8px; }
.nav-help-q { width: 20px; height: 20px; border-radius: 50%; background: var(--accent, #2f6fed); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 800; flex: none; }
.nav-bottom .nav-about { font-weight: 600; }

/* v5: 見本（例の数字） — the sample you are on, with the 例 mark */
.rail nav a.nav-sample { display: flex; gap: 8px; align-items: center; margin-top: 2px; padding-left: 14px; color: #5b4a12 !important; background: #fff8e6 !important; border: 1px solid #f1d58a; border-radius: 8px; font-weight: 700; }
.nav-ex { font-size: 0.75rem; font-weight: 800; color: #fff; background: #b7791f; border-radius: 5px; padding: 0 6px; line-height: 1.6; flex: none; }
.rail nav a.nav-cta { background: #eef4ff; border-style: solid; border-color: #c9dbfb; font-weight: 700; }

/* v5: 例 banner on sample boards and the samples list */
.ex-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #fff8e6; border: 1px solid #f1d58a; border-radius: 12px; padding: 10px 16px; font-size: 0.9375rem; color: #5b4a12; line-height: 1.55; }
.ex-mark { font-size: 0.8125rem; font-weight: 800; color: #fff; background: #b7791f; border-radius: 6px; padding: 1px 8px; flex: none; }
.ex-text { flex: 1 1 320px; min-width: 0; }
.ex-text b { font-weight: 800; }
.ex-links { display: flex; gap: 16px; margin-left: auto; }
.ex-links a { font-weight: 700; color: var(--accent-ink, #1d4ed8); text-decoration: none; }
.ex-links a.ex-go { font-weight: 800; }
.ex-links a:hover { text-decoration: underline; }

/* legal links at the bottom of the menu (moved from feedback.css) */
.nav-legal { margin: 8px 10px 0; font-size: 0.75rem; color: #8792a2; }
.nav-legal a { display: inline !important; padding: 0 !important; font-weight: 600 !important; color: #8792a2 !important; background: none !important; }
