/* ==============================
   å¸åºçºæè©³ç´°ï¼çµ±è¨ããã·ã¥ãã¼ã
   ============================== */
.yws-city-stat {
  margin: 1.5em 0 2.5em;
}

.yws-city-stat__lead {
  margin: 0 0 1.75em;
}

.yws-city-stat__section {
  margin-bottom: 2.75em;
}

.yws-city-stat__section--score {
  margin-bottom: 3.25em;
}

.yws-city-stat__meta {
  margin: 0 0 1.25em;
}

.sort-guide-text {
  margin: 1em 0;
  padding: 0.85em 1em;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
}

.yws-city-stat__legend-sample--red {
  color: #c0392b;
  font-weight: 700;
}

.yws-city-stat__legend-sample--good {
  display: inline-block;
  padding: 0.05em 0.4em;
  border-radius: 4px;
  font-weight: 700;
  color: #1e6b3a;
  background: rgba(213, 245, 227, 0.85);
}

/* --- ã¹ã³ã¢ãã¼ã­ã¼ï¼ã©ã³ã¯ + ã¬ã¼ãã¼ï¼ --- */
.yws-city-stat__score-hero {
  margin-bottom: 1.75em;
}

.yws-city-stat__rank-card h3 {
  margin: 10px 0 20px;
  border: none!important;
}

.yws-city-stat__rank-card--radar {
  width: 100%;
  text-align: left;
}

.yws-city-stat__radar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(0, 1fr);
  gap: 1.25em;
  align-items: center;
}

.yws-city-stat__radar .yws-city-stat__rank-comment {
  margin: 0;
}

.yws-city-stat__radar-canvas-wrap,
.yws-city-stat__combo-canvas-wrap,
.yws-city-stat__timeseries-canvas-wrap {
  position: relative;
  max-width: 100%;
}

.yws-city-stat__radar-canvas,
.yws-city-stat__combo-canvas,
.yws-city-stat__timeseries-canvas {
  display: block;
  width: 100% !important;
  max-height: 380px;
  min-height: 220px;
}

.yws-city-stat__radar-series-key {
  margin: 0 0 0.85em;
}

.yws-city-stat__radar-series-key-item {
  display: flex;
  align-items: center;
  gap: 0.4em;
  margin: 5px 0;
}

.yws-city-stat__radar-swatch {
  display: inline-block;
  width: 2.35em;
  height: 0.9em;
  border-radius: 2px;
  flex-shrink: 0;
}

.yws-city-stat__radar-series-key-item--city .yws-city-stat__radar-swatch {
  background: #e8a317;
  border: 2px solid #e8a317;
}

.yws-city-stat__radar-series-key-item--pref .yws-city-stat__radar-swatch {
  background: rgba(59, 159, 217, 0.12);
  border: 2px dashed #3b9fd9;
}

.yws-city-stat__radar-series-key-item--baseline .yws-city-stat__radar-swatch {
  background: rgba(149, 165, 166, 0.12);
  border: 2px dashed #7f8c8d;
}

/* --- ã©ã³ã¯ã«ã¼ã --- */
.yws-city-stat__rank-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2em;
  margin: 1.5em 0;
}

.yws-city-stat__rank-cards--triple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.yws-city-stat__rank-card,
.yws-city-stat__cards--score .yws-city-stat__card {
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
}

.yws-city-stat__rank-card {
  padding: 1.35em 1.25em 1.5em;
  text-align: center;
}

.yws-city-stat__rank-comment {
  margin: 0.85em 0 0;
  text-align: left;
}

/* --- cards --- */
.yws-city-stat__cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.65em;
  margin-bottom: 1.25em;
}

.tax-pref .yws-city-stat__cards{
  margin-top:2em;
}

.yws-city-stat__card {
  padding: 1.25em 1em;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: #fafafa;
}

.yws-city-stat__cards--score .yws-city-stat__card {
  padding: 1.35em 1.15em 1.15em;
}

.yws-city-stat__card-label {
  margin: 0;
  font-weight: 700;
}

