:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --text: #333333;
  --text-dim: #767267;
  --accent: #b5652f;
  --border: #e2ddd2;
  --price: #c0392b;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Noto Sans JP", sans-serif;
  line-height: 1.7;
}

a {
  color: var(--accent);
}

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

/* ヘッダー */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.site-logo {
  font-weight: bold;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}

.nav-toggle {
  display: none;
}

.nav-toggle__label {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.nav-toggle__label span {
  width: 22px;
  height: 2px;
  background: var(--text);
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.site-nav a {
  text-decoration: none;
  color: var(--text);
  font-size: 0.92rem;
}

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

@media (max-width: 640px) {
  .nav-toggle__label {
    display: flex;
  }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
  }
  .site-nav ul {
    flex-direction: column;
    gap: 12px;
  }
  .nav-toggle:checked ~ .site-nav {
    display: block;
  }
}

/* フッター */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 48px;
}

.site-footer__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 16px;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.site-footer__notice {
  margin: 0 0 8px;
}

.site-footer__copy {
  margin: 0;
}

/* 見出し */
h1 {
  font-size: 1.4rem;
  margin: 0 0 16px;
}

h2 {
  font-size: 1.1rem;
  margin: 24px 0 12px;
}

/* 商品グリッド */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
}

.product-card__image {
  aspect-ratio: 4 / 3;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  overflow: hidden;
}

.product-card__image img,
.item-detail__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-card__name {
  font-size: 0.95rem;
  font-weight: bold;
}

.product-card__price {
  color: var(--price);
  font-weight: bold;
}

/* バッジ */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  width: fit-content;
}

.badge--ok {
  background: #e4f2e6;
  color: #2f7a3f;
}

.badge--warn {
  background: #fbeee0;
  color: #a6612a;
}

.badge--muted {
  background: #ece9e3;
  color: var(--text-dim);
}

/* ボタン */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn--ghost {
  background: transparent;
  color: var(--accent);
}

.btn[disabled] {
  background: var(--border);
  border-color: var(--border);
  color: var(--text-dim);
  cursor: not-allowed;
}

/* 商品詳細 */
.item-detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 640px) {
  .item-detail {
    grid-template-columns: 320px 1fr;
  }
}

.item-detail__image {
  aspect-ratio: 4 / 3;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  overflow: hidden;
}

.item-detail__price {
  font-size: 1.3rem;
  color: var(--price);
  font-weight: bold;
  margin: 8px 0;
}

.item-detail__meta {
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* レビュー */
.review-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 12px;
}

.review-card__meta {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-bottom: 6px;
}

.review-card p {
  white-space: pre-line;
}

/* お知らせバナー */
.notice-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

/* フォーム */
.form-field {
  margin-bottom: 16px;
}

.form-field label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}

/* テーブル */
table.simple-table {
  width: 100%;
  border-collapse: collapse;
}

table.simple-table th,
table.simple-table td {
  border-bottom: 1px solid var(--border);
  padding: 10px 8px;
  text-align: left;
  font-size: 0.9rem;
}

/* ユーザーページ */
.user-profile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.user-profile__status {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

/* 配色の微変化（復元度3以降） */
body.lv3-shift {
  --accent: #9a5a63;
  --price: #7a3b6a;
}

/* トースト通知 */
.cd-toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ヒントウィジェット */
#hint-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999;
}

.hint-toggle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  position: relative;
}

.hint-toggle--new::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--price);
  border: 2px solid var(--surface);
}

.hint-panel {
  position: absolute;
  right: 0;
  bottom: 60px;
  width: 260px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.hint-panel__header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: bold;
}

.hint-panel__body {
  padding: 12px 14px;
  font-size: 0.82rem;
  color: var(--text-dim);
  max-height: 260px;
  overflow-y: auto;
}

.hint-panel__body p {
  margin: 0 0 10px;
}

.hint-panel__body p:last-child {
  margin-bottom: 0;
}
