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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', sans-serif;
  background: #f4f6f9;
  color: #2d3748;
  font-size: 15px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ナビゲーション */
.nav {
  background: #1e3a5f;
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  height: 54px;
  gap: 2rem;
}
.nav-brand {
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.nav-links { display: flex; gap: 0.25rem; margin-left: auto; }
.nav-links a {
  color: #a8c4e0;
  text-decoration: none;
  padding: 0.3rem 0.75rem;
  border-radius: 5px;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
}
.nav-links a:hover,
.nav-links a.active { color: #fff; background: rgba(255,255,255,0.15); }

/* ハンバーガーボタン（デスクトップでは非表示） */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  margin-left: auto;
  background: transparent;
  border: none;
  cursor: pointer;
}
.nav-hamburger span {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* メインコンテナ */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 1.25rem 0.75rem; flex: 1; }

/* ページヘッダー */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.page-header h1 { font-size: 1.35rem; font-weight: 700; color: #1e3a5f; }

/* 検索バー */
.search-bar {
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.search-bar input {
  width: 100%;
  max-width: 360px;
  padding: 0.5rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #1e293b;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-bar select {
  max-width: 200px;
}
.search-bar input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* ふりがなラベル */
.ruby-label {
  display: block;
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 1px;
}

/* ボタン */
.btn {
  display: inline-block;
  padding: 0.45rem 1.1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-family: inherit;
  font-weight: 600;
  transition: background 0.15s;
}
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #e2e8f0; color: #475569; }
.btn-secondary:hover { background: #cbd5e1; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-danger-muted { background: #e8a8a8; color: #9b6060; }
.btn-danger-muted:hover { background: #deb8b8; }

/* テーブル */
.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.table th {
  background: #f1f5f9;
  padding: 0.45rem 0.75rem;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #e2e8f0;
}
.table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.95rem;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #f8fafc; }
/* 顧客名・銘柄・ボタン列の折り返し防止 */
.table th { white-space: nowrap; }
.table td:first-child,
.table td:nth-child(2) { white-space: nowrap; }
.table th:last-child,
.table td:last-child { white-space: nowrap; width: 1%; }
.table a { color: #2563eb; text-decoration: none; }
.table a:hover { text-decoration: underline; }

/* カード（フォーム用） */
.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  padding: 1.75rem;
  max-width: 520px;
}

/* フォーム */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: #374151;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.55rem 0.8rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #1e293b;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-select {
  width: 100%;
  padding: .55rem .8rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: .95rem;
  font-family: inherit;
  background: #fff;
  color: #1e293b;
  transition: border-color .15s, box-shadow .15s;
}
.form-select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.required { color: #ef4444; margin-left: 2px; }
.hint { font-size: 0.8rem; color: #94a3b8; margin-top: 0.25rem; }

/* フォームアクション */
.form-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }

/* アラート */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 7px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.alert-success { background: #f0fdf4; border: 1px solid #86efac; color: #15803d; }

/* エラーリスト */
.error-list { margin: 0; padding-left: 1.25rem; }
.error-list li { margin-bottom: 0.2rem; }

/* 空状態 */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #94a3b8;
}
.empty-state p { font-size: 0.95rem; margin-bottom: 1rem; }

/* ダッシュボードカード */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.dash-card {
  background: #fff;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  text-decoration: none;
  color: inherit;
  border-left: 4px solid #2563eb;
  transition: box-shadow 0.15s;
}
.dash-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.dash-card h2 { font-size: 0.85rem; color: #64748b; font-weight: 600; margin-bottom: 0.5rem; }
.dash-card .count { font-size: 2rem; font-weight: 700; color: #1e3a5f; }
.dash-card.bottles { border-left-color: #7c3aed; }

/* バッジ */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }

/* ===== モーダル ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.modal-overlay[hidden] { display: none; }

.modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
  animation: modal-in 0.18s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(-12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)     scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  background: #fff;
  border-radius: 12px 12px 0 0;
}
.modal-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e3a5f;
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  padding: 0 0.2rem;
  transition: color 0.15s;
}
.modal-close:hover { color: #475569; }

.modal-body { padding: 1.5rem; }

/* ドラッグハンドル */
.drag-handle-th {
  width: 2rem;
  padding: 0 0.25rem !important;
}
.drag-handle {
  width: 2rem;
  text-align: center;
  cursor: grab;
  padding: 0 0.25rem !important;
  color: #cbd5e1;
  user-select: none;
}
.drag-handle:active { cursor: grabbing; }
.drag-icon {
  font-size: 1.1rem;
  line-height: 1;
  display: inline-block;
}

/* ドラッグ中の行スタイル */
.drag-dragging {
  opacity: 0.4;
}
.drag-over {
  background: #eff6ff !important;
  box-shadow: inset 0 2px 0 #2563eb;
}

/* 操作列ボタン */
.btn-sm {
  padding: .28rem .65rem;
  font-size: .8rem;
  border-radius: 5px;
}

/* ===== ナビ：店舗名 & ログアウト ===== */
.nav-tenant {
  color: #a8c4e0;
  font-size: 0.82rem;
  padding: 0.3rem 0.5rem;
  white-space: nowrap;
  opacity: 0.8;
}
.nav-logout {
  color: #a8c4e0;
  text-decoration: none;
  padding: 0.3rem 0.75rem;
  border-radius: 5px;
  font-size: 0.9rem;
  border: 1px solid rgba(168,196,224,0.4);
  transition: background 0.15s, color 0.15s;
}
.nav-logout:hover { color: #fff; background: rgba(255,255,255,0.15); }

/* ===== ログイン画面 ===== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: #f4f6f9;
}
.login-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
}
.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e3a5f;
  text-align: center;
  margin-bottom: 1.5rem;
}
.login-submit { width: 100%; margin-top: 0.5rem; }

/* タブレット：テーブルをカードスタックに切り替え */
@media (max-width: 768px) {
  .section-block { padding: 0.75rem; }
  .card { padding: 1.25rem; }
  .page-header { flex-wrap: wrap; gap: 0.5rem; }
  .page-header h1 { font-size: 1.15rem; }

  /* カード型スタックレイアウト */
  .table {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
  }
  .table thead { display: none; }
  .table tbody tr[hidden] { display: none !important; }
  .table tbody tr {
    display: block;
    margin-bottom: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    overflow: hidden;
  }
  .table tbody td {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.5rem;
    padding: 0.3rem 0.65rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
  }
  .table tbody td:last-child { border-bottom: none; }
  .table tbody td::before {
    content: attr(data-label);
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 7em;
    padding-top: 0.1rem;
  }
  .table tbody td[data-label=""]::before { display: none; }

  /* ボタン行 */
  .table tbody td[data-label=""]:not(.drag-handle) {
    display: flex !important;
    gap: 0.5rem;
    width: 100% !important;
    white-space: normal;
    padding: 0.65rem 0.75rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0 !important;
    border-bottom: none;
    box-sizing: border-box;
  }
  .table tbody td[data-label=""]:not(.drag-handle) .btn {
    display: block !important;
    flex: 1;
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    text-align: center;
  }

  /* ドラッグハンドルをカード上部のグリップバーとして表示 */
  .drag-handle-th { display: none !important; }
  .table tbody td.drag-handle {
    display: flex !important;
    justify-content: center !important;
    align-items: center;
    padding: 0.35rem !important;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0 !important;
    color: #94a3b8;
    cursor: grab;
  }
  .table tbody td.drag-handle::before { display: none !important; }
  .table tbody td.drag-handle .drag-icon { font-size: 1.3rem; }

  /* 顧客詳細・日報 */
  .info-dl { grid-template-columns: 1fr; }
  .info-dl dt { margin-top: 0.5rem; }
  .visit-card-header { gap: 0.4rem; }

  /* 来店カードのボタン行：スマホで横幅いっぱいに */
  .visit-card-actions {
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px solid #e2e8f0;
    justify-content: stretch;
  }
  .visit-card-actions .btn {
    flex: 1;
    min-height: 44px;
    font-size: 0.95rem;
    text-align: center;
    padding: 0.5rem 0.5rem;
  }
}

/* モバイル：ナビゲーションをハンバーガーメニューに */
@media (max-width: 640px) {
  .nav { min-height: 48px; height: auto; gap: 0; flex-wrap: wrap; padding: 0 0.75rem; }
  .nav-brand { flex-shrink: 0; }
  .nav-hamburger { display: flex; height: 48px; }
  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    background: #1e3a5f;
    padding: 0.5rem 0 0.75rem;
    gap: 0;
    order: 3;
    margin-left: 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.65rem 1rem; border-radius: 0; font-size: 1rem; border-top: 1px solid rgba(255,255,255,0.07); text-align: center; }
  .nav-links .nav-logout { margin-top: 0.5rem; margin-left: 1rem; margin-right: 1rem; border-radius: 6px; border: 2px solid rgba(168,196,224,0.6); border-top: 2px solid rgba(168,196,224,0.6); }
  .nav-tenant { font-size: 0.78rem; padding: 0.2rem 0.4rem; flex: 1; }
}

/* ===== 顧客詳細・日報 共通 ===== */
.back-link {
  display: inline-block;
  font-size: 0.85rem;
  color: #64748b;
  text-decoration: none;
  margin-bottom: 0.3rem;
}
.back-link:hover { color: #1e3a5f; }

.section-block {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e3a5f;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-dl {
  display: grid;
  grid-template-columns: 7em 1fr;
  align-items: start;
  gap: 0.4rem 1rem;
  font-size: 0.92rem;
}
.info-dl dt { color: #64748b; font-weight: 600; }
.info-dl dd { margin: 0; color: #1e293b; }
.info-th { width: 7em; min-width: 7em; white-space: nowrap; color: #64748b; font-weight: 600; text-align: left; }

.text-muted { color: #94a3b8; font-size: 0.9rem; }

/* リンク */
.link-primary {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}
.link-primary:hover { text-decoration: underline; }

/* バッジ */
.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
}
.badge-info        { background: #dbeafe; color: #1d4ed8; }
.badge-bottle      { background: #ede9fe; color: #6d28d9; }
.badge-danger      { background: #fee2e2; color: #dc2626; }
.badge-warning     { background: #fef3c7; color: #b45309; }
.badge-sale        { background: #dcfce7; color: #15803d; }
.badge-bottle-used { background: #fef3c7; color: #92400e; }

/* 来店カード（日報詳細） */
.visit-list { display: flex; flex-direction: column; gap: 0.75rem; }
.visit-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.visit-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.visit-name {
  font-size: 1rem;
  font-weight: 700;
  color: #1e3a5f;
  text-decoration: none;
}
.visit-name:hover { text-decoration: underline; }
.visit-note {
  margin-top: 0.5rem;
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.6;
}
.visit-used-bottles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}
.visit-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.65rem;
  justify-content: flex-end;
}

/* ボトル選択チェックリスト（トグルピル形式） */
.bottle-check-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fafafa;
}
.bottle-check-hint {
  color: #aaa;
  font-size: 0.82rem;
  margin: 0;
  align-self: center;
  padding: 0 0.25rem;
}
.bottle-check-item {
  display: inline-flex;
  cursor: pointer;
}
.bottle-check-item input[type="checkbox"] {
  display: none;
}
.bottle-check-item span {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border: 1.5px solid #d97706;
  border-radius: 99px;
  color: #92400e;
  font-size: 0.82rem;
  font-weight: 600;
  background: #fff;
  transition: background 0.15s, color 0.15s;
  user-select: none;
}
.bottle-check-item input:checked + span {
  background: #d97706;
  color: #fff;
  border-color: #d97706;
}
.bottle-check-item:hover span {
  background: #fef3c7;
}
.bottle-check-item input:checked + span:hover {
  background: #b45309;
  border-color: #b45309;
}

/* ダッシュボードに日報カードを追加した場合用 */
.dash-card.reports { border-left-color: #059669; }

/* ===== プランバッジ ===== */
.plan-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  vertical-align: middle;
}
.plan-badge.plan-free  { background: #e2e8f0; color: #475569; }
.plan-badge.plan-light { background: #dbeafe; color: #1d4ed8; }
.plan-badge.plan-rich  { background: #fef3c7; color: #92400e; }

/* ===== プランバナー（ダッシュボード） ===== */
.plan-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  flex-wrap: wrap;
}
.plan-banner-free  { border-color: #cbd5e1; }
.plan-banner-light { border-color: #93c5fd; background: #eff6ff; }
.plan-banner-rich  { border-color: #fcd34d; background: #fffbeb; }
.plan-banner-left    { display: flex; align-items: center; gap: 0.6rem; }
.plan-banner-right   { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.plan-banner-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.plan-banner-name    { font-size: 0.9rem; font-weight: 600; color: #374151; }

/* ===== 使用量バー ===== */
.usage-bar {
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  min-width: 80px;
}
.usage-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: #2563eb;
  transition: width 0.3s;
}
.usage-bar-fill.warning { background: #f59e0b; }
.usage-bar-fill.danger  { background: #dc2626; }

.usage-wrap { display: flex; flex-direction: column; gap: 3px; }

.usage-text         { font-size: 0.85rem; color: #374151; white-space: nowrap; }
.usage-text.usage-warning { color: #b45309; font-weight: 600; }
.usage-text.usage-danger  { color: #dc2626; font-weight: 700; }

.plan-upgrade-hint {
  font-size: 0.78rem;
  color: #b45309;
  white-space: nowrap;
}

/* ===== form-select（selectボックス共通） ===== */
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
  cursor: pointer;
}

/* ===== 法的ページ ===== */
.legal-page {
  max-width: 800px;
  margin: 2rem auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 2rem 2.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.legal-page > h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e3a5f;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e2e8f0;
}
.legal-page > p:first-of-type {
  color: #475569;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}
.legal-section {
  margin-bottom: 1.75rem;
}
.legal-section h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e3a5f;
  margin-bottom: 0.6rem;
  padding-left: 0.6rem;
  border-left: 3px solid #2563eb;
}
.legal-section h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #374151;
  margin: 0.75rem 0 0.4rem;
}
.legal-section p {
  color: #374151;
  line-height: 1.75;
  margin-bottom: 0.5rem;
}
.legal-list {
  list-style: disc;
  padding-left: 1.5rem;
  color: #374151;
  line-height: 1.8;
}
.legal-list li { margin-bottom: 0.25rem; }
ol.legal-list { list-style: decimal; }
.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin-bottom: 0.5rem;
}
.legal-table th,
.legal-table td {
  padding: 0.65rem 0.9rem;
  border: 1px solid #e2e8f0;
  vertical-align: top;
  line-height: 1.7;
}
.legal-table th {
  background: #f8fafc;
  color: #1e3a5f;
  font-weight: 600;
  white-space: nowrap;
  width: 9rem;
}
.legal-address {
  font-style: normal;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  line-height: 1.9;
}
.legal-address a { color: #2563eb; }
.legal-updated {
  font-size: 0.83rem;
  color: #94a3b8;
  margin-top: 2rem;
  margin-bottom: 1.25rem;
}
.legal-back { margin-top: 0.5rem; }

@media (max-width: 768px) {
  .legal-page {
    margin: 1rem auto;
    padding: 1.25rem 1rem;
    border-radius: 8px;
  }
  .legal-page > h1 {
    font-size: 1.25rem;
  }
  /* テーブルを縦積みに */
  .legal-table thead { display: none; }
  .legal-table,
  .legal-table tbody,
  .legal-table tr,
  .legal-table th,
  .legal-table td {
    display: block;
    width: 100%;
  }
  .legal-table tr { margin-bottom: 0.75rem; border: 1px solid #e2e8f0; border-radius: 6px; overflow: hidden; }
  .legal-table th {
    width: 100%;
    background: #f1f5f9;
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
    border-bottom: none;
    border: none;
  }
  .legal-table td {
    padding: 0.6rem 0.75rem;
    border: none;
  }
}

/* ===== サイトフッター ===== */
.site-footer {
  background: #1e3a5f;
  color: #a8c4e0;
  font-size: 0.85rem;
  padding: 1.25rem 1.5rem;
  margin-top: 3rem;
}
.site-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.footer-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.footer-links a {
  color: #a8c4e0;
  text-decoration: none;
  transition: color 0.15s;
}
.footer-links a:hover { color: #fff; }

/* ===== 写真 UI ===== */

/* 顧客一覧：小サムネイル */
.customer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.customer-avatar-placeholder {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e2e8f0;
}

/* 顧客詳細：プロフィール写真 */
.customer-profile-photo {
  width: 120px;
  height: 120px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  flex-shrink: 0;
}

/* 写真アップロードフォーム */
.file-input {
  display: block;
  font-size: 0.88rem;
  color: #475569;
  cursor: pointer;
}
.photo-preview-img {
  display: block;
  max-width: 200px;
  max-height: 200px;
  border-radius: 8px;
  object-fit: cover;
  margin-bottom: 0.4rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.photo-delete-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: #dc2626;
  cursor: pointer;
  margin-bottom: 0.5rem;
}
.form-hint {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 0.3rem;
}

/* 来店記録写真エリア */
.visit-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0 0.25rem;
  align-items: center;
}
.visit-photo-item {
  position: relative;
  display: inline-block;
}
.visit-photo-thumb-link { display: block; }
.visit-photo-thumb {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  transition: opacity 0.15s;
}
.visit-photo-thumb:hover { opacity: 0.85; }
.visit-photo-del {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #dc2626;
  color: #fff;
  border: none;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.btn-icon { /* 汎用アイコンボタン */ }
.visit-photo-add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 6px;
  border: 2px dashed #cbd5e1;
  color: #94a3b8;
  font-size: 1.4rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}
.visit-photo-add:hover { border-color: #2563eb; color: #2563eb; }

/* 来店履歴（顧客詳細）のサムネイル帯 */
.visit-photo-strip {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  flex-wrap: wrap;
}
.visit-photo-more {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 600;
}

