/* =====================================================================
   style.css — 年末調整の還付・追徴の目安 ツール固有の微調整のみ。
   共通スタイルは /_shared/shirugear.css に任せる（色は共有CSSの変数を使う）。
   ===================================================================== */

/* hidden は共通CSSの display 指定に負けないように */
#spouse-fields[hidden],
#result-rows[hidden],
#r-adj-wrap[hidden],
#r-housing-wrap[hidden],
#ded-card[hidden],
#na-card[hidden],
#notes[hidden],
#copy-btn[hidden] {
  display: none;
}

.ya-h {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 0 0 12px;
}

.sg-result__value,
.sg-result-row__value,
.ya-table td,
.ya-est__out {
  font-variant-numeric: tabular-nums;
}
.sg-result-row__value {
  text-align: right;
  white-space: nowrap;
  flex: 0 0 auto;
}
.sg-result-row__label {
  min-width: 0;
  flex: 1 1 auto;
  text-align: left;
}

/* 還付・追徴で結果の色を変える */
.ya-refund .sg-result__value {
  color: var(--sg-success);
}
.ya-short .sg-result__value {
  color: var(--sg-danger);
}

/* 金額 + 「円」 */
.ya-yen {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ya-yen .sg-input {
  flex: 1 1 auto;
  min-width: 0;
}

/* 種類 + 金額 */
.ya-row {
  display: flex;
  gap: 8px;
}
.ya-type {
  flex: 0 0 auto;
  width: auto;
  max-width: 48%;
}
.ya-amt {
  flex: 1 1 auto;
  min-width: 0;
}

/* 入力の格子（2列 → 狭い画面は1列） */
.ya-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  align-items: end;
}
.ya-grid--3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.ya-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.ya-item .sg-input,
.ya-item .sg-select {
  min-width: 0;
  width: 100%;
}
.ya-sub {
  font-size: 0.85rem;
  color: var(--sg-muted);
  line-height: 1.5;
}
@media (max-width: 520px) {
  .ya-grid,
  .ya-grid--3 {
    grid-template-columns: 1fr;
  }
}

.ya-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}
.ya-check input {
  width: 1.1em;
  height: 1.1em;
  flex: 0 0 auto;
  margin-top: 0.2em;
}

/* 特定親族 */
.ya-srlist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.ya-sr {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* 源泉徴収の目安（折りたたみ） */
.ya-est {
  margin-top: 8px;
  border: 1px solid var(--sg-border);
  border-radius: var(--sg-radius);
  background: var(--sg-surface-2);
}
.ya-est > summary {
  cursor: pointer;
  padding: 10px 12px;
  font-weight: 600;
}
.ya-est__body {
  padding: 4px 12px 12px;
}
.ya-est__out {
  margin: 10px 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.ya-est__out:empty {
  display: none;
}

/* 控除の内訳 */
.ya-table-wrap {
  overflow-x: auto;
}
.ya-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.ya-table th,
.ya-table td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--sg-border);
}
.ya-table th {
  border-bottom-width: 2px;
}
.ya-table td:nth-child(2),
.ya-table td:nth-child(3),
.ya-table th:nth-child(2),
.ya-table th:nth-child(3) {
  text-align: right;
  white-space: nowrap;
}
.ya-table .ya-sum td {
  font-weight: 700;
  border-top: 2px solid var(--sg-border);
}
.ya-table .ya-taxcredit td {
  color: var(--sg-primary);
}

.ya-notes,
.ya-list {
  margin: 12px 0 0;
  padding-left: 1.2em;
  line-height: 1.75;
}
.ya-notes li,
.ya-list li {
  margin: 4px 0;
}
.ya-notes {
  font-size: 0.9rem;
  color: var(--sg-muted);
}
