/* =========================
   Tax / Social KPI Cards
   compact pastel (CPI寄せ)
========================= */

.tax-kpi-panel-shell {
  margin-top: 12px;
}

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

.tax-kpi-title {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.01em;
  color: #131722;
}

.tax-kpi-period {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.9);
  background: rgba(255,255,255,.9);
  color: #6b7280;
  font-size: 11px;
  font-weight: 800;
  box-shadow: var(--shadow-soft-sm, 0 6px 14px rgba(15,23,42,.06));
  white-space: nowrap;
}

.tax-kpi-status {
  margin: 0 0 10px;
  font-size: 12px;
  color: #6b7280;
}
.tax-kpi-status.is-loading { color: #64748b; }
.tax-kpi-status.is-ok { color: #0f766e; }
.tax-kpi-status.is-warn { color: #a16207; }
.tax-kpi-status.is-error { color: #b91c1c; }

/* グリッド：スマホ2列、狭い端末1列 */
.tax-kpi-card-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* =========================
   Card base (CPI寄せ)
========================= */
.tax-card {
  --tax-bg-1: #ffffff;
  --tax-bg-2: #f6f7fb;
  --tax-accent: #8aa0b8;
  --tax-accent-soft: rgba(138,160,184,.14);

  position: relative;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.88);
  background: linear-gradient(180deg, var(--tax-bg-1) 0%, var(--tax-bg-2) 100%);
  box-shadow: var(--shadow-soft-sm, 0 8px 18px rgba(15,23,42,.06));
  padding: 10px;
  min-height: 152px;
  overflow: hidden;
}

.tax-card::before {
  content: "";
  position: absolute;
  right: -18px;
  top: -18px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.95), rgba(255,255,255,0) 70%);
  pointer-events: none;
}

/* =========================
   税カード別パステル配色
========================= */

/* 所得税率 */
.tax-card.is-income {
  --tax-bg-1: #f3fbf9;
  --tax-bg-2: #eaf8f4;
  --tax-accent: #46b3a9;
  --tax-accent-soft: rgba(70,179,169,.14);
}

/* 個人住民税 */
.tax-card.is-resident {
  --tax-bg-1: #f7f3ff;
  --tax-bg-2: #f0e9ff;
  --tax-accent: #8b6fd6;
  --tax-accent-soft: rgba(139,111,214,.14);
}

/* 健康保険 */
.tax-card.is-health {
  --tax-bg-1: #fff7ef;
  --tax-bg-2: #fff1e2;
  --tax-accent: #f09a4f;
  --tax-accent-soft: rgba(240,154,79,.14);
}

/* 介護保険 */
.tax-card.is-nursing {
  --tax-bg-1: #eef6ff;
  --tax-bg-2: #e5f0ff;
  --tax-accent: #5a9cf5;
  --tax-accent-soft: rgba(90,156,245,.14);
}

/* 厚生年金 */
.tax-card.is-pension {
  --tax-bg-1: #fff1f4;
  --tax-bg-2: #ffe8ee;
  --tax-accent: #ef7da0;
  --tax-accent-soft: rgba(239,125,160,.14);
}

/* 雇用保険 */
.tax-card.is-employ {
  --tax-bg-1: #f2fbff;
  --tax-bg-2: #e8f8ff;
  --tax-accent: #53b6d9;
  --tax-accent-soft: rgba(83,182,217,.14);
}

/* 所得税シミュレーター（目立たせる） */
.tax-card.is-income-calc {
  --tax-bg-1: #fff9ef;
  --tax-bg-2: #fff3dd;
  --tax-accent: #ff9f1a;
  --tax-accent-soft: rgba(255,159,26,.16);

  grid-column: 1 / -1;
  min-height: auto;
}

/* =========================
   Card header
========================= */
.tax-card-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
}

.tax-card-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.tax-card-icon {
  width: 24px;
  height: 24px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(255,255,255,.92);
  box-shadow: 0 2px 8px rgba(18,24,38,.05);
  font-size: 13px;
  line-height: 1;
}

.tax-card-title {
  margin: 0;
  font-size: 13px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tax-card-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(255,255,255,.9);
  color: #6b7280;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .01em;
}

/* =========================
   Card body
========================= */
.tax-card-body {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
}

.tax-main {
  border-radius: 14px;
  background: rgba(255,255,255,.68);
  border: 1px solid rgba(20,24,34,.04);
  padding: 8px 9px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
}

.tax-main-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.tax-main-label {
  font-size: 10px;
  color: #64748b;
  font-weight: 700;
}

.tax-main-sub {
  font-size: 10px;
  color: #8a93a4;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tax-main-value-row {
  margin-top: 4px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
}

.tax-main-value {
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
  color: #111827;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.tax-main-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--tax-accent);
  box-shadow: 0 0 0 4px var(--tax-accent-soft);
  flex: 0 0 auto;
  margin-bottom: 3px;
}

/* 小ピル */
.tax-pill-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.tax-pill {
  border-radius: 12px;
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(20,24,34,.04);
  padding: 7px 8px 6px;
  min-width: 0;
}

