@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&display=swap');

/* ──────────────────────────────────
   CSS Custom Properties
────────────────────────────────── */
:root {
  --color-primary:   #2c3447;   /* 主要文字色・見出し用ネイビー */
  --color-accent:    #b99b6b;   /* アクセント：ウォームゴールド */
  --color-accent-dark: #8a7050;
  --color-bg:        #faf8f4;   /* サイト背景：明るい温白 */
  --color-white:     #ffffff;
  --color-text:      #2f2f2f;
  --color-text-mid:  #746f68;
  --color-text-light:#a09890;
  --color-border:    #e7dfd3;
  --color-card-bg:   #ffffff;
  --font-base: 'Noto Sans JP', sans-serif;
  --max-width: 1080px;
  --radius: 6px;
  --shadow-card: 0 2px 8px rgba(0,0,0,.08);
}

/* ──────────────────────────────────
   Reset & Base
────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  font-size: 15px;
}

a { color: inherit; text-decoration: none; }
a:hover { opacity: .82; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* ──────────────────────────────────
   Layout
────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

/* ──────────────────────────────────
   Header
────────────────────────────────── */
.site-header {
  background: #fffdf9;
  color: var(--color-text);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-logo {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  text-decoration: none;
}

.logo-img {
  height: 32px;
  width: auto;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.site-logo .logo-main {
  font-size: 22px;   /* hero-title 基準 (SP) */
  font-weight: 700;
  color: var(--color-accent-dark);
  letter-spacing: .05em;
  line-height: 1;
}

/* logo-sub: SP では非表示、PC で表示 */
.logo-sub {
  display: none;
  flex-direction: column;
  font-size: 13px;   /* section-count 基準 */
  color: var(--color-text-mid);
  letter-spacing: .02em;
  line-height: 1.5;
}

.header-search {
  flex: 1;
  max-width: 420px;
}

.header-search form {
  display: flex;
}

.header-search input[type="text"] {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  font-family: var(--font-base);
  font-size: 14px;
  outline: none;
  background: var(--color-white);
}

.header-search button {
  padding: 8px 14px;
  background: var(--color-accent);
  color: var(--color-white);
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
  font-size: 14px;
  font-family: var(--font-base);
  font-weight: 500;
  white-space: nowrap;
}

.header-search button:hover { background: var(--color-accent-dark); }

.header-nav {
  display: none;  /* SP では非表示、PC で展開 */
}

/* ──────────────────────────────────
   Footer
────────────────────────────────── */
.site-footer {
  background: #f3eee6;
  color: var(--color-text-mid);
  margin-top: 48px;
  padding: 32px 16px;
  font-size: 13px;
  border-top: 1px solid var(--color-border);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-about {
  line-height: 1.8;
  max-width: 640px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.footer-links a {
  color: var(--color-text-mid);
  font-size: 13px;
}

.footer-links a:hover { color: var(--color-accent-dark); }

.footer-copyright {
  color: var(--color-text-light);
  font-size: 12px;
  border-top: 1px solid var(--color-border);
  padding-top: 16px;
  margin-top: 8px;
}

/* ──────────────────────────────────
   Main content area
────────────────────────────────── */
.main-content {
  padding: 24px 0 48px;
}

/* 2カラムシェル（デフォルトは1カラム・SP向け） */
.content-shell {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.right-menu {
  width: 100%;
}

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

/* ──────────────────────────────────
   Hero (トップページ)
────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #f5efe6 0%, #ede4d8 100%);
  color: var(--color-text);
  padding: 40px 16px 48px;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}

.hero-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.hero-subtitle {
  font-size: 14px;
  color: var(--color-text-mid);
  margin-bottom: 24px;
}

.hero-search {
  display: flex;
  max-width: 520px;
  margin: 0 auto;
  gap: 0;
}

.hero-search input[type="text"] {
  flex: 1;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  font-family: var(--font-base);
  font-size: 15px;
  outline: none;
  background: var(--color-white);
}

.hero-search button {
  padding: 14px 20px;
  background: var(--color-accent);
  color: var(--color-white);
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-base);
}

.hero-search button:hover { background: var(--color-accent-dark); }

/* ──────────────────────────────────
   Section headings
────────────────────────────────── */
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-primary);
  border-left: 4px solid var(--color-accent);
  padding-left: 10px;
  margin-bottom: 16px;
}

.section-title .section-count {
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text-mid);
  margin-left: 8px;
}

/* ──────────────────────────────────
   Genre cards（ジャンルから探す）
────────────────────────────────── */
.genre-section {
  padding: 24px 0;
  border-bottom: 1px solid var(--color-border);
}

.genre-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.genre-card {
  display: block;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow .2s, transform .2s;
}

.genre-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  transform: translateY(-2px);
  opacity: 1;
}

.genre-card-img {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
}

.genre-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}

