/* =========================================================
   Map AI Scan — GBP AI診断ツール  ／  ライトテーマ・印刷対応
   ========================================================= */

:root {
  /* surfaces */
  --bg: #f8f9fa;
  --surface: #ffffff;
  --surface-alt: #f3f5f7;
  --border: #e5e7eb;
  --border-strong: #d1d5db;

  /* text */
  --text: #1a1a1a;
  --text-body: #333333;
  --text-muted: #6b7280;
  --text-faint: #9099a5;

  /* brand */
  --navy: #143a5a;
  --navy-deep: #0e2a44;
  --teal: #0d8f8f;
  --teal-deep: #0a6f70;
  --teal-tint: #e5f3f3;

  /* score / grade tiers (すべて白地で AA 以上) */
  --tier-high: #0a6f60;   /* ◎ 優秀   */
  --tier-good: #1f6bb0;   /* ○ 良好   */
  --tier-warn: #b45309;   /* △ 要改善 */
  --tier-crit: #b91c1c;   /* × 要対応 */
  --tier-na:   #6b7280;   /* —        */

  --measure: 42rem;       /* 本文の最大行長 */
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 32px -16px rgba(16, 24, 40, 0.12);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial,
    "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
  --font-eyebrow: ui-sans-serif, system-ui, var(--font);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-body);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  color: var(--text);
  line-height: 1.4;
  font-weight: 700;
  margin: 0;
}

a { color: var(--teal-deep); }
a:hover { color: var(--navy); }

/* ---------- layout ---------- */
.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 44px 24px 112px;
  display: flex;
  flex-direction: column;
  gap: 44px;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.site-header > * { max-width: 860px; margin: 0 auto; }
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand__logo { height: 40px; width: auto; display: block; }
.brand__text { display: flex; flex-direction: column; gap: 2px; line-height: 1.3; }
.brand__title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.brand__text strong {
  font-family: var(--font-eyebrow);
  letter-spacing: 0.16em;
  font-size: 1.1rem;
  color: var(--navy);
}
.brand__catch {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--teal-deep);
  background: var(--surface-alt);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.brand__sub { font-size: 0.8rem; color: var(--text-muted); }
.site-header__link {
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--navy);
  border: 1px solid var(--border-strong);
  padding: 9px 18px;
  border-radius: 999px;
  transition: background 0.15s;
}
.site-header__link:hover { background: var(--surface-alt); }

/* ---------- panels ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 44px;
  box-shadow: var(--shadow);
}
.panel__label {
  font-family: var(--font-eyebrow);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--teal-deep);
  margin-bottom: 24px;
}

.panel__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.location-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.location-switch[hidden] { display: none; }
.location-switch select {
  font: inherit;
  font-size: 0.9rem;
  padding: 7px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.csv-box {
  border: 1px solid var(--border);
  border-left: 4px solid var(--teal);
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 24px;
  background: var(--teal-tint);
}
.csv-box__head { display: flex; gap: 14px; align-items: flex-start; }
.csv-box__icon { font-size: 1.4rem; line-height: 1; flex: 0 0 auto; }
.csv-box__label { font-weight: 700; font-size: 0.98rem; color: var(--navy); }
.csv-box__desc {
  margin: 6px 0 0;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: var(--measure);
}
.csv-box__drop {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 11px 20px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--navy);
  max-width: 100%;
}
.csv-box__drop:hover { border-color: var(--teal); }
.csv-box__drop::before { content: "📁"; font-size: 0.95rem; }
/* ネイティブ file input は視覚的に隠す（label クリックで発火） */
.csv-box__drop input[type="file"] {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.csv-box__files {
  margin: 12px 0 0;
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--text-body);
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}
.csv-box__files span {
  display: inline-block;
  max-width: 100%;
  padding: 2px 10px;
  margin: 2px 6px 2px 0;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  vertical-align: middle;
}
.csv-box__help {
  margin: 12px 0 0;
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: var(--measure);
}
.csv-box__help a { color: var(--teal-deep); font-weight: 600; }
.csv-box__note {
  margin: 14px 0 0;
  font-size: 0.86rem;
  line-height: 1.7;
  color: var(--text-muted);
  overflow-wrap: anywhere;
  max-width: 100%;
}
.csv-box__note--ok { color: var(--tier-high); font-weight: 600; }
.csv-box__note--err { color: var(--tier-crit); font-weight: 600; }