.tax-pill.is-full {
  grid-column: 1 / -1;
}

.tax-pill-label {
  display: block;
  font-size: 9px;
  line-height: 1.1;
  color: #7b8494;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tax-pill-value {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: #0f172a;
}

/* 差分だけドット付き */
.tax-pill-value.is-up,
.tax-pill-value.is-down,
.tax-pill-value.is-flat,
.tax-pill-value.is-null {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.tax-pill-value.is-up::before,
.tax-pill-value.is-down::before,
.tax-pill-value.is-flat::before,
.tax-pill-value.is-null::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  opacity: .9;
}

.tax-pill-value.is-up { color: #d65a74; }   /* 柔らかい赤ピンク */
.tax-pill-value.is-down { color: #2fae87; } /* 柔らかいグリーン */
.tax-pill-value.is-flat { color: #6b7280; }
.tax-pill-value.is-null { color: #94a3b8; }
.tax-pill-value.is-null::before { opacity: .4; }

.tax-pill-sub {
  display: block;
  margin-top: 4px;
  font-size: 9px;
  color: #8a93a4;
  line-height: 1.2;
}

/* 下部 */
.tax-card-foot {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(20,24,34,.05);
  font-size: 9px;
  color: #9aa3b2;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Empty */
.tax-empty {
  grid-column: 1 / -1;
  border: 1px dashed #d8dde7;
  border-radius: 14px;
  padding: 14px;
  background: rgba(255,255,255,.5);
  color: #6b7280;
  font-size: 13px;
}
.tax-empty p {
  margin: 0;
}

/* skeleton */
.tax-card--skeleton {
  min-height: 152px;
}
.tax-card--skeleton .sk {
  border-radius: 10px;
  background: linear-gradient(90deg, #eef2f7 25%, #f7f9fc 37%, #eef2f7 63%);
  background-size: 400% 100%;
  animation: taxKpiShimmer 1.2s ease infinite;
}
.tax-card--skeleton .sk1 { height: 14px; width: 56%; margin-bottom: 8px; }
.tax-card--skeleton .sk2 { height: 46px; width: 100%; margin-bottom: 7px; }
.tax-card--skeleton .sk3 { height: 32px; width: 100%; margin-bottom: 6px; }
.tax-card--skeleton .sk4 { height: 10px; width: 72%; }

@keyframes taxKpiShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* =========================
   Income Tax Calculator UI
========================= */
.tax-calc-wrap {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
}

.tax-calc-input-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px;
  align-items: center;
}

.tax-calc-label {
  font-size: 12px;
  color: #475569;
  font-weight: 800;
}

.tax-calc-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.tax-calc-input {
  width: 100%;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(20,24,34,.10);
  background: rgba(255,255,255,.85);
  padding: 0 44px 0 12px;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
}

.tax-calc-input:focus {
  border-color: rgba(255,159,26,.5);
  box-shadow: 0 0 0 3px rgba(255,159,26,.12);
}

.tax-calc-unit {
  position: absolute;
  right: 10px;
  font-size: 11px;
  color: #6b7280;
  font-weight: 800;
  pointer-events: none;
}

.tax-calc-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tax-calc-quick-btn {
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(20,24,34,.10);
  background: rgba(255,255,255,.78);
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.tax-calc-quick-btn:hover {
  background: #fff;
  border-color: rgba(255,159,26,.28);
}

.tax-calc-main {
  border-radius: 14px;
  border: 1px solid rgba(20,24,34,.06);
  background: rgba(255,255,255,.72);
  padding: 10px;
}

.tax-calc-main-label {
  font-size: 10px;
  font-weight: 800;
  color: #6b7280;
  margin-bottom: 4px;
}

.tax-calc-main-value {
  font-size: 26px;
  line-height: 1;
  font-weight: 900;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.tax-calc-main-sub {
  margin-top: 5px;
  font-size: 10px;
  color: #7c8798;
  font-weight: 700;
  word-break: break-word;
}

.tax-calc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.tax-calc-item {
  border-radius: 12px;
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(20,24,34,.04);
  padding: 7px 8px 6px;
  min-width: 0;
}

.tax-calc-item-label {
  display: block;
  font-size: 9px;
  line-height: 1.1;
  color: #7b8494;
  font-weight: 700;
  margin-bottom: 4px;
}

.tax-calc-item-value {
  display: block;
  font-size: 12px;
  line-height: 1.15;
  color: #0f172a;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}

.tax-calc-note {
  font-size: 10px;
  line-height: 1.35;
  color: #7c8798;
  padding: 0 2px;
}

/* responsive */
@media (max-width: 640px) {
  .tax-calc-input-row {
    grid-template-columns: 1fr;
  }
  .tax-calc-label {
    font-size: 11px;
  }
}

@media (max-width: 380px) {
  .tax-kpi-card-list {
    grid-template-columns: 1fr;
  }
  .tax-calc-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 720px) {
  .tax-kpi-card-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .tax-card.is-income-calc {
    grid-column: 1 / -1;
  }
}