/* ミセヨビ — 白地＋濃い文字＋アクセント1色。濃い色で面を塗らない（色は帯・罫線・文字・ボタンだけ）。
   コントラスト（白地に対して）: 本文 #1a1a1a 17:1 / 補足 #52514e 8:1 / アクセント #1c5cab 6.6:1 */
:root {
  --ink: #1a1a1a;
  --ink-2: #52514e;
  --line: #e1e0d9;
  --field-line: #8f8d86;      /* 入力欄の枠（3:1以上） */
  --bg: #ffffff;
  --soft: #f6f6f3;            /* 薄い面（帯・補足） */
  --accent: #1c5cab;
  --accent-soft: #eef4fb;
  --warn-ink: #6b4100;
  --warn-line: #c98a1b;
  --warn-soft: #fff8ea;
  --danger: #b42318;
  --danger-soft: #fdf0ef;
  --ok-ink: #006300;
  --radius: 10px;
  --tap: 48px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: 0.02em;
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
summary:focus-visible, .pt:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
h1 { font-size: 22px; line-height: 1.45; margin: 8px 0 12px; }
h2 { font-size: 18px; line-height: 1.5; margin: 28px 0 10px; }
h3 { font-size: 16px; line-height: 1.5; margin: 0 0 8px; }
p { margin: 0 0 10px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px 48px; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.prewrap { white-space: pre-wrap; }
.url { overflow-wrap: anywhere; word-break: break-all; }
.req { font-size: 12px; color: var(--danger); font-weight: 400; margin-left: 4px; }
[hidden] { display: none !important; }

/* ヘッダー: 白地、上に細いアクセント帯、下に罫線 */
.site-header { border-top: 4px solid var(--accent); border-bottom: 1px solid var(--line); background: var(--bg); margin-bottom: 16px; }
.site-header .wrap { padding-bottom: 0; }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; min-height: 56px; }
.brand { font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; min-height: var(--tap); display: inline-flex; align-items: center; }
.top-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; }
.top-nav a, .nav-btn {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 10px;
  color: var(--accent); text-decoration: none; font: inherit; font-size: 15px;
}
.top-nav form { margin: 0; }
.nav-btn { background: none; border: 0; cursor: pointer; }
.top-nav a:hover, .nav-btn:hover { text-decoration: underline; }

/* 店の見出しとメニュー */
.store-head { margin: 4px 0 8px; }
.store-head h1 { margin: 0; }
.store-kicker { margin: 0; font-size: 14px; color: var(--ink-2); min-height: 1em; }
.tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 8px 0 16px; }
.tabs a {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: var(--tap); padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); text-decoration: none; font-size: 14px; line-height: 1.3; background: var(--bg);
}
.tabs a.current { border-color: var(--accent); border-bottom-width: 3px; color: var(--accent); font-weight: 700; }