.genre-card:hover .genre-card-img img {
  transform: scale(1.04);
}

.genre-card-body {
  padding: 8px 10px 10px;
}

.genre-card-name {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.4;
}

.genre-card-count {
  display: block;
  font-size: 11px;
  color: var(--color-text-light);
  margin-top: 2px;
}

/* ──────────────────────────────────
   Category list (top page)
────────────────────────────────── */
.category-section {
  padding: 24px 0;
  border-bottom: 1px solid var(--color-border);
}

.category-section:last-of-type { border-bottom: none; }

.category-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--color-text);
  transition: border-color .2s, background .2s;
}

.category-link:hover {
  border-color: var(--color-accent);
  background: #fdf9f0;
  color: var(--color-accent-dark);
}

.category-link .cat-count {
  font-size: 11px;
  color: var(--color-text-light);
}

/* ──────────────────────────────────
   Store cards (一覧)
────────────────────────────────── */
.store-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 16px;
}

.store-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  gap: 0;
}

.store-card-thumb {
  width: 100px;
  height: 90px;
  flex-shrink: 0;
  background: #e8e6df;
  overflow: hidden;
}

.store-card-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center center;
}

.store-card-thumb .no-thumb {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--color-text-light);
}

.store-card-body {
  padding: 10px 12px;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
}

.subscription-badge {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 0 0 0 6px;
  background: var(--color-accent-dark);
  color: #fff;
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.6;
}

.store-card-subname {
  font-size: 11px;
  color: var(--color-text-mid);
  margin-bottom: 1px;
  word-break: break-all;
  overflow-wrap: break-word;
}

.store-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 4px;
  word-break: break-all;
  overflow-wrap: break-word;
  line-height: 1.4;
}

.store-card-tel {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-mid);
  margin-bottom: 3px;
}

.store-card-location {
  font-size: 12px;
  color: var(--color-text-mid);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  line-height: 1.4;
}

.area-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1;
}

/* ──────────────────────────────────
   Store detail
────────────────────────────────── */
.store-detail {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px 16px;
  box-shadow: var(--shadow-card);
}

.store-detail-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 4px;
}

.store-detail-kana {
  font-size: 13px;
  color: var(--color-text-light);
  margin-bottom: 16px;
}

.store-info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-bottom: 20px;
}

.store-info-table th,
.store-info-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

.store-info-table th {
  width: 7em;
  color: var(--color-text-mid);
  font-weight: 500;
  white-space: nowrap;
  background: #f8f7f3;
}

.store-map-cell {
  padding: 8px 0;
}

.store-map-frame {
  width: 100%;
  height: 220px;
  border: 0;
  border-radius: 4px;
  display: block;
}

@media (min-width: 641px) {
  .store-map-frame {
    height: 260px;
  }
}

/* ──────────────────────────────────
   Store gallery (slideshow)
────────────────────────────────── */
.store-gallery {
  margin-bottom: 20px;
}

.store-gallery-viewport {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  aspect-ratio: 4 / 3;
  background: var(--color-border);
}

.store-gallery-track {
  display: flex;
  height: 100%;
  transition: transform 0.35s ease;
  will-change: transform;
}

.store-gallery-slide {
  flex: 0 0 100%;
  min-width: 0;
  height: 100%;
}

.store-gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.store-gallery-prev,
.store-gallery-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.30);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 1;
  transition: background 0.2s;
}

.store-gallery-prev { left: 8px; }
.store-gallery-next { right: 8px; }

.store-gallery-prev:hover,
.store-gallery-next:hover {
  background: rgba(0, 0, 0, 0.55);
}

.store-gallery-thumbs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px 0 2px;
}

.store-gallery-thumbs img {
  width: 72px;
  height: 54px;
  object-fit: cover;
  object-position: center center;
  border-radius: 4px;
  border: 2px solid transparent;
  flex-shrink: 0;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.2s, border-color 0.2s;
}

