/* 市区町村を比べる（/hikaku/）専用。共通部品は /css/guide.css。
   白＋罫線＋アクセント文字色（濃い色の背景パネル・影は使わない） */

.hk-nowrap { display: inline-block; }

/* ---- 選ぶ ---- */
.hk-pick { margin: 32px 0 0; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.guide .hk-pick-title { margin: 0 0 12px; font-size: 16px; line-height: 1.5; }
.hk-pick-title small { margin-left: 4px; font-size: 13px; font-weight: 400; color: var(--ink-2); }

.hk-chips { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.hk-chips:empty { display: none; }
.hk-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 4px 0 14px;
  background: var(--accent-bg); border: 1px solid var(--accent); border-radius: 6px;
  font-size: 15px; font-weight: 700; color: var(--accent-ink); line-height: 1.2;
}
.hk-chip-pref { font-size: 11.5px; font-weight: 700; color: var(--ink-2); }
.hk-chip-x {
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
  width: 44px; height: 44px; margin: -1px 0; padding: 0; border: 0; background: transparent;
  font: inherit; font-size: 18px; color: var(--accent-ink); cursor: pointer; border-radius: 6px;
  transition: transform .12s ease, background-color .18s ease;
}
.hk-chip-x:hover { background: rgba(0, 0, 0, .05); }
.hk-chip-x:active { transform: scale(.9); }
.hk-chip-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 4px var(--accent-bg); }
.hk-chip.is-new { animation: hk-pop .32s cubic-bezier(.2, .8, .2, 1) both; }

.hk-search { position: relative; }
.hk-search[hidden] { display: none; }
.hk-search-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.hk-input {
  width: 100%; min-height: 48px; padding: 10px 12px; box-sizing: border-box;
  font: inherit; font-size: 16px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 4px;
}
.hk-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 4px var(--accent-bg); border-color: var(--accent); }
.hk-suggest {
  list-style: none; margin: 4px 0 0; padding: 4px 0; position: absolute; left: 0; right: 0; z-index: 20;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; max-height: 320px; overflow-y: auto;
}
.hk-suggest-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 0 14px;
  font-size: 15px; cursor: pointer;
}
.hk-suggest-item small { font-size: 12px; color: var(--ink-2); }
.hk-suggest-item.is-active, .hk-suggest-item:hover { background: var(--accent-bg); color: var(--accent-ink); }
.hk-suggest-empty { padding: 12px 14px; font-size: 14px; color: var(--ink-2); }
.guide .hk-hint { margin: 10px 0 0; font-size: 13px; line-height: 1.7; color: var(--ink-2); }

/* ---- 結果 ---- */
.hk-result { margin-top: 28px; scroll-margin-top: 96px; }
.hk-result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.guide .hk-result-title { margin: 0; font-size: 20px; }
.hk-share {
  display: inline-flex; align-items: center; justify-content: center; line-height: 1.2;
  min-height: 44px; padding: 0 16px; font: inherit; font-size: 14px; font-weight: 700;
  color: var(--accent-ink); background: var(--surface); border: 1px solid var(--accent); border-radius: 6px; cursor: pointer;
  transition: transform .12s ease, background-color .18s ease;
}
.hk-share:hover { background: var(--accent-bg); }
.hk-share:active { transform: scale(.96); }
.hk-share:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 4px var(--accent-bg); }
.guide .hk-share-done { margin: 8px 0 0; font-size: 13px; color: var(--ink-2); word-break: break-all; }

/* 比べる表：スマホは「項目名の行」＋「市ごとの値を横に並べた行」、PCは左に項目名の列 */
.hk-grid { margin-top: 14px; border-top: 1px solid var(--line); }
.hk-row {
  display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); column-gap: 8px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.hk-label {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
  font-size: 12.5px; font-weight: 700; color: var(--ink-2); line-height: 1.5;
}
.hk-row-head .hk-label { display: none; }
.hk-cell { min-width: 0; font-size: 14.5px; line-height: 1.55; font-weight: 700; color: var(--ink); word-break: auto-phrase; overflow-wrap: anywhere; }
.hk-row.is-diff .hk-cell { color: var(--accent-ink); }
.hk-diff {
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
  padding: 3px 7px; border-radius: 4px; background: var(--accent-bg); color: var(--accent-ink); font-size: 11px; font-weight: 700;
}
.hk-city a { display: block; font-size: 15.5px; font-weight: 700; color: var(--ink); text-decoration: none; }
.hk-city a:hover { color: var(--accent-ink); text-decoration: underline; }
.hk-city small { display: block; font-size: 11.5px; font-weight: 400; color: var(--ink-2); }
.hk-row-head { border-bottom: 2px solid var(--line-strong); }
.hk-row-links .hk-cell { display: grid; gap: 2px; font-weight: 400; font-size: 13px; }
.hk-row-links .hk-cell a { display: inline-flex; align-items: center; min-height: 32px; }

.guide .hk-block-title { margin: 32px 0 8px; font-size: 16px; }
.guide .hk-note { margin: 0 0 10px; font-size: 12.5px; line-height: 1.8; color: var(--ink-2); }
.hk-lists { display: grid; gap: 10px; align-items: start; }
.hk-list { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 0 14px; }
.hk-list summary {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px;
  font-size: 15px; font-weight: 700; cursor: pointer; list-style: none;
}
.hk-list summary::-webkit-details-marker { display: none; }
.hk-list summary::after { content: '+'; margin-left: 4px; color: var(--ink-3); font-weight: 400; }
.hk-list[open] summary::after { content: '−'; }
.hk-list summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.hk-count { margin-left: auto; font-size: 13px; color: var(--accent-ink); }
.guide .hk-group { margin: 6px 0 4px; font-size: 12px; font-weight: 700; color: var(--ink-3); }
.hk-list ul { list-style: none; margin: 0 0 8px; padding: 0; }
.hk-list li { padding: 8px 0; border-top: 1px solid var(--line-soft); font-size: 14px; line-height: 1.6; }
.hk-list li a { font-weight: 700; }
.hk-meta { display: block; font-size: 12.5px; color: var(--ink-2); }
.guide .hk-empty { margin: 0 0 12px; font-size: 13.5px; line-height: 1.8; color: var(--ink-2); }
.guide .hk-common { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--line-soft); }

/* ---- モーション（チップの追加・結果の入場）。動きを減らす設定では止める ---- */
@keyframes hk-pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
@keyframes hk-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.hk-result.is-entering .hk-row,
.hk-result.is-entering .hk-list {
  animation: hk-rise .38s cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: calc(var(--i, 0) * .04s);
}
.hk-result.is-entering .hk-row.is-diff .hk-diff { animation: hk-pop .4s .3s cubic-bezier(.2, .8, .2, 1) both; }
@media (prefers-reduced-motion: reduce) {
  .hk-chip-x, .hk-share { transition: none; }
  .hk-chip-x:active, .hk-share:active { transform: none; }
  .hk-chip.is-new,
  .hk-result.is-entering .hk-row,
  .hk-result.is-entering .hk-list,
  .hk-result.is-entering .hk-row.is-diff .hk-diff { animation: none; }
}

@media (min-width: 640px) {
  .hk-pick { padding: 24px; }
  .hk-row { grid-template-columns: 200px repeat(var(--n), minmax(0, 1fr)); column-gap: 16px; padding: 12px 0; }
  .hk-label { grid-column: auto; margin: 0; flex-wrap: wrap; align-content: center; }
  .hk-row-head .hk-label { display: block; }
  .hk-lists { grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); }
}