/* ボタン */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap); padding: 8px 18px; border: 2px solid var(--accent); border-radius: var(--radius);
  background: var(--accent); color: #fff; font: inherit; font-weight: 700; line-height: 1.4;
  text-decoration: none; cursor: pointer; text-align: center;
}
.btn:hover { background: #174d8f; border-color: #174d8f; }
.btn-secondary { background: var(--bg); color: var(--accent); }
.btn-secondary:hover { background: var(--accent-soft); color: var(--accent); }
.btn-danger { background: var(--bg); color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-block { display: flex; width: 100%; }
.btn-small { min-height: var(--tap); padding: 4px 12px; font-size: 14px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row-actions form { margin: 0; }

/* カード・お知らせ */
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 16px; background: var(--bg); }
.card.narrow { max-width: 480px; margin: 24px auto; }
.card.empty { background: var(--soft); }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.page-head h1, .page-head h2 { margin: 8px 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.section-head h2 { margin: 0; }
.notice { padding: 12px 14px; border-radius: 8px; border-left: 4px solid var(--accent); background: var(--accent-soft); margin: 0 0 16px; }
.notice-error { border-left-color: var(--danger); background: var(--danger-soft); color: #7a1a12; }
.notice-warn { border-left-color: var(--warn-line); background: var(--warn-soft); color: var(--warn-ink); }
.next-step { padding: 10px 12px; background: var(--soft); border-radius: 8px; }
.badge, .status-pill, .flag {
  display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 13px; line-height: 1.7; font-weight: 700;
  border: 1px solid currentColor; white-space: nowrap;
}
.badge { color: var(--warn-ink); background: var(--warn-soft); }
.status-pill { color: var(--ink-2); background: var(--bg); font-weight: 400; }
.flag { color: var(--danger); background: var(--danger-soft); }

/* フォーム */
.form .field, .field { display: block; margin: 0 0 16px; }
.field-label { display: block; font-weight: 700; margin-bottom: 4px; }
.field-label.small { font-weight: 400; font-size: 14px; color: var(--ink-2); }
.hint { display: block; font-size: 13px; color: var(--ink-2); margin-top: 4px; line-height: 1.6; }
input[type="text"], input[type="url"], input[type="email"], input[type="date"], select, textarea {
  display: block; width: 100%; min-height: var(--tap); padding: 10px 12px;
  border: 1px solid var(--field-line); border-radius: 8px; background: var(--bg);
  font: inherit; font-size: 16px; color: var(--ink);
}
textarea { resize: vertical; line-height: 1.7; }
textarea.prompt { font-size: 14px; background: var(--soft); }
fieldset.group { border: 0; padding: 0; margin: 0 0 8px; min-width: 0; }
fieldset.card.group { border: 1px solid var(--line); padding: 16px; margin-bottom: 16px; }
legend { font-weight: 700; font-size: 17px; padding: 0; margin-bottom: 8px; }
.field-inline { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 9.5em); gap: 8px; align-items: center; }
.field-inline .field-label { margin: 0; font-weight: 400; line-height: 1.5; }
.input-unit { display: flex; align-items: center; gap: 6px; }
.input-unit input { text-align: right; }
.input-unit .unit { min-width: 1.2em; color: var(--ink-2); font-size: 14px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.inline-form .field { flex: 1 1 12em; margin: 0; }

/* 選択肢（ラジオ）: 押せる範囲は48px以上 */
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 4px 0 8px; }
.choices-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.choice { position: relative; display: block; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span {
  display: flex; align-items: center; justify-content: center; text-align: center; min-height: var(--tap);
  padding: 4px 6px; border: 1px solid var(--field-line); border-radius: 8px; font-size: 15px; line-height: 1.3; cursor: pointer;
}
.choice input:checked + span { border: 2px solid var(--accent); color: var(--accent); font-weight: 700; background: var(--accent-soft); }
.choice input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.diag-item, .priority { padding: 12px 0; border-top: 1px solid var(--line); }
.diag-item:first-of-type, .priority:first-of-type { border-top: 0; padding-top: 0; }
.diag-label { font-weight: 700; margin: 0 0 4px; }

/* 一覧 */
.plain-list, .store-list, .history, .hits, .diag-results { list-style: none; margin: 0; padding: 0; }
.store-row a {
  display: block; padding: 14px 16px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none; min-height: var(--tap);
}
.store-row.is-stale a { border-left: 4px solid var(--danger); }
.store-row-name { display: block; font-weight: 700; color: var(--accent); }
.store-row-meta { display: block; font-size: 14px; color: var(--ink-2); }
.row-link { display: block; color: var(--ink); text-decoration: none; min-height: var(--tap); }
.row-link strong { display: block; color: var(--accent); }
.history-item { padding: 12px 14px; }
.history-values { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 14px; }
.kv { white-space: nowrap; }
/* F13 取得元「連携」の印（文字と罫線だけ。面を塗らない） */
.src-api { display: inline-block; padding: 0 6px; border: 1px solid var(--accent); border-radius: 4px; color: var(--accent); font-size: 12px; font-weight: 400; line-height: 1.5; vertical-align: 1px; }
.ig-card .ig-title { margin: 0 0 4px; font-size: 17px; }
.ig-card form { margin: 8px 0 0; }
.ig-items { margin: 4px 0; padding-left: 1.2em; }
.notice-title { margin: 0; font-weight: 700; }
.notice p { margin: 4px 0 0; }
.member { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; }
.member form { margin: 0; }
.user-card.is-inactive { background: var(--soft); }
.rules-list { margin: 0; padding-left: 1.2em; }
.rules-list li { margin-bottom: 6px; }

/* 次の一手 */
.hits li { padding: 12px 0 12px 14px; border-left: 3px solid var(--accent); margin-bottom: 10px; }
.hit-msg { margin: 0 0 4px; font-weight: 700; }
.hit-evidence { margin: 0; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* 数字のタイル */
.group-title { font-size: 15px; color: var(--ink-2); margin: 12px 0 8px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.tile { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; min-width: 0; }
.tile-label { font-size: 13px; color: var(--ink-2); margin: 0 0 2px; line-height: 1.5; }
.tile-value { font-size: 26px; font-weight: 700; margin: 0; line-height: 1.3; }
.tile-value .unit { font-size: 14px; font-weight: 400; color: var(--ink-2); margin-left: 2px; }
.tile-empty { color: var(--ink-2); }
.tile-diff { font-size: 13px; color: var(--ink-2); margin: 2px 0 0; line-height: 1.5; }

/* グラフ */
.chart { margin: 0 0 16px; }
.chart-title { font-weight: 700; margin-bottom: 6px; }
.chart-wrap { position: relative; }
.chart-svg { display: block; width: 100%; height: auto; overflow: hidden; touch-action: pan-y; }
.chart-svg .tnum { font-variant-numeric: tabular-nums; }
.pt { cursor: pointer; }
.pt:focus { outline: none; }
.chart-tip {
  position: absolute; top: 0; left: 0; pointer-events: none; z-index: 2;
  padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); white-space: nowrap; font-size: 14px; line-height: 1.5;
}
.chart-tip strong { display: block; font-size: 16px; }
.chart-empty { margin: 0; padding: 16px; background: var(--soft); border-radius: 8px; color: var(--ink-2); }
details summary { min-height: var(--tap); display: flex; align-items: center; cursor: pointer; color: var(--accent); }
.simple-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.simple-table th, .simple-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.simple-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.simple-table caption { text-align: left; padding: 0 0 4px; }

/* F15 置き場所ごとのQR */
.table-wrap { overflow-x: auto; margin: 0 0 16px; }
.place-list { list-style: none; margin: 0 0 16px; padding: 0; }
.place-item { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--line); }
.place-item form { margin: 0; }
.place-name { flex: 1 1 10em; overflow-wrap: anywhere; }
[data-place-table] td { overflow-wrap: anywhere; }
[data-place-table] th.num { white-space: nowrap; width: 1%; }
.print-place-form { margin: 0 0 16px; }

/* 診断の結果 */
.diag-result { padding: 10px 0; border-top: 1px solid var(--line); }
.diag-result:first-child { border-top: 0; }
.diag-result.status-ng .status-pill { color: var(--danger); }
.diag-result.status-ok .status-pill { color: var(--ok-ink); }
.changed { font-size: 13px; color: var(--warn-ink); margin-left: 6px; }
.memo { font-size: 14px; color: var(--ink-2); margin: 4px 0 0; }

/* 返信の下書き */
.memo-card { border-left: 4px solid var(--warn-line); }
.memo-card ol { margin: 0; padding-left: 1.3em; }
.memo-card li { margin-bottom: 6px; }
.copy-status { min-height: 1.6em; margin: 8px 0 0; }

/* 口コミ案内のQR */
.qr-small { width: 160px; max-width: 50%; margin: 0 0 8px; }
.qr-small svg, .qr-big svg { display: block; width: 100%; height: auto; }
.url-box { padding: 8px 12px; background: var(--soft); border-radius: 8px; font-size: 14px; }
.print-sheet { text-align: center; padding: 16px 0; }
.print-store { font-size: 24px; font-weight: 700; margin: 0 0 4px; }
.print-lead { font-size: 18px; margin: 0 0 16px; }
.qr-big { width: min(80vw, 12cm); margin: 0 auto 16px; }
.print-note { color: var(--ink-2); }

/* 感想・クーポン（F8） */
.input-short { max-width: 9em; }
.feedback-list { margin-top: 12px; }
.feedback.is-unread { border-left: 4px solid var(--accent); }
.feedback-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
.feedback-body { margin: 0 0 10px; }
.badge-new { color: var(--accent); background: var(--accent-soft); }
.dash-note { margin: 0 0 12px; }

/* 口コミ案内の設定（F10 質問の型・F11 公開URLの作り直し） */
.renew-confirm { border-left: 4px solid var(--danger); }
.lang-list { margin: 0 0 8px; padding-left: 1.2em; }

/* 操作記録（F12） */
.audit-list { list-style: none; margin: 0; padding: 0; }
.audit-item { padding: 10px 0; border-top: 1px solid var(--line); }
.audit-item:first-child { border-top: 0; }
.audit-item p { margin: 0; }
.audit-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.audit-store { font-weight: 700; color: var(--ink); }
.audit-what { font-weight: 700; }
.audit-target { font-size: 14px; }
.audit-who { font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }

@media (min-width: 640px) {
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .choices { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
@media print {
  .no-print, .site-header { display: none !important; }
  body { font-size: 12pt; }
  .print-sheet { padding-top: 2cm; }
  .print-note { color: #000; }
}