/* PDF ボタン */
.pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.pdf-btn:hover { background: var(--surface-alt); border-color: var(--navy); }

/* インサイト数値カード */
.insight-cards { display: grid; gap: 20px; margin-bottom: 8px; }
.insight-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 24px;
}
.insight-card h4 {
  font-size: 1rem;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.insight-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.insight-table th,
.insight-table td { padding: 9px 4px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.insight-table tbody tr:last-child th,
.insight-table tbody tr:last-child td { border-bottom: none; }
.insight-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
}
.insight-table tr.is-total th,
.insight-table tr.is-total td { font-weight: 700; border-top: 2px solid var(--border-strong); }
.insight-table .desc { font-size: 0.82rem; color: var(--text-muted); line-height: 1.6; font-weight: 400; }
.insight-table thead th {
  font-size: 0.76rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  border-bottom: 1.5px solid var(--border-strong);
}
.insight-table th.num, .insight-table thead th.num { text-align: right; }
.insight-table td.guide, .insight-table th.guide {
  text-align: right;
  font-size: 0.84rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.insight-table--rates th:first-child { padding-right: 14px; }
.insights__ai-heading {
  font-size: 1rem;
  font-weight: 700;
  margin: 4px 0 4px;
  color: var(--text);
}

/* insights result section (AI所感) */
.insights { display: grid; gap: 22px; }
.insights__block h4 { font-size: 0.98rem; margin-bottom: 8px; color: var(--text); }
.insights__block p {
  margin: 0 0 6px;
  font-size: 0.94rem;
  line-height: 1.85;
  color: var(--text-body);
  max-width: var(--measure);
}
.insights__rate {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--navy);
  margin-right: 8px;
}

.reveal { opacity: 1; }
.js-anim .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js-anim .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js-anim .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- store ---------- */
.store-status {
  margin: 4px 0;
  padding: 24px 0;
  color: var(--text-muted);
}
.store-status--error { color: var(--tier-crit); }

.store__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}
.store__head-left { flex: 1 1 320px; min-width: 0; }
.store__name {
  font-size: clamp(1.6rem, 4vw, 2.15rem);
  letter-spacing: -0.01em;
  margin: 0 0 14px;
}
.store__tags-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
}
.google-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.google-link:hover {
  color: var(--navy);
  border-color: var(--border-strong);
  background: var(--surface-alt);
}
.google-link svg { flex: 0 0 auto; }
.store__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 0.82rem;
  line-height: 1.5;
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  background: var(--surface);
}
.chip--accent {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
  font-weight: 600;
}
.chip--warn {
  border-color: var(--tier-crit);
  color: var(--tier-crit);
  background: #fdecec;
  font-weight: 600;
}