.store-gallery-thumbs img.active {
  border-color: var(--color-accent);
  opacity: 1;
}

/* ──────────────────────────────────
   Search form
────────────────────────────────── */
.search-form-area {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}

.search-form-area input[type="text"],
.search-form-area select {
  font-family: var(--font-base);
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  width: 100%;
  margin-bottom: 8px;
  outline: none;
}

.search-form-area input[type="text"]:focus,
.search-form-area select:focus {
  border-color: var(--color-accent);
}

/* ──────────────────────────────────
   右メニュー用 詳細検索フォーム
────────────────────────────────── */
.right-menu-search {
  margin-bottom: 16px;
}

.search-details summary.search-summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 0;
  color: var(--color-primary);
  list-style: none;
}

.search-details summary.search-summary::before {
  content: '▶ ';
  font-size: 10px;
}

.search-details[open] summary.search-summary::before {
  content: '▼ ';
}

.search-form {
  margin-top: 8px;
}

.search-fieldset {
  border: none;
  padding: 0;
  margin: 0 0 10px;
}

.search-legend {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-mid);
  margin-bottom: 4px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--color-border);
  width: 100%;
  display: block;
}

.search-radio-group,
.search-check-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.search-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--color-text);
  cursor: pointer;
  line-height: 1.4;
}

.search-label input {
  flex-shrink: 0;
}

.search-submit {
  display: block;
  width: 100%;
  padding: 7px;
  background: var(--color-accent);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-base);
  margin-top: 8px;
}

.search-submit:hover { background: var(--color-accent-dark); }

.search-reset {
  display: block;
  text-align: center;
  font-size: 11px;
  color: var(--color-text-mid);
  margin-top: 6px;
  text-decoration: underline;
}

.btn-search {
  display: inline-block;
  padding: 10px 24px;
  background: var(--color-accent);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-base);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.btn-search:hover { background: var(--color-accent-dark); }

/* ──────────────────────────────────
   Pagination
────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  margin: 24px 0;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 13px;
  background: var(--color-white);
  color: var(--color-text);
  transition: background .15s, border-color .15s;
}

.pagination a:hover {
  background: var(--color-bg);
  border-color: var(--color-accent);
  color: var(--color-accent-dark);
  opacity: 1;
}

.pg-active {
  background: var(--color-accent-dark) !important;
  color: var(--color-white) !important;
  border-color: var(--color-accent-dark) !important;
  font-weight: 700;
  cursor: default;
}

.pg-disabled {
  color: var(--color-text-light) !important;
  background: var(--color-bg) !important;
  border-color: var(--color-border) !important;
  cursor: not-allowed;
  pointer-events: none;
}

.pg-dots {
  border: none !important;
  background: transparent !important;
  color: var(--color-text-light);
  min-width: 20px;
  padding: 0 4px;
}

/* ──────────────────────────────────
   Ad block (ダミー広告枠)
────────────────────────────────── */
.ad-block {
  width: 100%;
  background: #f5f5f0;
  border: 2px dashed #cccccc;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaaaaa;
  font-size: 13px;
  margin: 20px 0;
}

.ad-block.ad-banner   { height: 60px; }
.ad-block.ad-rect     { height: 250px; max-width: 300px; }
.ad-block.ad-leaderboard { height: 90px; }

/* ──────────────────────────────────
   Recently viewed (最近見たお店)
────────────────────────────────── */
.recently-viewed {
  margin: 24px 0;
}

.recently-viewed-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.recently-viewed-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 90px;
  max-width: 90px;
  text-align: center;
}

.recently-viewed-item img,
.recently-viewed-item .rv-no-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  background: #e8e6df;
}

.recently-viewed-item .rv-no-img {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--color-text-light);
}

.recently-viewed-name {
  font-size: 11px;
  color: var(--color-text);
  line-height: 1.3;
  word-break: break-all;
}

/* ──────────────────────────────────
   Breadcrumb / back links
────────────────────────────────── */
.breadcrumb {
  font-size: 13px;
  color: var(--color-text-light);
  margin-bottom: 16px;
}

.breadcrumb a { color: var(--color-accent-dark); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 6px; }

