/* =========================
   都道府県財政決算カード
   ========================= */

.pref-finance-section {
  margin: 10px 0 28px;
  padding: 14px;
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.96), rgba(246,249,255,0.96));
  border: 1px solid #e8edf5;
  box-shadow: 0 10px 26px rgba(16, 24, 40, 0.05);
}

.pref-finance-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.pref-finance-eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  color: #7f8aa3;
  letter-spacing: .04em;
}

.pref-finance-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
  color: #111827;
}

.pref-finance-period {
  align-self: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #dde5f1;
  background: #f8fbff;
  color: #50607a;
  font-size: 12px;
  white-space: nowrap;
}

.pref-finance-status {
  margin: 6px 0 12px;
  color: #6b7280;
  font-size: 13px;
}

/* ===== 1枚目：歳入・歳出を2列、一般財源比率は横幅いっぱい ===== */
.pref-finance-hero-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.pf-hero {
  background: #fff;
  border: 1px solid #e8edf5;
  border-radius: 18px;
  padding: 12px;
  box-shadow: 0 8px 20px rgba(16,24,40,.04);
  min-width: 0;
}

.pf-hero-grr {
  grid-column: 1 / -1;
}

.pf-hero-label {
  margin: 0 0 4px;
  font-size: 12px;
  color: #7a859b;
}

.pf-hero-value {
  margin: 0;
  font-weight: 800;
  font-size: 20px;
  line-height: 1.2;
  color: #111827;
  letter-spacing: -.02em;
  word-break: keep-all;
}

.pf-hero-sub {
  margin: 6px 0 0;
  font-size: 12px;
  color: #6b7280;
}

.pf-hero-sub .up { color: #0f9f6e; font-weight: 700; }
.pf-hero-sub .down { color: #e24a4a; font-weight: 700; }
.pf-hero-sub .est {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fff4e5;
  color: #b45309;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid #fde6bf;
}

.pref-finance-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 12px;
  margin-bottom: 12px;
}

.pf-card {
  background: rgba(255,255,255,0.9);
  border: 1px solid #e8edf5;
  border-radius: 18px;
  padding: 12px;
  box-shadow: 0 8px 20px rgba(16,24,40,.04);
}

.pf-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.pf-card-head h4 {
  margin: 0;
  font-size: 14px;
  color: #111827;
}

.pf-chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #54708f;
  border: 1px solid #dbe6f3;
  background: #f5f9ff;
}

.pf-chip.soft {
  color: #7a859b;
  background: #fafbfc;
  border-color: #e5e7eb;
}

/* ===== 旧：歳入合計（今回はJSで出さない） ===== */
.pf-total {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f7fbff;
  border: 1px solid #e2eefc;
}

.pf-total .label {
  font-size: 12px;
  color: #6b7280;
}

.pf-total .value {
  margin-top: 2px;
  font-size: 18px;
  font-weight: 800;
  color: #111827;
}

/* ===== NEW：みんなが納めた税金（地方税）カード ===== */
.pf-tax-card{
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fbfbfd;
  border: 1px solid #e8edf5;
}

.pf-tax-label{
  font-size: 12px;
  color: #6b7280;
  font-weight: 800;
  line-height: 1.35;
}

.pf-tax-value{
  margin-top: 3px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.pf-tax-money{
  font-size: 18px;
  font-weight: 900;
  color: #111827;
  letter-spacing: -.01em;
}

.pf-tax-share{
  font-size: 13px;
  font-weight: 800;
  color: #6b7280;
}

.pf-tax-note{
  margin-top: 4px;
  font-size: 12px;
  color: #7f8694;
  line-height: 1.4;
}

/* 税カードがある時はバー群を少し詰める（見た目調整） */
.pf-bars.has-tax-card{
  margin-top: 6px;
}

.pf-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pf-row-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.pf-row-label {
  font-size: 12px;
  color: #374151;
  font-weight: 600;
}

.pf-row-value {
  font-size: 12px;
  color: #111827;
  font-weight: 700;
  white-space: nowrap;
}

.pf-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}

.pf-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #7bb3ff, #4f8fff);
}

.pf-bar-fill.alt {
  background: linear-gradient(90deg, #8ce1c2, #29b67d);
}

.pf-note {
  margin-top: 10px;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.55;
  background: #fafbfc;
  border: 1px solid #eceff4;
  border-radius: 12px;
  padding: 8px 10px;
}

.pf-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pf-list-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #edf1f6;
  border-radius: 12px;
  background: #fff;
}

.pf-list-rank {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #55708f;
  background: #f1f6ff;
  border: 1px solid #dbe8f8;
}

.pf-list-main {
  min-width: 0;
}

.pf-list-name {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
}

.pf-list-sub {
  margin-top: 2px;
  font-size: 11px;
  color: #6b7280;
  line-height: 1.3;
}

.pf-list-val {
  text-align: right;
  white-space: nowrap;
}

.pf-list-val .v1 {
  font-size: 13px;
  font-weight: 800;
  color: #111827;
}

.pf-list-val .v2 {
  margin-top: 1px;
  font-size: 11px;
  color: #6b7280;
}

/* 読み解きポイント / 出典のカード幅が詰まって見えるので余白を広げる */
#prefFinanceCommentCard {
  margin-top: 14px;
}

#prefFinanceSourceCard {
  margin-top: 14px;
}

.pf-comment-body {
  color: #374151;
  font-size: 13px;
  line-height: 1.75;
}

.pf-comment-body p {
  margin: 0 0 10px;
}

.pf-comment-body p:last-child {
  margin-bottom: 0;
}

.pf-source-body {
  font-size: 12px;
  color: #4b5563;
  line-height: 1.65;
}

.pf-source-grid {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 7px 12px;
}

.pf-source-key {
  color: #6b7280;
}

.pf-source-val {
  word-break: break-word;
}

.pf-source-val a {
  color: #2563eb;
  text-decoration: none;
}
.pf-source-val a:hover { text-decoration: underline; }

.pf-empty {
  color: #6b7280;
  font-size: 13px;
  padding: 8px 0;
}

/* タブレット以下 */
@media (max-width: 900px) {
  .pref-finance-grid {
    grid-template-columns: 1fr;
  }

  .pref-finance-title {
    font-size: 18px;
  }

  .pf-hero-value {
    font-size: 18px;
  }
}

/* スマホ微調整（2列維持） */
@media (max-width: 480px) {
  .pref-finance-hero-cards {
    gap: 8px;
  }

  .pf-hero {
    padding: 10px;
    border-radius: 16px;
  }

  .pf-hero-label {
    font-size: 11px;
  }

  .pf-hero-value {
    font-size: 16px;
    line-height: 1.22;
  }

  .pf-hero-sub {
    font-size: 11px;
  }

  .pf-tax-money{
    font-size: 16px;
  }

  .pf-tax-share{
    font-size: 12px;
  }

  .pf-source-grid {
    grid-template-columns: 72px 1fr;
    gap: 6px 10px;
  }
}