* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  background: #f6efe3;
  color: #3a2e22;
  min-height: 100vh;
}

.store-header {
  position: relative;
  background: linear-gradient(#4a3423, #3a2818);
  color: #f6efe3;
  text-align: center;
  padding: 28px 16px 22px;
  border-bottom: 6px solid #2a1c10;
  overflow: hidden;
}

/* 背景の本棚イラスト。中央(タイトル・検索)は薄れ、左右のさみしい余白に本棚が見えるようマスクする */
.header-bg {
  position: absolute;
  inset: 0;
  opacity: 0.28;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, #000 0%, transparent 36%, transparent 64%, #000 100%);
  mask-image: linear-gradient(to right, #000 0%, transparent 36%, transparent 64%, #000 100%);
}
.header-bg svg { display: block; width: 100%; height: 100%; }

/* 装飾より前面にヘッダーの中身を出す */
.store-header > :not(.header-bg) { position: relative; z-index: 1; }

/* ヘッダー最上部の操作バー: テーマ切替を左端、私の棚・ご意見箱を右端に */
.header-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.header-actions {
  display: flex;
  gap: 8px;
}

.layout-switch {
  display: flex;
  align-items: center;
  gap: 8px;
}

.layout-select-label { font-size: 11px; color: #d9c9a8; }

.layout-switch select {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: #f6efe3;
  cursor: pointer;
}

.layout-switch select:hover { background: rgba(255, 255, 255, 0.18); }

.layout-switch select option { color: #3a2e22; background: #fffdf8; }

.store-logo { font-size: 36px; letter-spacing: 2px; }

.store-tagline {
  font-size: 17px;
  color: #d9c9a8;
  margin-top: 8px;
}

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

.search-form input {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  background: #fffdf8;
}

.search-form button {
  padding: 10px 22px;
  border: none;
  border-radius: 8px;
  background: #c97b3d;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}

.search-form button:hover { background: #b56a2f; }

.genre-select-row {
  margin: 14px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

.genre-select-row label { font-size: 13px; color: #d9c9a8; white-space: nowrap; flex-shrink: 0; }

.genre-select-row select {
  padding: 8px 12px;
  border: 1px solid rgba(201, 123, 61, 0.7);
  border-radius: 8px;
  background: #fffdf8;
  color: #3a2e22;
  font-size: 14px;
  min-width: 0;
  width: 220px;
  max-width: 100%;
  cursor: pointer;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 13px;
}

.breadcrumb button {
  background: none;
  border: none;
  color: #a05a2c;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  padding: 2px 2px;
}

.crumb-sep { color: #a08b6e; }

.crumb-current { font-weight: 600; color: #3a2e22; }

.subgenre-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  margin: 10px auto 0;
}

.subgenre-lead { font-size: 13px; color: #6b5842; }

.chip-sub { font-size: 13px; padding: 6px 14px; }

.subgenre-select {
  padding: 7px 12px;
  border: 1px solid #c9b189;
  border-radius: 8px;
  background: #fffdf8;
  color: #3a2e22;
  font-size: 14px;
  min-width: 200px;
  cursor: pointer;
}

.genre-view {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px 0;
}

.history {
  max-width: 720px;
  margin: 12px auto 0;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.history button {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #e8dcc2;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history button:hover { background: rgba(255, 255, 255, 0.22); }

main { max-width: 980px; margin: 0 auto; padding: 24px 16px 64px; }

.pop-label {
  display: inline-block;
  background: #fffdf8;
  border: 2px solid #c97b3d;
  color: #8a4f1d;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 7px 18px;
  border-radius: 4px 14px 4px 14px;
  margin-bottom: 14px;
  transform: rotate(-1deg);
  box-shadow: 3px 3px 0 rgba(58, 46, 34, 0.22);
}

.pop-author { border-color: #2e7d5b; color: #1d5c40; }
.pop-similar { border-color: #5b5bd6; color: #3c3c9e; }
.pop-recommend { border-color: #c2447a; color: #94285a; }

.center-display { margin-bottom: 36px; }

.center-card {
  display: flex;
  gap: 24px;
  background: #fffdf8;
  border: 1px solid #e0d3bc;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(58, 46, 34, 0.1);
}

.center-cover img {
  width: 150px;
  border-radius: 4px;
  box-shadow: 4px 6px 14px rgba(0, 0, 0, 0.3);
}

.center-cover .no-cover {
  width: 150px;
  height: 214px;
  font-size: 15px;
  padding: 14px;
}

.center-info { flex: 1; min-width: 0; }

.center-info h2 { font-size: 22px; margin-bottom: 6px; }

.center-author { color: #8a7358; font-size: 14px; margin-bottom: 4px; }

.center-meta { color: #a08b6e; font-size: 12.5px; margin-bottom: 12px; }

.center-desc {
  font-size: 14px;
  line-height: 1.8;
  color: #5a4a38;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 16px;
}

.buy-links { display: flex; gap: 10px; flex-wrap: wrap; }

.buy-links a {
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  border: 1px solid #c97b3d;
  color: #8a4f1d;
  background: #fdf6ec;
}

.buy-links a:hover { background: #f7e8d4; }

.shelf-section { margin-bottom: 40px; }

/* 棚の下に出す自前のスクロールバー(iOS Safariはネイティブのスクロールバーを常時表示しないため、
   JSでスクロール位置を反映するバーを別途描画する。initShelfScrollIndicators() 参照) */
.scroll-track {
  position: relative;
  height: 7px;
  margin: 8px 6px 0;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 999px;
  overflow: hidden;
}

.scroll-thumb {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  min-width: 24px;
  background: #d9c9a8;
  border-radius: 999px;
}

.shelf-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.shelf-head .pop-label { margin-bottom: 0; flex: 1 1 auto; }

.head-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 0 0 auto;
}

.head-controls select {
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid #c9b189;
  border-radius: 999px;
  background: #fffdf8;
  color: #6b4a24;
  cursor: pointer;
  max-width: 180px;
}

.next-shelf {
  flex: 0 0 auto;
  font-size: 13px;
  padding: 6px 14px;
  border: 1px solid #c9b189;
  border-radius: 999px;
  background: #fffdf8;
  color: #6b4a24;
  cursor: pointer;
  visibility: hidden;
}

.next-shelf:hover { background: #f7e8d4; }

.shelf {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 16px 16px 0;
  min-height: 180px;
  background: linear-gradient(#8a6842, #745533);
  border-radius: 8px 8px 4px 4px;
  border-bottom: 14px solid #5d4226;
  box-shadow: inset 0 8px 20px rgba(0, 0, 0, 0.25), 0 4px 10px rgba(58, 46, 34, 0.2);
}

.shelf::-webkit-scrollbar { height: 10px; }
.shelf::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.28); border-radius: 5px; }
.shelf::-webkit-scrollbar-thumb { background: #d9c9a8; border-radius: 5px; border: 2px solid rgba(0, 0, 0, 0.25); }
.shelf::-webkit-scrollbar-thumb:hover { background: #efe3c8; }

.book {
  flex: 0 0 auto;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  transition: transform 0.18s ease;
  position: relative;
}

.book:hover { transform: translateY(-10px) rotate(-1.5deg); }

.book img {
  height: 150px;
  width: auto;
  max-width: 110px;
  object-fit: cover;
  border-radius: 2px 4px 4px 2px;
  box-shadow: 3px 4px 8px rgba(0, 0, 0, 0.45);
  display: block;
}

.book .no-cover {
  height: 150px;
  width: 40px;
  writing-mode: vertical-rl;
  font-size: 12px;
  padding: 10px 4px;
}

.no-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  border-radius: 2px 4px 4px 2px;
  box-shadow: 3px 4px 8px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  line-height: 1.4;
}

.book .title-tip {
  position: absolute;
  left: 50%;
  bottom: -4px;
  transform: translateX(-50%) translateY(100%);
  background: #3a2e22;
  color: #f6efe3;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 5;
}

.book:hover .title-tip { opacity: 1; }

.wall { display: flex; flex-direction: column; gap: 10px; }

.wall-row {
  gap: 3px;
  padding: 12px 12px 0;
  min-height: 150px;
}

/* 「表紙置き」モード: 背表紙より幅があるので隙間を広げる */
.wall-row-cover { gap: 14px; align-items: flex-end; }

/* 「縦置き / 表紙置き」切り替えボタン */
.wall-mode-switch {
  display: flex;
  gap: 4px;
}

.wall-mode-switch button {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid #c9b189;
  background: #fffdf8;
  color: #6b4a24;
  cursor: pointer;
}

.wall-mode-switch button:hover { background: #f7e8d4; }

.wall-mode-switch button.active {
  background: #c97b3d;
  border-color: #c97b3d;
  color: #fff;
}

.spine {
  position: relative;
  writing-mode: vertical-rl;
  line-height: 1.05;
  padding: 9px 0 16px;
  border-radius: 1px 3px 3px 1px;
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.32) 0%,
    rgba(255, 255, 255, 0.06) 22%,
    rgba(0, 0, 0, 0) 55%,
    rgba(0, 0, 0, 0.14) 85%,
    rgba(0, 0, 0, 0.28) 100%
  );
  box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.38), inset 0 2px 2px -1px rgba(255, 255, 255, 0.3);
  overflow: hidden;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 著者名を下部に固定する背表紙は、タイトルを上詰めにする */
.spine.has-author { justify-content: flex-start; }

.sp-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  line-height: 13px;
  white-space: normal;
  display: inline-block;
  max-height: 100%;
  overflow: hidden;
}

/* 著者名ぶんの高さを空けてタイトルと重ならないようにする */
.spine.has-author .sp-title { max-height: calc(100% - 50px); }

/* 2列になるタイトル: JS側で列を明示的に分けてあるので、
   各列を上揃え・水平中央に置く(自動折返しの中央寄り/1文字残りを避ける)。
   コンテナだけ横書きに戻し、flex row-reverse で1列目を右に置く。 */
.sp-title-2col {
  writing-mode: horizontal-tb;
  display: flex;
  flex-direction: row-reverse;
  justify-content: center;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
}

.sp-col {
  writing-mode: vertical-rl;
  white-space: nowrap;
}

.sp-author {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  opacity: 0.72;
  letter-spacing: 0.5px;
  white-space: nowrap;
  max-height: 50px;
  overflow: hidden;
}

.sp-band {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 11px;
  opacity: 0.85;
}

.wall-row .book:hover { transform: translateY(-8px); }

.wall-row .book img {
  height: 148px;
  max-width: 100px;
}

.shelf-empty {
  color: #e8dcc2;
  font-size: 13px;
  align-self: center;
  margin: 0 auto;
  padding-bottom: 16px;
}

.empty-state {
  text-align: center;
  padding: 28px 16px 64px;
  color: #6b5842;
  max-width: 980px;
  margin: 0 auto;
}

.table-section { margin-bottom: 32px; text-align: left; }

.table {
  background: linear-gradient(#a5804f, #8a6842);
  border: 1px solid #6e5433;
  border-radius: 10px;
  padding: 22px 14px 26px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px 16px;
  justify-items: center;
  align-items: end;
  box-shadow: inset 0 8px 18px rgba(0, 0, 0, 0.22), 0 4px 10px rgba(58, 46, 34, 0.25);
  min-height: 150px;
}

@media (min-width: 480px) {
  .table {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 620px) {
  .table {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    padding: 26px 18px 30px;
    gap: 26px 16px;
  }
}

.book-flat {
  transition: transform 0.18s ease;
  display: flex;
  justify-content: center;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.book-flat:hover { transform: translateY(-8px) scale(1.04) !important; }

.book-flat img {
  height: 104px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  border-radius: 2px;
  display: block;
  box-shadow:
    2px 2px 0 #ece4d4,
    4px 4px 0 #ddd2c0,
    6px 6px 0 #e6dccb,
    8px 8px 0 #cfc2ae,
    10px 12px 14px rgba(0, 0, 0, 0.4);
}

@media (min-width: 620px) {
  .book-flat img { height: 128px; }
}

.entrance-hint { font-size: 13px; margin-bottom: 14px; }

.feedback-box {
  max-width: 560px;
  margin: 40px auto 0;
  text-align: left;
}


/* モーダル(オーバーレイ+パネル) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 20, 12, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

/* display:flex が [hidden] を打ち消すのを防ぐ(class+属性で詳細度を上げる) */
.modal-overlay[hidden] { display: none; }

.modal-panel {
  position: relative;
  background: #fdf6e9;
  border-radius: 14px;
  padding: 28px 24px 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  max-height: 90vh;
  overflow-y: auto;
  width: 100%;
}

.modal-panel.feedback-box { margin: 0; max-width: 520px; }

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: #8a745a;
  cursor: pointer;
  padding: 4px 8px;
}

.modal-close:hover { color: #3a2e22; }

.feedback-lead { font-size: 13px; color: #6b5842; margin: 10px 0 12px; }

#feedback-form textarea,
#feedback-form input {
  width: 100%;
  border: 1px solid #d8c9ae;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: #fffdf8;
  color: #3a2e22;
  resize: vertical;
}

.feedback-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.feedback-row input { flex: 1; }

#feedback-form button {
  flex: 0 0 auto;
  padding: 10px 22px;
  border: none;
  border-radius: 8px;
  background: #c97b3d;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

#feedback-form button:hover { background: #b56a2f; }
#feedback-form button:disabled { opacity: 0.6; cursor: default; }

.feedback-status { font-size: 13px; color: #1d5c40; margin-top: 10px; }
.feedback-status.is-error { color: #a3312d; }

body[data-layout="night"] .feedback-lead { color: #92a8d6; }
body[data-layout="night"] #feedback-form textarea,
body[data-layout="night"] #feedback-form input {
  background: #141c34; color: #dbe6fa; border-color: #2a3a64;
}
body[data-layout="night"] #feedback-form button { background: #3a64c8; }
body[data-layout="night"] #feedback-form button:hover { background: #3155ac; }
body[data-layout="night"] .feedback-status { color: #6fd0a8; }
body[data-layout="night"] .modal-panel { background: #0d1428; }
body[data-layout="night"] .modal-close { color: #7c8db5; }
body[data-layout="night"] .modal-close:hover { color: #dbe6fa; }

body[data-layout="forest"] .feedback-lead { color: #55704a; }
body[data-layout="forest"] .modal-panel { background: #f4f8ec; }
body[data-layout="forest"] #feedback-form textarea,
body[data-layout="forest"] #feedback-form input {
  background: #f9fbf2; color: #2c3a2a; border-color: #a8c494;
}
body[data-layout="forest"] #feedback-form button { background: #4a8a5c; }
body[data-layout="forest"] #feedback-form button:hover { background: #3e7a4e; }

.pop-hot { border-color: #c0392b; color: #922b21; }
.pop-season { border-color: #b8860b; color: #8a6408; }
.pop-mine { border-color: #b5762f; color: #9a5a1f; }

/* しおり(お気に入り)トグル */
.fav-toggle {
  align-self: flex-start;
  margin: 4px 0 14px;
  background: #fffdf8;
  border: 1px solid #c9b189;
  color: #6b4a24;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
}

.fav-toggle:hover { background: #f7e8d4; }

.fav-toggle.is-fav {
  background: #b5762f;
  border-color: #b5762f;
  color: #fff;
}

.suggest { margin-top: 20px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.chip {
  background: #fffdf8;
  border: 1px solid #c9b189;
  color: #6b4a24;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
}

.chip:hover { background: #f7e8d4; }

#book-menu {
  position: fixed;
  z-index: 50;
  width: 248px;
  background: #fffdf8;
  border: 1px solid #d8c9ae;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(58, 46, 34, 0.35);
  padding: 12px;
}

#book-menu .menu-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 6px;
}

#book-menu .menu-cover {
  width: 68px;
  flex: 0 0 auto;
  border-radius: 3px;
  box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.3);
}

#book-menu .menu-info { min-width: 0; }

#book-menu .menu-meta {
  font-size: 10.5px;
  color: #a08b6e;
  margin-top: 4px;
  line-height: 1.5;
}

#book-menu .menu-title {
  font-size: 13px;
  font-weight: 600;
  color: #3a2e22;
  line-height: 1.4;
  margin-bottom: 2px;
}

#book-menu .menu-author {
  font-size: 11px;
  color: #8a7358;
  margin-bottom: 8px;
}

#book-menu .menu-item {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 13px;
  padding: 8px 10px;
  margin-top: 6px;
  border: 1px solid #c9b189;
  border-radius: 8px;
  background: #fdf6ec;
  color: #6b4a24;
  cursor: pointer;
  text-decoration: none;
}

#book-menu .menu-item:hover { background: #f7e8d4; }

#book-menu .menu-primary {
  background: #c97b3d;
  border-color: #c97b3d;
  color: #fff;
  font-weight: 600;
}

#book-menu .menu-primary:hover { background: #b56a2f; }

#search-picker {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(30, 22, 14, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.picker-panel {
  background: #fffdf8;
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}

.picker-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 16px 10px;
  position: sticky;
  top: 0;
  background: #fffdf8;
  border-bottom: 1px solid #e0d3bc;
}

.picker-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: #3a2e22;
  line-height: 1.5;
}

.picker-close {
  flex: 0 0 auto;
  background: none;
  border: none;
  font-size: 16px;
  color: #8a7358;
  cursor: pointer;
  padding: 2px 6px;
}

.picker-close:hover { color: #3a2e22; }

.picker-filter-wrap {
  padding: 10px 16px;
  position: sticky;
  top: 57px;
  background: #fffdf8;
  border-bottom: 1px solid #f0e8d8;
  z-index: 1;
}

.picker-filter {
  width: 100%;
  padding: 7px 12px;
  border: 1px solid #d8c9ae;
  border-radius: 8px;
  font-size: 13px;
  background: #fdf9f0;
}

.picker-list { display: flex; flex-direction: column; }

.picker-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  border: none;
  border-bottom: 1px solid #f0e8d8;
  background: none;
  cursor: pointer;
}

.picker-row:last-child { border-bottom: none; }
.picker-row:hover { background: #fdf6ec; }

.picker-row img {
  width: 44px;
  height: 62px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.3);
  flex: 0 0 auto;
}

.picker-noimg {
  width: 44px;
  height: 62px;
  border-radius: 2px;
  flex: 0 0 auto;
  box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.3);
}

.picker-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.pr-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #3a2e22;
  line-height: 1.4;
}

.pr-sub {
  font-size: 11.5px;
  color: #8a7358;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-layout="night"] .picker-panel { background: #101830; }
body[data-layout="night"] .picker-head { background: #101830; border-bottom-color: #2a3a64; }
body[data-layout="night"] .picker-title { color: #dbe6fa; }
body[data-layout="night"] .picker-close { color: #7f92c0; }
body[data-layout="night"] .picker-close:hover { color: #dbe6fa; }
body[data-layout="night"] .picker-filter-wrap { background: #101830; border-bottom-color: #2a3a64; }
body[data-layout="night"] .picker-filter { background: #141c34; border-color: #2a3a64; color: #dbe6fa; }
body[data-layout="night"] .picker-row { border-bottom-color: #1c2648; }
body[data-layout="night"] .picker-row:hover { background: #141c34; }
body[data-layout="night"] .pr-title { color: #dbe6fa; }
body[data-layout="night"] .pr-sub { color: #7f92c0; }

body[data-layout="forest"] .picker-panel { background: #f9fbf2; }
body[data-layout="forest"] .picker-head { background: #f9fbf2; border-bottom-color: #d5e2c2; }
body[data-layout="forest"] .picker-title { color: #2c3a2a; }
body[data-layout="forest"] .picker-close { color: #6b8560; }
body[data-layout="forest"] .picker-close:hover { color: #2c3a2a; }
body[data-layout="forest"] .picker-filter-wrap { background: #f9fbf2; border-bottom-color: #d5e2c2; }
body[data-layout="forest"] .picker-filter { background: #f0f6e4; border-color: #a8c494; color: #2c3a2a; }
body[data-layout="forest"] .picker-row { border-bottom-color: #e6efd8; }
body[data-layout="forest"] .picker-row:hover { background: #f0f6e4; }
body[data-layout="forest"] .pr-title { color: #2c3a2a; }
body[data-layout="forest"] .pr-sub { color: #6b8560; }

.loading {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #3a2e22;
  color: #f6efe3;
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 10;
}

/* D: オフライン常時バナー */
.offline-banner {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #a3312d;
  color: #fff;
  text-align: center;
  font-size: 13px;
  padding: 8px 12px;
}

/* 画面内トースト(alert置き換え) */
.toast {
  position: fixed;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  max-width: min(90vw, 420px);
  background: #2f6f4f;
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  z-index: 20;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.toast.is-error { background: #a3312d; }

/* 失敗した棚の再試行UI */
.shelf-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 0 auto;
  padding: 18px 12px;
  color: #e8dcc2;
  font-size: 13px;
}

.shelf-retry {
  background: #a05a2c;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 13px;
  cursor: pointer;
}

.shelf-retry:hover { background: #b56a2f; }

/* E: 読み込み中スケルトン(本の形のプレースホルダ) */
.skel {
  flex: 0 0 auto;
  border-radius: 3px;
  background: linear-gradient(100deg, rgba(255,255,255,0.06) 30%, rgba(255,255,255,0.22) 50%, rgba(255,255,255,0.06) 70%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.3s ease-in-out infinite;
}

.skel-cover { width: 96px; height: 150px; }

.skel-wall-row { display: flex; gap: 3px; align-items: flex-end; }

.skel-spine { border-radius: 1px 3px 3px 1px; }

@keyframes skel-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .skel { animation: none; }
}

@media (max-width: 600px) {
  .center-card { flex-direction: column; align-items: center; text-align: left; }

  /* 棚(横スクロール)の本を小さくして、1画面によりたくさん見えるようにする */
  .shelf { gap: 10px; padding: 12px 12px 0; min-height: 148px; }
  .book img { height: 118px; max-width: 86px; }
  .book .no-cover { height: 118px; width: 32px; font-size: 11px; }
  .skel-cover { width: 76px; height: 118px; }
  .scroll-track { height: 9px; margin-top: 10px; }

  /* 棚差しの壁「表紙置き」モードも他の棚と同じ大きさに揃える(.wall-row .book img の詳細度が高く上書きされないよう同じ詳細度で再指定) */
  .wall-row .book img { height: 118px; max-width: 86px; }
  .wall-row .book .no-cover { height: 118px; width: 32px; font-size: 11px; }
}

/* ========== ナイトレイアウト(夜空のネイビー) ========== */

body[data-layout="night"] {
  background: #0a1020;
  color: #dbe6fa;
}

body[data-layout="night"] .store-header {
  background: linear-gradient(#0d1428, #050914);
  border-bottom-color: #030612;
}

body[data-layout="night"] .layout-select-label { color: #a8c0ec; }

body[data-layout="night"] .layout-switch select {
  border-color: rgba(120, 160, 255, 0.35);
  color: #dbe6fa;
}

body[data-layout="night"] .layout-switch select:hover { background: rgba(120, 160, 255, 0.14); }

body[data-layout="night"] .store-tagline,
body[data-layout="night"] .genre-select-row label { color: #92a8d6; }

body[data-layout="night"] .search-form input,
body[data-layout="night"] .genre-select-row select {
  background: #141c34;
  color: #dbe6fa;
  border-color: #2a3a64;
}

body[data-layout="night"] .search-form button {
  background: #3a64c8;
}

body[data-layout="night"] .search-form button:hover { background: #3155ac; }

body[data-layout="night"] .history button {
  background: rgba(120, 160, 255, 0.1);
  border-color: rgba(120, 160, 255, 0.28);
  color: #b0c4ee;
}

body[data-layout="night"] .breadcrumb button { color: #6f9bf0; }
body[data-layout="night"] .crumb-current { color: #dbe6fa; }
body[data-layout="night"] .crumb-sep,
body[data-layout="night"] .subgenre-lead,
body[data-layout="night"] .empty-state,
body[data-layout="night"] .entrance-hint { color: #7f92c0; }

body[data-layout="night"] .chip,
body[data-layout="night"] .chip-sub,
body[data-layout="night"] .next-shelf,
body[data-layout="night"] .head-controls select,
body[data-layout="night"] .wall-mode-switch button,
body[data-layout="night"] .subgenre-select {
  background: #141c34;
  color: #b0c4ee;
  border-color: #2a3a64;
}

body[data-layout="night"] .chip:hover,
body[data-layout="night"] .chip-sub:hover,
body[data-layout="night"] .wall-mode-switch button:hover,
body[data-layout="night"] .next-shelf:hover { background: #1e2a4c; }

body[data-layout="night"] .wall-mode-switch button.active {
  background: #3a64c8; border-color: #3a64c8; color: #fff;
}

body[data-layout="night"] .pop-label {
  background: #141c34;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.55);
}

body[data-layout="night"] .pop-label { color: #7fa8f0; border-color: #3a64c8; }
body[data-layout="night"] .pop-author { color: #6fd0a8; border-color: #2e8a68; }
body[data-layout="night"] .pop-similar { color: #a8b8f8; border-color: #5b6bd6; }
body[data-layout="night"] .pop-recommend { color: #e08ac0; border-color: #c2447a; }
body[data-layout="night"] .pop-hot { color: #f09080; border-color: #c0392b; }
body[data-layout="night"] .pop-season { color: #e0c05a; border-color: #b8860b; }
body[data-layout="night"] .pop-mine { color: #f0b070; border-color: #b5762f; }
body[data-layout="night"] .fav-toggle {
  background: #16203c; border-color: #2f3f66; color: #cdd8f2;
}
body[data-layout="night"] .fav-toggle:hover { background: #1e2a4c; }
body[data-layout="night"] .fav-toggle.is-fav { background: #b5762f; border-color: #b5762f; color: #fff; }

body[data-layout="night"] .center-card {
  background: #101830;
  border-color: #2a3a64;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

body[data-layout="night"] .center-author { color: #7f92c0; }
body[data-layout="night"] .center-meta,
body[data-layout="night"] #book-menu .menu-meta { color: #6a7ca8; }
body[data-layout="night"] .center-desc { color: #b0c4ee; }

body[data-layout="night"] .buy-links a {
  background: #141c34;
  border-color: #3a64c8;
  color: #8fb0f0;
}

body[data-layout="night"] .buy-links a:hover { background: #1e2a4c; }

body[data-layout="night"] .shelf {
  background: linear-gradient(#1c2648, #101830);
  border-bottom-color: #080c1a;
  box-shadow: inset 0 8px 20px rgba(0, 0, 0, 0.6), 0 4px 12px rgba(0, 0, 0, 0.5);
}

body[data-layout="night"] .shelf::-webkit-scrollbar-thumb {
  background: #6f95e0;
  border-color: rgba(0, 0, 0, 0.4);
}

body[data-layout="night"] .scroll-track { background: rgba(0, 0, 0, 0.4); }
body[data-layout="night"] .scroll-thumb { background: #6f95e0; }

body[data-layout="night"] .table {
  background: linear-gradient(#202c54, #141c38);
  border-color: #0c1428;
  box-shadow: inset 0 8px 18px rgba(0, 0, 0, 0.55), 0 4px 12px rgba(0, 0, 0, 0.5);
}

body[data-layout="night"] .book-flat img {
  box-shadow:
    2px 2px 0 #34447c,
    4px 4px 0 #283864,
    6px 6px 0 #304078,
    8px 8px 0 #1e2a4c,
    12px 14px 18px rgba(0, 0, 0, 0.8);
}

body[data-layout="night"] #book-menu {
  background: #101830;
  border-color: #2a3a64;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.8);
}

body[data-layout="night"] #book-menu .menu-title { color: #dbe6fa; }
body[data-layout="night"] #book-menu .menu-author { color: #7f92c0; }

body[data-layout="night"] #book-menu .menu-item {
  background: #141c34;
  border-color: #2a3a64;
  color: #b0c4ee;
}

body[data-layout="night"] #book-menu .menu-item:hover { background: #1e2a4c; }

body[data-layout="night"] #book-menu .menu-primary {
  background: #3a64c8;
  border-color: #3a64c8;
  color: #fff;
}

body[data-layout="night"] #book-menu .menu-primary:hover { background: #3155ac; }

body[data-layout="night"] .loading { background: #101830; }

/* ========== フォレストレイアウト(森の書店) ========== */

body[data-layout="forest"] {
  background: #edf3e4;
  color: #2c3a2a;
}

body[data-layout="forest"] .store-header {
  background: linear-gradient(#2e4a30, #203622);
  border-bottom-color: #16260f;
}

body[data-layout="forest"] .store-tagline,
body[data-layout="forest"] .genre-select-row label { color: #b8d4a8; }

body[data-layout="forest"] .search-form button {
  background: #4a8a5c;
  border-color: #4a8a5c;
}

body[data-layout="forest"] .search-form button:hover { background: #3e7a4e; }

body[data-layout="forest"] .layout-select-label { color: #b8d4a8; }

body[data-layout="forest"] .search-form input,
body[data-layout="forest"] .genre-select-row select { border-color: rgba(120, 180, 120, 0.7); }

body[data-layout="forest"] .history button {
  background: rgba(200, 240, 190, 0.12);
  border-color: rgba(200, 240, 190, 0.3);
  color: #d0e4c0;
}

body[data-layout="forest"] .breadcrumb button { color: #3e7a4e; }
body[data-layout="forest"] .crumb-current { color: #2c3a2a; }
body[data-layout="forest"] .subgenre-lead,
body[data-layout="forest"] .empty-state,
body[data-layout="forest"] .entrance-hint { color: #55704a; }

body[data-layout="forest"] .chip,
body[data-layout="forest"] .chip-sub,
body[data-layout="forest"] .next-shelf,
body[data-layout="forest"] .head-controls select,
body[data-layout="forest"] .wall-mode-switch button,
body[data-layout="forest"] .subgenre-select {
  background: #f7faf0;
  border-color: #a8c494;
  color: #3a5c34;
}

body[data-layout="forest"] .chip:hover,
body[data-layout="forest"] .chip-sub:hover,
body[data-layout="forest"] .wall-mode-switch button:hover,
body[data-layout="forest"] .next-shelf:hover { background: #e6f0d8; }

body[data-layout="forest"] .wall-mode-switch button.active {
  background: #4a8a5c; border-color: #4a8a5c; color: #fff;
}

body[data-layout="forest"] .pop-label { background: #f7faf0; }
body[data-layout="forest"] .pop-label { color: #2e6440; border-color: #4a8a5c; }
body[data-layout="forest"] .pop-author { color: #1d5c40; border-color: #2e7d5b; }
body[data-layout="forest"] .pop-similar { color: #3c5c9e; border-color: #5b7bd6; }
body[data-layout="forest"] .pop-recommend { color: #94285a; border-color: #c2447a; }
body[data-layout="forest"] .pop-hot { color: #922b21; border-color: #c0392b; }
body[data-layout="forest"] .pop-season { color: #8a6408; border-color: #b8860b; }
body[data-layout="forest"] .pop-mine { color: #9a5a1f; border-color: #b5762f; }
body[data-layout="forest"] .fav-toggle {
  background: #f9fbf2; border-color: #a8c494; color: #2c3a2a;
}
body[data-layout="forest"] .fav-toggle:hover { background: #e2eed0; }
body[data-layout="forest"] .fav-toggle.is-fav { background: #b5762f; border-color: #b5762f; color: #fff; }

body[data-layout="forest"] .center-card {
  background: #f9fbf2;
  border-color: #d5e2c2;
  box-shadow: 0 4px 16px rgba(46, 74, 48, 0.12);
}

body[data-layout="forest"] .center-author { color: #6b8560; }
body[data-layout="forest"] .center-meta,
body[data-layout="forest"] #book-menu .menu-meta { color: #7d9370; }
body[data-layout="forest"] .center-desc { color: #44543e; }

body[data-layout="forest"] .buy-links a {
  background: #f0f6e4;
  border-color: #4a8a5c;
  color: #2e6440;
}

body[data-layout="forest"] .buy-links a:hover { background: #e2eed0; }

body[data-layout="forest"] .shelf {
  background: linear-gradient(#5f7a48, #4c643a);
  border-bottom-color: #3a5028;
  box-shadow: inset 0 8px 20px rgba(20, 40, 15, 0.35), 0 4px 10px rgba(46, 74, 48, 0.25);
}

body[data-layout="forest"] .shelf::-webkit-scrollbar-thumb {
  background: #d5e4b8;
  border-color: rgba(20, 40, 15, 0.3);
}

body[data-layout="forest"] .scroll-track { background: rgba(20, 40, 15, 0.25); }
body[data-layout="forest"] .scroll-thumb { background: #d5e4b8; }

body[data-layout="forest"] .table {
  background: linear-gradient(#748f56, #5f7a48);
  border-color: #4a6238;
  box-shadow: inset 0 8px 18px rgba(20, 40, 15, 0.3), 0 4px 10px rgba(46, 74, 48, 0.28);
}

body[data-layout="forest"] .book-flat img {
  box-shadow:
    2px 2px 0 #e4ecd4,
    4px 4px 0 #d2ddc0,
    6px 6px 0 #dde6cc,
    8px 8px 0 #c2ceac,
    12px 14px 16px rgba(20, 40, 15, 0.45);
}

body[data-layout="forest"] #book-menu {
  background: #f9fbf2;
  border-color: #b8cda0;
  box-shadow: 0 8px 24px rgba(30, 50, 25, 0.35);
}

body[data-layout="forest"] #book-menu .menu-title { color: #2c3a2a; }
body[data-layout="forest"] #book-menu .menu-author { color: #6b8560; }

body[data-layout="forest"] #book-menu .menu-item {
  background: #f0f6e4;
  border-color: #a8c494;
  color: #3a5c34;
}

body[data-layout="forest"] #book-menu .menu-item:hover { background: #e2eed0; }

body[data-layout="forest"] #book-menu .menu-primary {
  background: #4a8a5c;
  border-color: #4a8a5c;
  color: #fff;
}

body[data-layout="forest"] .loading { background: #203622; }

/* ===== 私の棚(複数棚)・棚ピッカー・共有・汎用モーダル ===== */

/* ヘッダーのボタン(私の棚 / 店内に戻る など。ご意見箱と同じ見た目) */
.header-btn {
  background: rgba(255, 253, 248, 0.14);
  border: 1px solid rgba(255, 253, 248, 0.4);
  color: #f6efe3;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
}
.header-btn:hover { background: rgba(255, 253, 248, 0.26); }

/* 「私の棚」見出し行(見出し+新しい棚ボタン) */
.my-shelf-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0 16px;
}
.my-shelf-heading { margin-bottom: 0; }
.new-shelf-btn {
  background: #c97b3d;
  border: 1px solid #c97b3d;
  color: #fff;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.new-shelf-btn:hover { background: #b56a2f; }

/* 個々の棚セクション */
.user-shelf { margin-bottom: 28px; }
.user-shelf-head { display: flex; align-items: center; gap: 8px; }
.user-shelf-count {
  font-size: 12px;
  font-weight: 400;
  color: #8a745a;
  margin-left: 8px;
}
.user-shelf-controls { display: inline-flex; gap: 4px; flex: 0 0 auto; }
.shelf-ctrl-btn {
  background: #fffdf8;
  border: 1px solid #d8c9ae;
  border-radius: 8px;
  width: 32px;
  height: 30px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  color: #6b5842;
}
.shelf-ctrl-btn:hover { background: #f7e8d4; }
.user-shelf-desc {
  font-size: 13px;
  color: #6b5842;
  line-height: 1.6;
  margin: 0 0 12px;
  padding-left: 4px;
  border-left: 3px solid #e0cfa8;
  padding: 4px 0 4px 12px;
  white-space: pre-wrap;
}
.user-shelf-empty { margin: 4px 0 0; }

/* 棚ピッカー(どの棚に入れるか) */
#book-menu.shelf-picker .menu-item.shelf-row {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
}
.shelf-row .shelf-check { flex: 0 0 auto; width: 16px; font-weight: 700; text-align: center; }
.shelf-row .shelf-name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shelf-row .shelf-count { flex: 0 0 auto; font-size: 11px; opacity: 0.65; }
#book-menu.shelf-picker .menu-item.shelf-row.is-in {
  background: #f2dcc0;
  border-color: #c97b3d;
  color: #8a4f1d;
  font-weight: 600;
}
#book-menu.shelf-picker .menu-item.shelf-row.is-in:hover { background: #eccfa8; }

/* お知らせ(🔔ベル + 未読ドット + 一覧モーダル) */
.announce-btn { position: relative; }
.announce-dot {
  position: absolute;
  top: 2px;
  right: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e0483a;
  box-shadow: 0 0 0 2px rgba(58, 40, 24, 0.5);
}
.announce-box { max-width: 520px; margin: 0; text-align: left; }
.announce-list { margin-top: 8px; }
.announce-item {
  padding: 12px 0;
  border-bottom: 1px solid #e5d8bf;
}
.announce-item:last-child { border-bottom: none; }
.announce-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.announce-title { font-size: 15px; margin: 0; color: #3a2e22; }
.announce-item.is-new .announce-title::before {
  content: "NEW";
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: #e0483a;
  border-radius: 4px;
  padding: 1px 5px;
  margin-right: 6px;
  vertical-align: middle;
}
.announce-date { font-size: 12px; color: #8a745a; margin-left: auto; }
.announce-body { font-size: 13px; line-height: 1.7; color: #5a4a38; margin: 0; white-space: pre-wrap; }
.announce-empty { font-size: 13px; color: #8a745a; padding: 12px 0; }

body[data-layout="night"] .announce-item { border-color: #2f4470; }
body[data-layout="night"] .announce-title { color: #dbe6fa; }
body[data-layout="night"] .announce-body { color: #9fb0d8; }
body[data-layout="night"] .announce-date,
body[data-layout="night"] .announce-empty { color: #7f92c0; }
body[data-layout="forest"] .announce-item { border-color: #cfe0be; }
body[data-layout="forest"] .announce-title { color: #2c3a2a; }
body[data-layout="forest"] .announce-body { color: #4d6647; }
body[data-layout="forest"] .announce-date,
body[data-layout="forest"] .announce-empty { color: #5a7050; }

/* 中央ビューの操作ボタン行(棚に入れる / 感想を書く) */
.center-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-self: flex-start;
  margin: 4px 0 14px;
}
.center-actions .fav-toggle { margin: 0; align-self: auto; }

/* 本メニュー内の感想表示(自分のメモを手書きPOP風に) */
#book-menu .menu-note {
  font-size: 12px;
  line-height: 1.6;
  text-align: left;
  color: #6b4a24;
  background: #fdf6ec;
  border-left: 3px solid #c97b3d;
  border-radius: 0 6px 6px 0;
  padding: 7px 10px;
  margin: 8px 0 2px;
  white-space: pre-wrap;
  max-height: 110px;
  overflow-y: auto;
}

/* 私の棚で感想つきの本に付くバッジ */
.note-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: #fffdf8;
  font-size: 13px;
  line-height: 1;
  z-index: 2;
  cursor: pointer;
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.35);
}
.note-badge:hover { background: #f7e8d4; }

body[data-layout="night"] #book-menu .menu-note { background: #1a2440; border-color: #3155ac; color: #b9c8ea; }
body[data-layout="forest"] #book-menu .menu-note { background: #eef5e2; border-color: #4a8a5c; color: #3d5a3a; }

/* 私の棚ページ(店の平台とは別ページ) */
.my-shelf-view { text-align: left; margin-bottom: 32px; }

/* ページ内の「店内に戻る」ボタン。.header-btn は暗いヘッダー用の淡色文字なので、
   明るいページ背景では見えづらい。ここでは濃色テキストに上書きする。 */
.my-shelf-bar .header-btn,
.shared-shelf-actions .header-btn {
  background: #fffdf8;
  border: 1px solid #d8c9ae;
  color: #6b5842;
}
.my-shelf-bar .header-btn:hover,
.shared-shelf-actions .header-btn:hover { background: #f2e6d2; }
body[data-layout="night"] .my-shelf-bar .header-btn,
body[data-layout="night"] .shared-shelf-actions .header-btn { background: #142038; border-color: #2f4470; color: #b9c8ea; }
body[data-layout="night"] .my-shelf-bar .header-btn:hover,
body[data-layout="night"] .shared-shelf-actions .header-btn:hover { background: #1e2a4c; }
body[data-layout="forest"] .my-shelf-bar .header-btn,
body[data-layout="forest"] .shared-shelf-actions .header-btn { background: #f7faf0; border-color: #cfe0be; color: #3d5a3a; }
body[data-layout="forest"] .my-shelf-bar .header-btn:hover,
body[data-layout="forest"] .shared-shelf-actions .header-btn:hover { background: #e2eed0; }

/* 共有された棚ビュー */
.shared-shelf-view { text-align: left; margin-bottom: 32px; }
.shared-shelf-title { font-size: 22px; margin: 8px 0 6px; color: #3a2e22; }
.shared-shelf-desc {
  font-size: 14px;
  color: #6b5842;
  line-height: 1.7;
  white-space: pre-wrap;
  border-left: 3px solid #e0cfa8;
  padding: 4px 0 4px 12px;
  margin: 0 0 14px;
}
.shared-shelf-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }

/* 汎用の入力/確認モーダル */
.text-modal-panel { max-width: 440px; }
.text-modal-message { font-size: 14px; color: #6b5842; line-height: 1.7; margin: 10px 0 4px; }
.text-modal-label { display: block; font-size: 13px; color: #6b5842; margin: 10px 0 6px; }
.text-modal-input {
  width: 100%;
  border: 1px solid #d8c9ae;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: #fffdf8;
  color: #3a2e22;
  box-sizing: border-box;
}
textarea.text-modal-input { resize: vertical; }
.text-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.btn-ghost {
  background: none;
  border: 1px solid #d8c9ae;
  color: #6b5842;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
}
.btn-ghost:hover { background: #f2e6d2; }
.btn-primary {
  background: #c97b3d;
  border: 1px solid #c97b3d;
  color: #fff;
  padding: 8px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:hover { background: #b56a2f; }

/* ナイト */
body[data-layout="night"] .shelf-ctrl-btn { background: #142038; border-color: #2f4470; color: #b9c8ea; }
body[data-layout="night"] .shelf-ctrl-btn:hover { background: #1e2a4c; }
body[data-layout="night"] .user-shelf-count,
body[data-layout="night"] .user-shelf-desc,
body[data-layout="night"] .shared-shelf-desc,
body[data-layout="night"] .text-modal-message,
body[data-layout="night"] .text-modal-label { color: #9fb0d8; }
body[data-layout="night"] .user-shelf-desc,
body[data-layout="night"] .shared-shelf-desc { border-color: #2f4470; }
body[data-layout="night"] .shared-shelf-title { color: #dbe6fa; }
body[data-layout="night"] .text-modal-input { background: #0d1428; border-color: #2f4470; color: #dbe6fa; }
body[data-layout="night"] .btn-ghost { border-color: #2f4470; color: #9fb0d8; }
body[data-layout="night"] .btn-ghost:hover { background: #1e2a4c; }
body[data-layout="night"] #book-menu.shelf-picker .menu-item.shelf-row.is-in { background: #24365e; border-color: #3155ac; color: #f0b070; }

/* フォレスト */
body[data-layout="forest"] .shelf-ctrl-btn { background: #f7faf0; border-color: #cfe0be; color: #3d5a3a; }
body[data-layout="forest"] .shelf-ctrl-btn:hover { background: #e2eed0; }
body[data-layout="forest"] .user-shelf-count,
body[data-layout="forest"] .user-shelf-desc,
body[data-layout="forest"] .shared-shelf-desc,
body[data-layout="forest"] .text-modal-message,
body[data-layout="forest"] .text-modal-label { color: #5a7050; }
body[data-layout="forest"] .shared-shelf-title { color: #2c3a2a; }
body[data-layout="forest"] .text-modal-input { background: #fbfdf6; border-color: #cfe0be; color: #2c3a2a; }
body[data-layout="forest"] .btn-ghost { border-color: #cfe0be; color: #5a7050; }
body[data-layout="forest"] .btn-ghost:hover { background: #e2eed0; }

@media (max-width: 600px) {
  .user-shelf-head { flex-wrap: wrap; }
}

/* フッター(全ビュー共通で常時表示) */
.site-footer {
  text-align: center;
  padding: 24px 16px 40px;
  font-size: 12px;
}
.site-footer a { color: #8a745a; text-decoration: underline; }
.site-footer a:hover { color: #6b5842; }
body[data-layout="night"] .site-footer a { color: #7f92c0; }
body[data-layout="night"] .site-footer a:hover { color: #a8c0ec; }
body[data-layout="forest"] .site-footer a { color: #5a7050; }
body[data-layout="forest"] .site-footer a:hover { color: #3d5a3a; }

/* プライバシーポリシー専用ページ */
.policy-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px 80px;
  text-align: left;
  color: #3a2e22;
  line-height: 1.8;
}
.policy-page h1 { font-size: 24px; margin-bottom: 4px; }
.policy-page .policy-updated { font-size: 13px; color: #8a745a; margin-bottom: 28px; }
.policy-page h2 { font-size: 17px; margin: 28px 0 10px; color: #8a4f1d; }
.policy-page p, .policy-page li { font-size: 14px; }
.policy-page ul { padding-left: 1.4em; margin: 8px 0; }
.policy-page .back-link { display: inline-block; margin-top: 32px; font-size: 13px; }