.yws-city-stat__cards--score .yws-city-stat__card-label {
  margin: 0 0 0.55em;
  font-size: 1.05em;
  font-weight: 800;
  text-align: center;
}

.yws-city-stat__cards--score .yws-city-stat__card-metrics {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 5.75em;
  margin-bottom: 0.85em;
}

.yws-city-stat__card-value {
  margin: 0.25em 0;
  padding: 0;
  font-size: clamp(1.9rem, 3.2vw, 2.5rem);
  line-height: 1.15;
  font-weight: 800;
}

.yws-city-stat__cards--score .yws-city-stat__card-value {
  margin: 0;
  text-align: center;
}

.yws-city-stat__card-benchmarks {
  margin: 0 0 0.65em;
  font-size: 0.78em;
  color: #777;
}

.yws-city-stat__cards--score .yws-city-stat__card-benchmarks {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 1.55em;
  margin: 0.4em 0 0;
  text-align: center;
}

.yws-city-stat__card-benchmarks-placeholder {
  display: block;
  visibility: hidden;
}

.yws-city-stat__card-desc {
  margin: 0;
  padding-top: 0.85em;
  border-top: 1px solid #ececec;
  font-size: 0.88em;
  color: #555;
}

.yws-city-stat__bench {
  display: inline-block;
  padding: 0.06em 0.35em;
  border-radius: 3px;
  font-weight: 700;
}

/* --- æ¯è¼ç¶æï¼æ°å¤ã®èµ¤å­ / å·®åããã¸ï¼ --- */
.contents .yws-city-stat__cell-value--is-better,
.contents .yws-city-stat__card-value--is-better,
.contents .yws-city-stat__compare-city--is-better .yws-city-stat__cell-value,
.yws-city-stat__table--tile .yws-city-stat__cell-value--is-better {
  color: #c0392b;
}

.yws-city-stat__bench--is-better {
  color: #1e6b3a;
  background: rgba(213, 245, 227, 0.85);
}

.yws-city-stat__bench--is-worse {
  color: #888;
  background: #f3f3f3;
}

.yws-city-stat__bench--is-even,
.yws-city-stat__bench--is-neutral {
  color: #666;
  background: #f0f0f0;
}

/* --- ã·ãã¢æ½è¨­åè¨³ --- */
.yws-city-stat__senior-breakdown {
  margin-top: 1.25em;
}

.yws-city-stat__senior-breakdown-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(0, 1fr);
  gap: 1.5em;
  align-items: center;
}

/* --- ãã¼ãã«ï¼ã¿ã¤ã«å4åï¼ --- */
.yws-city-stat__table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -15px 0 0;
  padding: 0 15px 0 0;
}

.yws-city-stat__table-wrap:not(.is-diff-visible) .yws-city-stat__compare-diffs {
  display: none;
}

.yws-city-stat__table-wrap--tile {
  padding: 0.15em;
  background: #fff;
}

.yws-city-stat__table--tile {
  width: 100%;
  min-width: 520px;
  margin: 1em 0 0 !important;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  background: #fff;
}

.yws-city-stat__table--tile thead th,
.yws-city-stat__table--tile tbody th,
.yws-city-stat__table--tile tbody td {
  padding: 1em 1.1em;
  border: 2px solid #fff !important;
  vertical-align: middle;
}

.yws-city-stat__table--tile thead th:first-child {
  background: transparent;
  color: transparent;
  padding: 0;
  border: none !important;
}

.yws-city-stat__table--tile thead th:not(:first-child) {
  background: #eee;
  font-weight: 800;
  text-align: center;
}

.yws-city-stat__table--tile tbody th {
  background: #f3f3f3;
  font-weight: 800;
  text-align: center;
  padding: 10px 15px !important;
}

.yws-city-stat__table-label--old-building {
  display: inline-block;
  font-size: 0.88em;
  line-height: 1.35;
  font-weight: 800;
}

.yws-city-stat__table--tile tbody td {
  background: #f9f9f9;
  color: #222;
  text-align: right;
}