.page-back {
  font-size: 13px;
  color: var(--color-text-mid);
  margin-top: 20px;
}

.page-back a {
  color: var(--color-accent-dark);
  text-decoration: underline;
}

/* ──────────────────────────────────
   Utility
────────────────────────────────── */
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.text-muted { color: var(--color-text-light); font-size: 13px; }
.store-info-note { color: var(--color-text-light); font-size: 12px; }

/* ──────────────────────────────────
   PC breakpoint (640px +)
────────────────────────────────── */
@media (min-width: 641px) {
  body { font-size: 15px; }

  /* PC: 2カラム */
  .content-shell {
    flex-direction: row;
    align-items: flex-start;
  }

  .right-menu {
    width: 200px;
    flex-shrink: 0;
  }

  /* 右メニュー内の最近見たお店：縦並び */
  .right-menu .recently-viewed-list {
    flex-direction: column;
    overflow-x: visible;
    gap: 8px;
    padding-bottom: 0;
  }

  .right-menu .recently-viewed-item {
    flex-direction: row;
    align-items: center;
    min-width: unset;
    max-width: unset;
    text-align: left;
    gap: 8px;
  }

  .right-menu .recently-viewed-item img,
  .right-menu .recently-viewed-item .rv-no-img {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
  }

  .right-menu .recently-viewed-name {
    font-size: 12px;
    word-break: break-all;
  }

  /* PC: logo-img 拡大・logo-text 横並び・logo-sub 表示・logo-main サイズアップ */
  .logo-img {
    height: 40px;
  }

  .logo-text {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .site-logo .logo-main {
    font-size: 28px;   /* hero-title 基準 (PC) */
  }

  .logo-sub {
    display: flex;
    flex-direction: column;
  }

  .header-nav {
    display: flex;
    gap: 20px;
    margin-left: auto;
  }

  .header-nav a {
    font-size: 13px;
    color: var(--color-text-mid);
  }

  .header-nav a:hover { color: var(--color-accent-dark); }

  .hero { padding: 60px 16px 72px; }
  .hero-title { font-size: 28px; color: var(--color-primary); }
  .hero-subtitle { font-size: 15px; }

  .genre-card-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .store-list {
    grid-template-columns: 1fr 1fr;
  }

  .store-card-thumb {
    width: 120px;
    height: 110px;
  }

  .store-gallery-viewport {
    aspect-ratio: 16 / 9;
  }

  .footer-inner {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
  }
}

@media (min-width: 769px) {
  .store-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ──────────────────────────────────
   SP共通（max-width: 640px）
────────────────────────────────── */
@media (max-width: 640px) {
  /* SP: right-menu 内の最近見たお店は非表示（モバイル用コンテナを使用） */
  #recently-viewed-right-menu {
    display: none !important;
  }
}

/* ──────────────────────────────────
   縦スマホ相当（max-width: 480px）: ヘッダー2段 + 横はみ出し防止
   ※ orientation:portrait に依存しない幅ベースで指定
────────────────────────────────── */
@media (max-width: 480px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    align-items: center;
  }

  .site-logo {
    flex: 0 0 auto;
  }

  /* 縦スマホ: logo-text を横並び（logo-main の右に logo-sub）*/
  .logo-text {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    min-width: 0;
  }

  .site-logo .logo-main {
    flex-shrink: 0;
  }

  /* 縦スマホ: logo-sub を表示（2行維持） */
  .logo-sub {
    display: flex;
    flex-direction: column;
    font-size: 11px;
    line-height: 1.35;
  }

  .header-search {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    order: 2;
  }

  .header-search form {
    display: flex;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .header-search input[type="text"] {
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
  }
}

/* ──────────────────────────────────
   PC: モバイル用最近見たお店コンテナを非表示
────────────────────────────────── */
@media (min-width: 641px) {
  .recently-viewed-mobile-wrap {
    display: none !important;
  }
}

/* ──────────────────────────────────
   Right menu nav links
────────────────────────────────── */
.right-menu-nav {
  margin-bottom: 12px;
}

.right-menu-item {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
}

.right-menu-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.right-menu-item--text {
  padding-top: 2px;
}

.right-menu-img-link {
  display: block;
  margin-bottom: 4px;
}

.right-menu-img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  display: block;
}

.right-menu-text-link {
  font-size: 12px;
  color: var(--color-text-mid);
  text-decoration: none;
  display: block;
  line-height: 1.5;
}