.rating {
  text-align: center;
  min-width: 128px;
  padding: 4px 8px;
}
.rating__score {
  font-size: 3.25rem;
  font-weight: 800;
  line-height: 1;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.rating__stars { font-size: 1.05rem; letter-spacing: 3px; color: #d99a00; margin: 8px 0 4px; }
.rating__count { font-size: 0.85rem; color: var(--text-muted); }

.store__meta {
  margin-top: 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
@media (max-width: 560px) {
  .store__meta { grid-template-columns: 1fr; }
}
.meta-item { background: var(--surface); padding: 18px 20px; }
.meta-item--empty { padding: 0; }
.meta-item__k {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.meta-item__v { font-size: 0.98rem; line-height: 1.7; word-break: break-word; color: var(--text); }
.meta-item__v a { word-break: break-all; }
.meta-item__v.is-empty { color: var(--text-faint); }

/* 説明文の行（グリッド全幅） */
.meta-item--desc { grid-column: 1 / -1; }
.desc-text {
  white-space: pre-wrap;
  line-height: 1.8;
  max-width: var(--measure);
}
.desc-text.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.desc-toggle {
  margin-top: 8px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--teal-deep);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.desc-toggle:hover { text-decoration: underline; }

.store__section { margin-top: 44px; }
.store__section-title {
  font-size: 1.15rem;
  margin-bottom: 8px;
}
.muted { color: var(--text-faint); font-weight: 400; font-size: 0.86rem; }
.section-note {
  margin: 0 0 20px;
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.photos {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 10px;
}
.photos img {
  flex: 0 0 auto;
  width: 200px; height: 150px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.reviews { display: flex; flex-direction: column; gap: 18px; }
.review {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 28px;
  background: var(--surface);
}
.review__head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.review__avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: var(--navy);
  text-transform: uppercase;
  overflow: hidden;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.review__avatar img { width: 100%; height: 100%; object-fit: cover; }
.review__author { font-weight: 600; color: var(--text); }
.review__time { font-size: 0.8rem; color: var(--text-faint); margin-left: auto; }
.review__stars { color: #d99a00; font-size: 0.9rem; letter-spacing: 1px; margin-bottom: 8px; }
.review__text {
  font-size: 0.96rem;
  line-height: 1.9;
  color: var(--text-body);
  max-width: var(--measure);
  white-space: pre-wrap;
}

/* ---------- diagnose ---------- */
.diagnose__title { font-size: 1.5rem; margin-bottom: 14px; }
.diagnose__lead {
  color: var(--text-body);
  max-width: var(--measure);
  margin: 0 0 28px;
}

.context {
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 28px;
  background: var(--surface-alt);
}
.context summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  color: var(--navy);
}
.context__grid { padding: 8px 20px 22px; display: grid; gap: 18px; }
.context__grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--text-muted);
}
.context__grid input {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 11px 14px;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
}
.context__grid input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-tint);
}

.btn {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 18px 28px;
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  background: var(--navy);
  cursor: pointer;
  position: relative;
  transition: background 0.15s, transform 0.1s;
}
.btn:hover:not(:disabled) { background: var(--navy-deep); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { background: var(--border-strong); color: #fff; cursor: not-allowed; }
.btn.is-loading { color: transparent; pointer-events: none; }
.btn__spinner {
  position: absolute; inset: 0; margin: auto;
  width: 20px; height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
}
.btn.is-loading .btn__spinner { opacity: 1; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.diagnose__hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 14px 0 0;
  text-align: center;
}

.usage-counter {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 14px;
  text-align: center;
}
.usage-counter--warn {
  color: #8a1c1c;
  font-weight: 600;
}

/* ---------- notice ---------- */
.notice {
  margin-top: 20px;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.7;
}
.notice--error {
  background: #fdecec;
  border: 1px solid #f3c0c0;
  color: #8a1c1c;
}

/* ---------- result ---------- */
.result__top {
  display: flex;
  align-items: center;
  gap: 44px;
  flex-wrap: wrap;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}
.score { position: relative; width: 208px; height: 208px; flex: 0 0 auto; }
.score__ring { transform: rotate(-90deg); }
.score__track { fill: none; stroke: var(--surface-alt); stroke-width: 16; }
.score__value {
  fill: none;
  stroke: var(--navy);
  stroke-width: 16;
  stroke-linecap: round;
  stroke-dasharray: 540.35;
  stroke-dashoffset: 540.35;
  transition: stroke-dashoffset 1.4s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.4s;
}
.score__center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.score__num {
  font-size: 4rem;
  font-weight: 800;
  line-height: 1;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.score__max { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }

.result__summary { flex: 1; min-width: 260px; }
.result__grade {
  display: inline-block;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  padding: 4px 14px;
  border-radius: 999px;
  border: 1.5px solid currentColor;
  margin-bottom: 14px;
}
.result__summary p {
  margin: 0 0 14px;
  max-width: var(--measure);
  color: var(--text-body);
}
.result__meta { font-size: 0.78rem; color: var(--text-faint); }

.result__section { margin-top: 56px; }
.result-disclaimer {
  margin: 40px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 0.76rem;
  line-height: 1.75;
  color: var(--text-muted);
}
.result__h {
  font-size: 1.25rem;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

/* category scores */
.cats { display: flex; flex-direction: column; gap: 22px; }
.cat {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 24px;
}
.cat__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.cat__name { font-size: 1.02rem; font-weight: 600; color: var(--text); }
.cat__score { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.cat__score b { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.cat__grade { font-size: 1.05rem; font-weight: 700; }
.cat__bar {
  height: 10px;
  border-radius: 6px;
  background: var(--surface-alt);
  overflow: hidden;
}
.cat__fill {
  height: 100%;
  width: 0;
  border-radius: 6px;
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.js-anim .cat__fill { width: 0; }
.cat__comment {
  margin: 14px 0 0;
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text-muted);
  max-width: var(--measure);
}

/* priorities */
.priorities { display: flex; flex-direction: column; gap: 20px; }
.priority {
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy);
  border-radius: 12px;
  padding: 28px 30px;
  background: var(--surface);
  opacity: 1;
}
.js-anim .priority { opacity: 0; transform: translateY(12px); }
.priority.is-in { animation: rise 0.5s forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
.priority__head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 12px; }
.priority__rank {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 8px;
  font-weight: 800;
  font-size: 1.05rem;
  color: #fff;
  background: var(--navy);
}
.priority__title { font-size: 1.12rem; line-height: 1.5; }
.priority__why {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.8;
  max-width: var(--measure);
}
.priority__action {
  font-size: 0.96rem;
  line-height: 1.85;
  color: var(--text-body);
  background: var(--teal-tint);
  border-radius: 10px;
  padding: 16px 18px;
  max-width: var(--measure);
}
.priority__k {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--teal-deep);
  margin-bottom: 4px;
}
.priority__impact {
  margin: 14px 0 0;
  font-size: 0.86rem;
  color: var(--text-muted);
  max-width: var(--measure);
}

/* review analysis */
.analysis { display: grid; gap: 24px; }
.analysis__block h4 { font-size: 0.95rem; margin-bottom: 12px; color: var(--text); }
.tags { display: flex; flex-wrap: wrap; gap: 9px; }
.tag {
  font-size: 0.86rem;
  line-height: 1.5;
  padding: 5px 12px;
  border-radius: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-body);
}
.tag--pos { border-color: #a7d9cf; background: #e6f5f1; color: #0a5f52; }
.tag--neg { border-color: #f0c4a8; background: #fbeee3; color: #9a4a16; }
.analysis__notes {
  font-size: 0.9rem;
  line-height: 1.85;
  color: var(--text-muted);
  max-width: var(--measure);
}

/* replies */
.replies { display: flex; flex-direction: column; gap: 18px; }
.reply {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 28px;
}
.reply__meta { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; }
.reply__excerpt {
  font-size: 0.88rem;
  color: var(--text-muted);
  border-left: 2px solid var(--border-strong);
  padding-left: 12px;
  margin-bottom: 14px;
  max-width: var(--measure);
}
.reply__body {
  font-size: 0.98rem;
  line-height: 1.9;
  color: var(--text);
  background: var(--surface-alt);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 12px;
  max-width: var(--measure);
  white-space: pre-wrap;
}
.reply__copy {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--teal-deep);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 7px 16px;
  cursor: pointer;
}
.reply__copy:hover { background: var(--teal-tint); }

/* items */
.items { display: flex; flex-direction: column; gap: 10px; }
.item { border: 1px solid var(--border); border-radius: 10px; }
.item__summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  font-size: 0.96rem;
  list-style: none;
}
.item__summary::-webkit-details-marker { display: none; }
.item__grade { width: 22px; text-align: center; flex: 0 0 auto; font-weight: 700; }
.item__name { font-weight: 600; color: var(--text); }
.item__cat { margin-left: auto; font-size: 0.78rem; color: var(--text-faint); }
.item__body {
  padding: 4px 20px 20px 54px;
  font-size: 0.92rem;
  line-height: 1.85;
  color: var(--text-body);
  max-width: calc(var(--measure) + 54px);
}
.item__body .k {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 12px 0 2px;
}
.item__prio {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid currentColor;
}

/* advice */
.advice { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 14px; }
.advice li { font-size: 0.94rem; line-height: 1.85; color: var(--text-body); max-width: var(--measure); }
.advice li::marker { color: var(--teal); }

/* grade colors */
.g-emerald { color: var(--tier-high); }
.g-sky { color: var(--tier-good); }
.g-amber { color: var(--tier-warn); }
.g-rose { color: var(--tier-crit); }
.g-slate { color: var(--tier-na); }

/* footer */
.site-footer {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 24px 48px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
}

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .panel { padding: 28px 20px; }
  .store__head { flex-direction: column; gap: 20px; }
  .rating { text-align: left; padding: 0; }
  .result__top { gap: 28px; }
  .score { width: 170px; height: 170px; }
  .score__num { font-size: 3rem; }
  .priority, .review, .reply { padding: 22px 20px; }
}

/* ---------- print ---------- */
@media print {
  @page { margin: 12mm; }
  :root { --shadow: none; }
  html, body { background: #fff; color: #000; font-size: 9.5pt; line-height: 1.55; }
  .site-header, .site-footer { border-color: #bbb; }
  .site-header__link,
  #diagnose,
  .btn, .diagnose__hint, .context,
  .reply__copy, .csv-box, .location-switch, .google-link, .pdf-btn, .desc-toggle,
  #store-status { display: none !important; }

  /* 説明文は全文表示（3行クランプ・「…」を解除） */
  .desc-text.is-clamped {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    overflow: visible;
  }

  /* ページ区切りは自動に任せる。パネルには break を一切指定しない。 */
  .wrap { gap: 14px; padding: 8px 0 0; max-width: none; }
  .panel { border: 1px solid #ccc; box-shadow: none; padding: 14px 16px; }
  .panel__label { color: #444; margin-bottom: 10px; }
  .reveal, .js-anim .reveal { opacity: 1 !important; transform: none !important; }
  .js-anim .cat__fill, .cat__fill { width: var(--print-w, 0) !important; }

  /* 余白を詰める */
  .store__head { padding-bottom: 14px; gap: 16px; }
  .store__name { font-size: 1.4rem; margin-bottom: 8px; }
  .store__meta { margin-top: 14px; }
  .meta-item { padding: 8px 12px; }
  .store__section { margin-top: 16px; }
  .store__section-title { font-size: 1rem; margin-bottom: 6px; }
  .reviews { gap: 8px; }
  .review { padding: 10px 14px; }
  .review__text { line-height: 1.55; margin: 0; }
  .result__top { padding-bottom: 16px; gap: 20px; }
  .score { width: 128px; height: 128px; }
  .score__num { font-size: 2rem; }
  .result__section { margin-top: 16px; }
  .result__h { font-size: 1.05rem; margin-bottom: 10px; padding-bottom: 6px; }
  .cats { gap: 8px; }
  .cat { padding: 10px 14px; }
  .cat__comment { margin-top: 6px; }
  .priorities { gap: 8px; }
  .priority { padding: 12px 16px; }
  .priority__why { margin-bottom: 8px; }
  .replies { gap: 8px; }
  .reply { padding: 10px 14px; }
  .reply__body { padding: 8px 12px; margin-bottom: 0; }
  .insight-cards { gap: 10px; margin-bottom: 4px; }
  .insight-card { padding: 12px 16px; }
  .insight-table th, .insight-table td { padding: 5px 4px; }
  .items { gap: 4px; }
  .item__summary { padding: 8px 12px; }
  .result-disclaimer { margin-top: 18px; padding-top: 10px; font-size: 8pt; }
  .advice { gap: 6px; }
  .photos { flex-wrap: wrap; gap: 6px; }
  .photos img { width: 120px; height: 88px; }

  /* 小さめの要素だけページ内で分割を避ける（パネルには付けない） */
  .priority, .review, .reply, .cat, .item, .analysis__block,
  .insight-card, .insight-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  a { color: #000; text-decoration: underline; }
  .chip--accent { background: #fff !important; color: #000 !important; border: 1px solid #000; }
  .score__value, .score__track, .cat__fill, .rating__score, .score__num,
  .priority__rank, .tag, .result__grade {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  details[open] .item__body, .item__body { display: block; }
}

/* ============ 一覧画面（PHP版） ============ */
.store-list { display: grid; gap: 12px; margin-top: 8px; }
.store-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
}
.store-list__item:hover { border-color: var(--navy); background: var(--surface-alt); }
.store-list__name { font-weight: 600; font-size: 1.02rem; }
.store-list__go { font-size: 0.85rem; color: var(--teal-deep); font-weight: 600; white-space: nowrap; }
#all-store-grid th:first-child { text-align: left; }