.yws-city-stat__table--tile .yws-city-stat__cell-value {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-end;
  font-weight: 500;
}

.yws-city-stat__table--tile .yws-city-stat__compare-city {
  text-align: right;
}

.yws-city-stat__table--tile .yws-city-stat__compare-diffs {
  justify-content: flex-end;
}

.yws-city-stat__table--tile thead .yws-city-stat__diff-toggle {
  border-color: rgba(255, 255, 255, 0.55);
}

.yws-city-stat__table--tile thead .yws-city-stat__diff-toggle:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.85);
}

.yws-city-stat__city-col-head {
  white-space: nowrap;
}

.yws-city-stat__diff-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25em;
  height: 1.25em;
  margin-left: 0.35em;
  padding: 0;
  border: 1px solid #bbb;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  vertical-align: middle;
}

.yws-city-stat__diff-toggle:hover {
  background: #f5f5f5;
  border-color: #999;
}

.yws-city-stat__diff-toggle.is-active,
.yws-city-stat__diff-toggle[aria-expanded="true"] {
  background: #eef4fb;
  border-color: #3b9fd9;
  color: #2a7fb8;
}

.yws-city-stat__table--tile thead .yws-city-stat__diff-toggle.is-active,
.yws-city-stat__table--tile thead .yws-city-stat__diff-toggle[aria-expanded="true"] {
  background: #333;
  border-color: #333;
  color: #fff;
}

.yws-city-stat__compare-diffs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35em 0.5em;
  margin-top: 0.4em;
  font-size: 0.78em;
}

.yws-city-stat__compare-diffs .yws-city-stat__bench {
  margin: 0;
}

.yws-city-stat__note {
  margin: 0 0 0.85em;
  text-align: right;
}

.yws-city-stat__card .yws-city-stat__note {
  margin: 0.65em 0 0;
}

.contents table th {
  font-size: 0.9em;
}

.yws-city-stat__unit {
  margin-left: 0.3em;
  font-weight: inherit;
  font-size: .8em;
}