.right-menu-text-link:hover {
  color: var(--color-accent-dark);
  text-decoration: underline;
}

.right-menu-ext {
  font-size: 10px;
  color: var(--color-text-light);
}

/* ──────────────────────────────────
   Static pages
────────────────────────────────── */
.static-body {
  margin-bottom: 24px;
}

.static-lead {
  font-size: 15px;
  color: var(--color-text-mid);
  line-height: 1.8;
  margin-bottom: 20px;
  padding: 12px 14px;
  background: var(--color-bg);
  border-radius: var(--radius);
  border-left: 3px solid var(--color-accent);
}

.static-section {
  margin-top: 24px;
}

.static-h2 {
  font-size: 17px;
  font-weight: 600;
  color: var(--color-primary);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 6px;
  margin-bottom: 12px;
}

.static-figure {
  margin: 16px 0;
  text-align: center;
}

.static-figure img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.static-figure figcaption {
  font-size: 12px;
  color: var(--color-text-light);
  margin-top: 6px;
  line-height: 1.5;
}

.static-figure--left {
  float: left;
  margin: 4px 18px 12px 0;
  text-align: center;
  max-width: 260px;
}

.static-figure--right {
  float: right;
  margin: 4px 0 12px 18px;
  text-align: center;
  max-width: 260px;
}

.static-figure--wide {
  float: none;
  clear: both;
  margin: 16px 0;
  text-align: center;
  max-width: 100%;
}

.static-figure--wide img {
  max-width: 100%;
}

.static-dd-clearfix::after {
  content: '';
  display: table;
  clear: both;
}

@media (max-width: 600px) {
  .static-figure--left,
  .static-figure--right {
    float: none;
    max-width: 100%;
    margin: 12px 0;
  }
}

.static-img-full {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

.static-caption {
  font-size: 12px;
  color: var(--color-text-light);
  margin-top: 6px;
}

.static-info-table {
  margin-bottom: 0;
}

.static-list {
  list-style: disc;
  padding-left: 1.4em;
  line-height: 2;
  color: var(--color-text);
}

.static-btn {
  display: inline-block;
  padding: 8px 16px;
  background: var(--color-accent);
  color: #fff;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.static-btn:hover {
  background: var(--color-accent-dark);
}

.static-quote {
  border-left: 3px solid var(--color-border);
  margin: 12px 0;
  padding: 8px 14px;
  color: var(--color-text-mid);
  font-size: 14px;
  line-height: 1.8;
}

.static-quote cite {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-style: normal;
  color: var(--color-text-light);
}

.static-toc {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 24px;
}

.static-toc-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--color-primary);
}

.static-toc-list {
  margin: 0;
  padding-left: 1.4em;
  line-height: 2;
}

.static-toc-list a {
  font-size: 13px;
  color: var(--color-text-mid);
  text-decoration: none;
}

.static-toc-list a:hover {
  color: var(--color-accent-dark);
  text-decoration: underline;
}

/* History / Guidebook dl */
.history-list {
  margin: 0;
}

.history-dt {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-bg);
  border-left: 3px solid var(--color-accent);
  padding: 10px 14px;
  margin: 24px 0 10px;
  border-radius: 0 var(--radius) var(--radius) 0;
  line-height: 1.5;
}

.history-dt-sub {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-mid);
  margin-top: 4px;
}

.history-dt-author {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text-mid);
  margin-top: 2px;
}

.history-dd {
  margin: 0 0 8px;
  padding: 0 4px;
  line-height: 1.85;
  color: var(--color-text);
}

.history-dd p {
  margin-bottom: 10px;
}

.history-h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary);
  margin: 14px 0 6px;
  padding-bottom: 3px;
  border-bottom: 1px dashed var(--color-border);
}

.history-backlink {
  text-align: right;
  font-size: 12px;
  margin-top: 12px;
}

.history-backlink a {
  color: var(--color-text-light);
  text-decoration: none;
}

.history-backlink a:hover {
  color: var(--color-accent-dark);
}

