
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  color: #404040;
  background: #f8f7f7;
}
header {
  background: #fff;
  color: #404040;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 3px solid #eb6120;
}
header .brand { font-weight: 700; color: #eb6120; font-size: 16px; }
header nav { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; }
/* PCのグローバルナビは当初のテキストリンク型(W20改2)。ボタン見た目はスマホの
   ハンバーガーメニュー内(下のメディアクエリ)のみに適用する */
header nav a { color: #404040; text-decoration: none; font-size: 14px; white-space: nowrap; }
header nav a:hover { color: #eb6120; }
/* ハンバーガー(W20): デスクトップではメニュー機構自体が無いため、
   チェックボックスもフォーカス対象から外す(display:none)。スマホ側で上書きする */
.nav-toggle { display: none; }
.nav-burger { display: none; }
header form { margin: 0; }
header button {
  background: transparent;
  border: 1px solid #eb6120;
  color: #eb6120;
  padding: 5px 14px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
}
header button:hover { background: #fdefe7; }
main { max-width: 1200px; margin: 24px auto; padding: 0 16px; }
h1 { font-size: 20px; color: #404040; }
h2 {
  font-size: 15px;
  margin-top: 32px;
  color: #404040;
  border-left: 4px solid #eb6120;
  padding-left: 10px;
}
a { color: #eb6120; }
.card {
  background: #fff;
  border: 1px solid #eaeaea;
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 16px;
}
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid #f1f1f1; font-size: 14px; }
th { width: 160px; color: #92897c; font-weight: normal; vertical-align: top; }
label { display: block; margin: 14px 0 4px; font-size: 14px; color: #404040; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"],
select, textarea {
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 7px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}
input[type="text"], input[type="email"], input[type="password"], input[type="url"] {
  width: 100%;
  max-width: 480px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #f5b894; border-color: #eb6120; }
input[type="checkbox"] { accent-color: #eb6120; width: 16px; height: 16px; }
.coupon-img { display: block; max-width: 360px; width: 100%; border-radius: 7px; margin: 8px 0; }
/* データ一覧テーブル共通: 長文列(AI文案等)以外は原則改行させない */
/* 回答一覧は長文列に割合幅を効かせるためfixed。店舗一覧は1行表示の内容に合わせて
   列幅が自動で広がるようautoにする(fixed+nowrapは列幅を超えた文字が隣セルへはみ出す) */
.responses-table { table-layout: fixed; }
.stores-table { table-layout: auto; }
.responses-table th, .stores-table th { width: auto; white-space: nowrap; }
.responses-table td, .stores-table td { vertical-align: top; }

/* 回答一覧: 長文列(回答内容・メッセージ・AI文案)だけ折り返し、他は1行表示 */
.responses-table th:nth-child(1) { width: 128px; } /* 日時 */
.responses-table th:nth-child(2) { width: 110px; } /* お名前 */
.responses-table th:nth-child(3) { width: 22%; }   /* 回答内容 */
.responses-table th:nth-child(4) { width: 13%; }   /* メッセージ */
.responses-table th:nth-child(5) { width: 36%; }   /* AI文案 */
.responses-table th:nth-child(6) { width: 96px; }  /* HP掲載同意 */
.responses-table th:nth-child(7) { width: 110px; } /* 状態 */
.responses-table td { overflow-wrap: break-word; }
.responses-table td:nth-child(1),
.responses-table td:nth-child(2),
.responses-table td:nth-child(6),
.responses-table td:nth-child(7) { white-space: nowrap; }

/* 本部の店舗一覧(利用状況): 店舗名以外は1行表示(日時・数値・ボタンを折り返さない)。
   autoレイアウトのため各列は内容幅で確保され、残り幅は店舗名列が受ける */
.stores-table td { white-space: nowrap; }
.stores-table td:first-child {
  white-space: normal;
  overflow-wrap: break-word;
  min-width: 180px;
}
/* 万一列合計がカード幅を超えた場合も、はみ出さず横スクロールに収める保険 */
.table-scroll { overflow-x: auto; }
/* 本部の店舗一覧: 利用率カード・絞り込みタブ・検索フォーム・ページ送り */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid #eaeaea; border-radius: 8px; padding: 14px 16px; }
.kpi-label { font-size: 13px; color: #92897c; }
.kpi-value { font-size: 26px; font-weight: 700; color: #404040; margin: 2px 0; }
.list-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.list-tabs a {
  padding: 6px 12px;
  border: 1px solid #e0d3c1;
  border-radius: 16px;
  font-size: 13px;
  text-decoration: none;
  color: #404040;
  background: #faf7f2;
}
.list-tabs a.current { background: #eb6120; border-color: #eb6120; color: #fff; }
.list-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.list-filter input[type="text"] { width: 240px; }
.list-filter .btn { margin-top: 0; padding: 8px 20px; }
.pager { display: flex; gap: 16px; justify-content: center; align-items: center; margin-top: 12px; }
/* 行の高さを抑えるため、一覧内の操作ボタン(パスワード再発行)だけ小さくする */
.stores-table td form { margin: 0; }
.stores-table .btn { margin-top: 4px; padding: 4px 12px; font-size: 12px; font-weight: normal; }
.btn {
  display: inline-block;
  margin-top: 20px;
  background: #eb6120;
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 10px 26px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.btn:hover { background: #d4551a; }
/* 無効化されたボタン(設問数の上限到達など): 押せないことが見た目で分かるようにする */
.btn:disabled { background: #c9c2b8; color: #f5f2ec; cursor: not-allowed; }
.btn:disabled:hover { background: #c9c2b8; }
/* 「設問を追加」と「設問を保存」の帯が密着しないよう間隔を空ける */
#add-question-btn { margin-right: 14px; }
/* 設問編集の選択肢入力枠(W16): 個別入力を縦に並べる */
.choice-row { margin: 4px 0; }
.choice-row .text-input { width: 100%; max-width: 480px; padding: 8px 10px; border: 1px solid #d9d2c7; border-radius: 6px; font-size: 14px; }
.errors { background: #fdecea; border: 1px solid #e8b4ae; border-radius: 7px; padding: 12px 16px; }
.errors p { margin: 4px 0; color: #a94442; font-size: 14px; }
.notice {
  background: #f3ece3;
  border: 1px solid #e0d3c1;
  border-radius: 7px;
  padding: 12px 16px;
  color: #6b5b45;
  font-size: 14px;
}
.muted { color: #92897c; font-size: 13px; }
.login-wrap { max-width: 400px; margin: 80px auto; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; }
.badge.on { background: #fdefe7; color: #c2410c; }
.badge.off { background: #f1f1f1; color: #92897c; }
/* QRコード: 画面幅に収める(スマホでお客様に提示する使い方を想定) */
#qr-holder svg { max-width: 100%; height: auto; }

/* ---- スマホ対応(W18): 営業先でスマホから管理画面を開きQRを提示する利用を想定 ---- */
@media (max-width: 640px) {
  header {
    padding: 10px 12px;
    gap: 10px;
    flex-wrap: wrap;
  }
  /* スマホはハンバーガーメニュー(W20)。checkbox(:checked)で開閉し、開くと全幅の縦メニュー。
     チェックボックスは「視覚的に隠すがフォーカス可能」にしてキーボード(Tab+Space)でも
     開閉できるようにする(WCAG 2.1.1)。フォーカス時はバーガーボタンに枠を表示する */
  /* input[type="checkbox"]のグローバル指定(16px)より詳細度を上げて1pxの視覚非表示にする */
  input[type="checkbox"].nav-toggle {
    display: block;
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .nav-toggle:focus-visible ~ .nav-burger {
    outline: 2px solid #c2410c;
    outline-offset: 2px;
  }
  .nav-burger {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    border: 1px solid #e0d3c1;
    border-radius: 7px;
    background: #faf7f2;
    color: #c2410c; /* #eb6120は#faf7f2上で3.14:1のため、4.5:1を満たす既存色に(WCAG G18) */
    padding: 7px 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
  }
  .burger-close { display: none; }
  .nav-toggle:checked ~ .nav-burger .burger-open { display: none; }
  .nav-toggle:checked ~ .nav-burger .burger-close { display: inline; }
  header nav { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 8px; padding-top: 4px; }
  .nav-toggle:checked ~ nav { display: flex; }
  /* メニュー内の項目はボタン見た目(PCのテキストリンク型とは独立) */
  header nav a {
    font-size: 14px;
    padding: 10px;
    text-align: center;
    border: 1px solid #e0d3c1;
    border-radius: 7px;
    background: #faf7f2;
  }
  header nav a:hover { color: #fff; background: #eb6120; border-color: #eb6120; }
  header nav form { width: 100%; }
  header nav form button { width: 100%; padding: 10px; font-size: 14px; }
  main { margin: 12px auto; padding: 0 10px; }
  h1 { font-size: 18px; }
  .card { padding: 14px 12px; overflow-x: auto; } /* 幅の広い表はカード内で横スクロール */
  th { width: 110px; }
  th, td { padding: 6px 8px; font-size: 13px; }
  input[type="text"], input[type="email"], input[type="password"], input[type="url"],
  select, textarea, .choice-row .text-input { max-width: 100%; width: 100%; }
  /* 長いURL・トークン・パスワード等の連続文字列を枠内で折り返す(QRページの回答URL・
     店舗情報のURL・初期パスワード表示などのはみ出し対策) */
  td, code, .card p, .card a { overflow-wrap: anywhere; }
  .btn { width: 100%; text-align: center; padding: 12px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .kpi { padding: 10px 12px; }
  .kpi-value { font-size: 22px; }
  .list-filter .btn { padding: 12px; }
  .list-filter input[type="text"] { width: 100%; }
  #add-question-btn { margin-right: 0; margin-bottom: 10px; }
  .login-wrap { margin: 32px auto; padding: 0 8px; }
}