.yws-city-stat__non-public {
  display: inline-block;
  font-size: 0.82em;
  font-weight: 500;
  color: #94a3b8;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* --- è£å©ãã­ã¹ãï¼åé ­åºå¸ä»¥å¤ï¼ --- */
.yws-city-stat__source,
.yws-city-stat__note,
.yws-city-stat__housing-old-source,
.yws-city-stat__attribution {
  margin: 0 0 0.35em;
  line-height: 1.8;
  font-size: 0.9em;
}

.yws-city-stat__sources-footer-text{
  font-size: 0.8em;
  color: #666;
}

.yws-city-stat__fallback {
  margin: 0.75em 0 0;
  padding: 0.85em 1em;
  font-size: 0.88em;
  color: #999;
  background: #fafafa;
  border-left: 3px solid #ddd;
}

.yws-city-stat__sources-footer {
  margin: 2.25em 0 0;
  padding-top: 1.1em;
  border-top: 1px solid #e0e0e0;
}

.yws-city-stat__sources-footer-text {
  margin: 0;
}

.yws-city-stat__empty {
  margin: 0;
}

/* --- ãããã°ï¼éçºç¨ï¼ --- */
.yws-city-stat__debug {
  margin: 0.65em 0 0;
  padding: 0.55em 0.75em;
  border: 1px dashed #d4a574;
  border-radius: 6px;
  background: #fffaf3;
  color: #6b4f2a;
}

.yws-city-stat__debug summary {
  cursor: pointer;
  font-weight: 700;
}

.yws-city-stat__debug-table {
  width: 100%;
  margin-top: 0.55em;
  border-collapse: collapse;
}

.yws-city-stat__debug-table th,
.yws-city-stat__debug-table td {
  padding: 0.35em 0.45em;
  border: 1px solid #ead9c4;
  vertical-align: top;
  text-align: left;
}

.yws-city-stat__debug-table code {
  word-break: break-all;
}

.yws-city-stat__debug-list {
  margin: 0.45em 0 0;
  padding-left: 1.2em;
}

/* --- ã¬ã¹ãã³ã·ã --- */
@media (max-width: 960px) {
  .yws-city-stat__rank-cards,
  .yws-city-stat__rank-cards--triple,
  .yws-city-stat__radar,
  .yws-city-stat__senior-breakdown-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .yws-city-stat__cards {
    grid-template-columns: 1fr;
  }
}

/* ==============================
   é½éåºçãããã¼ã¸
   ============================== */
.yws-pref-hub__table-collapsible[data-collapsed="true"] tbody tr.is-hidden-row {
  display: none;
}

.yws-pref-hub__table-more {
  display: block;
  width: 100%;
  margin: 0.85em 0 0;
  padding: 0.75em 1em;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #1e293b;
  font-weight: 700;
  cursor: pointer;
  position: sticky;
  left: 0;
}

.yws-pref-hub__table-more:hover {
  background: #f8fafc;
}

.yws-pref-hub__sortable {
  white-space: nowrap;
  user-select: none;
}

.yws-pref-hub__sort-icon {
  display: inline-block;
  margin-left: 0.2em;
  font-size: 0.72em;
  line-height: 1;
  color: #334155;
  vertical-align: middle;
}

.yws-pref-hub__sortable.is-sorted .yws-pref-hub__sort-icon {
  color: #0f172a;
}

.yws-city-stat__table--tile tbody td.yws-pref-hub__rank-cell {
  text-align: center;
  vertical-align: middle;
}

.yws-pref-hub__table--ranking tbody th.yws-pref-hub__city-label,
.yws-pref-hub__table--wooden tbody th.yws-pref-hub__city-label {
  font-size: 1.2em;
  vertical-align: middle;
}

.yws-pref-hub__table--ranking tbody td.yws-pref-hub__metric-emphasis,
.yws-pref-hub__table--wooden tbody td {
  font-size: 1.2em;
  vertical-align: middle;
}

.yws-pref-hub__table--ranking tbody td.yws-pref-hub__metric-emphasis .yws-city-stat__cell-value,
.yws-pref-hub__table--ranking tbody td.yws-pref-hub__metric-emphasis .yws-city-stat__non-public,
.yws-pref-hub__table--wooden tbody td .yws-city-stat__cell-value,
.yws-pref-hub__table--wooden tbody td .yws-city-stat__non-public {
  font-size: inherit;
}

.yws-pref-hub__table tbody th.yws-pref-hub__city-label {
  text-align: left;
}

.yws-pref-hub__city-label-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  text-align: left;
}

.yws-pref-hub__city-medal {
  flex: 0 0 auto;
  line-height: 0;
}

.yws-pref-hub__table--ranking svg.yws-pref-hub__rank-medal {
  width: 34px;
  height: 34px;
}

.yws-pref-hub__table--ranking .yws-pref-hub__rank-medal--num {
  min-width: 2.25rem;
  font-size: 1rem;
}

.yws-pref-hub__table--ranking .yws-pref-hub__city-label-inner {
  gap: 0.55em;
}

.yws-pref-hub__table--ranking td.yws-pref-hub__rank-cell .yws-city-stat__rank-badge--inline {
  width: 3rem;
  height: 3rem;
}

.yws-pref-hub__table--ranking td.yws-pref-hub__rank-cell .yws-city-stat__rank-badge--inline .yws-city-stat__rank-letter {
  font-size: 1.3rem;
}

.yws-pref-hub__insight-block {
  margin-top: 1.15em;
}

.prefecture-featured-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin: 1em 0 2.5em;
}

.prefecture-featured-grid:last-of-type {
  margin-bottom: 0;
}

@media (min-width: 768px) {
  .prefecture-featured-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.prefecture-featured-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding: 1.15em 1.1em;
  text-align: left;
}

.prefecture-featured-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75em;
  margin-bottom: 0.85em;
}

.prefecture-featured-card__header h4 {
  margin: 0;
}