/* ──────────────────────────────────
   Right menu: 2段タイトル表示
────────────────────────────────── */
.right-menu-title-two-line {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.right-menu-title-main {
  font-size: 12px;
  color: var(--color-text-mid);
  font-weight: 500;
}

.right-menu-title-sub {
  font-size: 11px;
  color: var(--color-text-light);
}

/* ──────────────────────────────────
   content-main: details/summary 目次
────────────────────────────────── */
details.static-toc {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0;
  margin-bottom: 24px;
  overflow: hidden;
}

details.static-toc summary {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary);
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

details.static-toc summary::-webkit-details-marker { display: none; }

details.static-toc summary::before {
  content: '▶';
  font-size: 10px;
  color: var(--color-accent);
  transition: transform 0.2s;
  flex-shrink: 0;
}

details.static-toc[open] summary::before {
  transform: rotate(90deg);
}

details.static-toc .static-toc-list {
  padding: 4px 14px 12px 28px;
  margin: 0;
}

/* ──────────────────────────────────
   right-menu: details/summary 目次
────────────────────────────────── */
details.right-menu-toc {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}

details.right-menu-toc summary {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-mid);
  padding: 7px 10px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 5px;
  user-select: none;
}

details.right-menu-toc summary::-webkit-details-marker { display: none; }

details.right-menu-toc summary::before {
  content: '▶';
  font-size: 9px;
  color: var(--color-accent);
  transition: transform 0.2s;
  flex-shrink: 0;
}

details.right-menu-toc[open] summary::before {
  transform: rotate(90deg);
}

.right-menu-toc-list {
  list-style: decimal;
  padding: 2px 10px 8px 28px;
  margin: 0;
}

.right-menu-toc-list li {
  line-height: 1.9;
}

.right-menu-toc-list a {
  font-size: 11px;
  color: var(--color-text-mid);
  text-decoration: none;
}

.right-menu-toc-list a:hover {
  color: var(--color-accent-dark);
  text-decoration: underline;
}

/* ──────────────────────────────────
   right-menu-item--text 内の details 目次の余白
────────────────────────────────── */
.right-menu-item--text details.right-menu-toc {
  margin-top: 6px;
}

/* ──────────────────────────────────
   Archive pages
────────────────────────────────── */
.archive-note {
  background: #fff8e1;
  border-left: 3px solid #f9a825;
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--color-text-mid);
}

.archive-content {
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--color-text);
}

.archive-content img {
  max-width: 100%;
  height: auto;
}

.archive-content table {
  border-collapse: collapse;
  max-width: 100%;
}

.archive-content td,
.archive-content th {
  padding: 4px 8px;
  border: 1px solid var(--color-border);
}

.archive-pdf-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.archive-pdf-list li a {
  display: block;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-accent);
  font-size: 14px;
  text-decoration: none;
}

.archive-pdf-list li a:hover {
  background: var(--color-bg);
  color: var(--color-accent-dark);
}

.archive-nav {
  margin-top: 24px;
  font-size: 14px;
  color: var(--color-text-mid);
}

.archive-nav a {
  color: var(--color-accent);
}

/* ──────────────────────────────────
   Archive page content wrapper
────────────────────────────────── */
.archive-page {
  margin-top: 16px;
  padding: 16px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.8;
  color: var(--color-text);
}

.archive-page img {
  max-width: 100%;
  height: auto;
}

.archive-page table {
  border-collapse: collapse;
  max-width: 100%;
}

.archive-page td,
.archive-page th {
  padding: 3px 6px;
  border: 1px solid var(--color-border);
  vertical-align: top;
}

.archive-page a {
  color: var(--color-accent);
}

.archive-page center {
  text-align: center;
}

/* ──────────────────────────────────
   Archive HCM subpage list
────────────────────────────────── */
.archive-hcm-subpages {
  margin-top: 10px;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
}

.archive-hcm-subpages-label {
  font-size: 13px;
  color: var(--color-text-mid);
  margin-bottom: 6px;
}

.archive-hcm-subpages-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 4px 16px;
}

.archive-hcm-subpages-list li {
  font-size: 13px;
  line-height: 1.6;
}

.archive-hcm-subpages-list a {
  color: var(--color-accent);
}

.archive-hcm-filename {
  font-size: 11px;
  color: var(--color-text-light);
  margin-left: 4px;
}

/* archive-note 内の元ファイル表示 */
.archive-source-file {
  font-size: 12px;
  color: var(--color-text-mid);
  margin-top: 4px;
}

.archive-source-file code {
  background: #eee;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
}
