/* 消費税計算 */
.tx__controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--az-space-3); margin-bottom: var(--az-space-4); }
.tx__mode { display: inline-flex; align-items: center; gap: var(--az-space-2); font-size: var(--az-text-sm); color: var(--az-color-text-secondary); white-space: nowrap; }
.tx__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: var(--az-space-5); align-items: start; }
.tx__amount { display: flex; align-items: center; gap: var(--az-space-2); }
.tx__amount .az-input { flex: 1; min-width: 0; font-size: var(--az-text-xl); font-variant-numeric: tabular-nums; text-align: right; }
.tx__amount span { color: var(--az-color-text-secondary); }
.tx__result { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--az-space-2); }
.tx__result .az-stat { padding: var(--az-space-3) var(--az-space-4); gap: var(--az-space-1); }
.tx__result .az-stat__label { font-size: var(--az-text-xs); }
.tx__result .az-stat__value { font-size: var(--az-text-xl); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.tx__result .az-stat[data-main="true"] { background: var(--az-color-primary-subtle); border-color: var(--az-color-primary-border); }
.tx__result .az-stat[data-main="true"] .az-stat__value { font-size: var(--az-text-2xl); color: var(--az-color-primary-text); }
.tx__formula { display: flex; gap: var(--az-space-2); margin: var(--az-space-3) 0 0; padding: var(--az-space-3) var(--az-space-4); font-size: var(--az-text-sm); color: var(--az-color-text-secondary); background: var(--az-color-bg-subtle); border-radius: var(--az-radius-md); overflow-wrap: anywhere; }
.tx__formula b { flex: none; color: var(--az-color-text-default); }
.tx__compare { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--az-space-3); margin-top: var(--az-space-4); justify-items: start; }
.tx__compare .az-table-wrap { width: 100%; }
.tx__compare caption, .tx__sum caption { padding-bottom: var(--az-space-2); font-size: var(--az-text-sm); }
.tx__compare td small, .tx__sum th small { display: block; font-size: var(--az-text-xs); color: var(--az-color-text-muted); font-weight: var(--az-font-weight-regular); }
.tx__cur th { color: var(--az-color-text-strong); }
.az-table td.tx__hit { background: var(--az-color-primary-subtle); font-weight: var(--az-font-weight-bold); }
.az-table tbody tr:hover td.tx__hit { background: var(--az-color-primary-subtle-hover); }

.tx-inv__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--az-space-3); margin-bottom: var(--az-space-3); }
.tx-inv__actions { display: flex; gap: var(--az-space-1); }
.tx__head, .tx__line { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) 4.5rem 7.5rem minmax(0, 1.1fr) 2.25rem; gap: var(--az-space-2); align-items: center; }
.tx__head { padding: 0 0 var(--az-space-1); font-size: var(--az-text-xs); color: var(--az-color-text-muted); }
.tx__lines { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--az-space-2); }
.tx__price, .tx__qty { text-align: right; font-variant-numeric: tabular-nums; }
.tx__sub { text-align: right; font-variant-numeric: tabular-nums; color: var(--az-color-text-strong); overflow-wrap: anywhere; }
.tx__add { margin-top: var(--az-space-3); }
.tx__err { margin-top: var(--az-space-2); white-space: normal; }
.tx-inv__out { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--az-space-4); margin-top: var(--az-space-5); align-items: start; }
.tx-inv__out > .az-button { grid-column: 1 / -1; justify-self: start; }
.az-table .tx__total th, .az-table .tx__total td { font-weight: var(--az-font-weight-bold); background: var(--az-color-bg-subtle); }
.tx__sum tbody th { text-align: left; font-weight: var(--az-font-weight-medium); color: var(--az-color-text-default); background: transparent; white-space: normal; }
.tx__sum tbody tr + tr th { border-top: 1px solid var(--az-color-border-divider); }
.tx__diff { font-size: var(--az-text-sm); color: var(--az-color-text-secondary); }
.tx__diff-head { margin: 0 0 var(--az-space-2); padding: var(--az-space-3) var(--az-space-4); border-radius: var(--az-radius-md); background: var(--az-color-bg-subtle); color: var(--az-color-text-default); }
.tx__diff-head.is-diff { background: var(--az-color-warning-bg); color: var(--az-color-warning-text); }
.tx__diff ul { margin: 0; padding-left: 1.25em; }

@media (max-width: 900px) {
  .tx__grid, .tx-inv__out { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .tx__head { display: none; }
  .tx__line { grid-template-columns: minmax(0, 1fr) 4rem 2.25rem; padding: var(--az-space-3); border: 1px solid var(--az-color-border-subtle); border-radius: var(--az-radius-md); }
  .tx__name { grid-column: 1 / 3; }
  .tx__del { grid-column: 3; grid-row: 1; }
  .tx__price { grid-column: 1; }
  .tx__qty { grid-column: 2; }
  .tx__rate { grid-column: 1; }
  .tx__sub { grid-column: 2 / 4; }
  .tx__result { grid-template-columns: 1fr; }
  .tx__result .az-stat { flex-direction: row; display: flex; align-items: baseline; justify-content: space-between; }
}