.prefecture-featured-card .yws-city-stat__rank-badge--inline {
  width: 2.5rem;
  height: 2.5rem;
  margin: 0;
  flex-shrink: 0;
}

.prefecture-featured-card .yws-city-stat__rank-badge--inline .yws-city-stat__rank-letter {
  font-size: 1rem;
}

.prefecture-featured-card .yws-city-stat__rank-comment {
  flex: 1 1 auto;
  margin: 0 0 1em;
}

.prefecture-featured-card .card-link-btn {
  display: block;
  padding: 0.6em;
  border-radius: 6px;
  background: #002244;
  color: #fff;
  font-size: 0.88em;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: background 0.2s ease;
}

.prefecture-featured-card .card-link-btn:hover {
  background: #001122;
  color: #fff;
}

.yws-pref-hub__gojuon-section {
  margin-bottom: 1.35em;
}

.yws-pref-hub__gojuon-section:last-child {
  margin-bottom: 0;
}

.yws-pref-hub__gojuon-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75em;
}

.yws-pref-hub__gojuon-card {
  display: block;
  padding: 0.85em 0.95em;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: inherit;
  text-decoration: none!important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

a.yws-pref-hub__gojuon-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  text-decoration: none;
}

.yws-pref-hub__gojuon-card-name {
  display: block;
  font-weight: 700;
  color: inherit;
}

.yws-pref-hub__gojuon-card-kana,
.yws-pref-hub__gojuon-card-meta {
  display: block;
  font-size: 0.82em;
  color: #64748b;
}

.yws-pref-hub__empty {
  margin: 1em 0;
  color: #64748b;
}

@media (max-width: 960px) {
  .yws-pref-hub__gojuon-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 全国ランキングページ */
.yws-ranking-page .yws-ranking__intro {
  margin-bottom: 1.25em;
}

.yws-ranking-page .yws-city-stat__attribution {
  margin-bottom: 1.5em;
}

.yws-ranking__source-notes {
  line-height: 1.8;
}

.yws-ranking__primary-metric {
  font-weight: 700;
}

.yws-ranking__empty {
  padding: 1.5em 0;
  color: #64748b;
  text-align: center;
}

.yws-ranking__related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85em;
  margin-top: 0.75em;
}

.yws-ranking__related-card {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
  min-height: 5.5em;
  padding: 0.95em 1.05em;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  color: #1e293b;
  text-decoration: none!important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.yws-ranking__related-card:hover,
.yws-ranking__related-card:focus-visible {
  border-color: #94a3b8;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
  color: #1e293b;
}

.yws-ranking__related-card-title {
  font-size: 0.98em;
  font-weight: 700;
  line-height: 1.45;
}

.yws-ranking__related-card-desc {
  font-size: 0.86em;
  line-height: 1.55;
  color: #64748b;
}

@media (max-width: 640px) {
  .yws-ranking__related-grid {
    grid-template-columns: 1fr;
  }
}

/* 全国ランキング：市区町村名の折り返し防止＋列幅は内容に合わせて横スクロール */
.yws-pref-hub__table--ranking.yws-city-stat__table--tile {
  table-layout: auto;
  width: max-content;
  min-width: 100%;
}

.yws-ranking-page .yws-city-stat__table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.yws-pref-hub__table--ranking tbody th.yws-pref-hub__city-label {
  min-width: 11.5em;
  width: auto;
  padding-right: 1.25em !important;
  box-sizing: border-box;
}

.yws-pref-hub__table--ranking tbody th.yws-pref-hub__city-label,
.yws-pref-hub__table--ranking .yws-pref-hub__city-label-inner,
.yws-pref-hub__table--ranking .yws-pref-hub__city-name,
.yws-pref-hub__table--ranking .yws-pref-hub__city-name a {
  white-space: nowrap;
}

.yws-pref-hub__table--ranking thead th:not(:first-child),
.yws-pref-hub__table--ranking tbody td {
  white-space: nowrap;
}

.yws-pref-hub__table--ranking tbody td.yws-pref-hub__rank-cell {
  min-width: 4.5em;
}