/* 給与計算。style.css と flow.css の上に重ねる（扱いの色: 入れる・かかるは緑、外すは灰、非課税は琥珀） */
.fhead p a, .srcl a, .py-go, .py-asklink a { color: #1d4ed8; text-underline-offset: 2px; }
.hint { display: inline-block; vertical-align: middle; font-size: 10.5px; font-weight: 700; line-height: 1.5; color: #475569; background: #f8fafc; border: 1px dashed #94a3b8; border-radius: 999px; padding: 0 8px; margin-left: 6px; white-space: nowrap; }
.aitag { font: 600 10.5px var(--latin); color: #5b21b6; background: #ede9fe; border-radius: 5px; padding: 1px 6px; margin-right: 6px; vertical-align: 1px; }
.srcl { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.py-sub { margin: 22px 0 8px; font-size: 15.5px; }
.py-subp { margin: 0 0 10px; font-size: 13px; color: var(--ink2); max-width: 60em; }
.py-golink { margin: 6px 0 0; font-size: 13px; font-weight: 700; }
.py-go { text-decoration: none; }
.py-go:hover { text-decoration: underline; }

/* カード */
.py-grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.py-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.py-card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; min-width: 0; }
.py-card h3 { margin: 0; font-size: 14px; }
.py-card p { margin: 5px 0 0; font-size: 13px; color: var(--ink2); }
.py-card .srcl, .py-card .py-golink { margin-top: auto; padding-top: 8px; }
.py-card .py-golink + .srcl { margin-top: 0; padding-top: 4px; }
.py-card.ai { background: #faf8ff; border-color: #dccdfb; }
.py-tip { font-size: 12.5px !important; background: var(--line2); border-radius: 8px; padding: 5px 9px; }

/* 切り替えのボタン */
.py-seg { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.py-seg.sm { margin: 0; }
.py-seg button, .py-rtabs button, .py-presets button, .py-tlist button { appearance: none; font: inherit; font-size: 13px; font-weight: 700; color: var(--ink2); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px; cursor: pointer; }
.py-seg button:hover, .py-rtabs button:hover, .py-presets button:hover { border-color: #94a3b8; color: var(--ink); }
.py-seg button[aria-pressed="true"], .py-rtabs button[aria-selected="true"], .py-presets button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.py-rtabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.py-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.py-prenote { margin: -4px 0 10px; font-size: 12.5px; color: #92400e; }
.py-prenote:empty { display: none; }

/* 業務の流れ */
.py-steps { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.py-sbtn { appearance: none; width: 100%; height: 100%; font: inherit; text-align: left; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 9px 10px; cursor: pointer; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 8px; align-items: center; }
.py-sbtn:hover { border-color: #94a3b8; }
.py-sbtn[aria-pressed="true"] { background: #0f172a; border-color: #0f172a; color: #fff; }
.py-sno { grid-row: span 2; width: 22px; height: 22px; border-radius: 50%; background: var(--line2); color: var(--ink2); font: 600 12px/22px var(--latin); text-align: center; }
.py-sbtn[aria-pressed="true"] .py-sno { background: #fbbf24; color: #0f172a; }
.py-sbtn b { font-size: 13.5px; }
.py-sbtn small { font-size: 11.5px; color: var(--muted); }
.py-sbtn[aria-pressed="true"] small { color: #cbd5e1; }
.py-step { padding: 14px 16px; }
.py-sk { margin: 0; font-size: 12px; font-weight: 700; color: var(--muted); }
.py-step h3 { margin: 4px 0 8px; font-size: 17px; }
.py-what { margin: 0; font-size: 13.5px; color: var(--ink2); }
.py-dl { margin: 0; display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 6px 12px; font-size: 13.5px; }
.py-dl dt { font-weight: 700; color: var(--muted); font-size: 12.5px; }
.py-dl dd { margin: 0; color: var(--ink2); }

/* 道具 1 */
.py-lab { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 14px; align-items: start; }
.py-in { padding: 12px 16px; display: grid; gap: 8px; }
.py-in fieldset { border: 0; margin: 0; padding: 0; }
.py-in legend { font-size: 12.5px; font-weight: 700; color: var(--ink); margin-bottom: 6px; padding: 0; }
.py-row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 10px; }
.py-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.py-field > span { font-size: 12px; font-weight: 700; color: var(--ink2); }
.py-in input[type="number"], .py-tax input[type="number"] { width: 100%; box-sizing: border-box; font: 600 15px var(--latin); color: var(--ink); background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 9px; padding: 6px 10px; }
.py-check { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ink2); cursor: pointer; align-self: end; padding-bottom: 6px; }
.py-check input { width: 17px; height: 17px; accent-color: #0d9488; }
.py-out { padding: 14px 16px; display: grid; gap: 12px; min-width: 0; }
.py-calc { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.py-calc > li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.py-calc > li:last-child { border-bottom: 0; padding-bottom: 0; }
.py-no { width: 24px; height: 24px; border-radius: 50%; background: #0d9488; color: #fff; font: 600 12px/24px var(--latin); text-align: center; }
.py-calc h4 { margin: 2px 0 4px; font-size: 14px; }
.py-f { margin: 0; font: 500 13px/1.7 var(--latin); color: var(--ink); overflow-wrap: anywhere; }
.py-s { margin: 4px 0 0; font-size: 12.5px; color: var(--ink2); }
.py-kv { margin: 4px 0 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 12px; font-size: 13px; }
.py-kv dt { font-weight: 700; color: var(--ink2); }
.py-kv dd { margin: 0; font-family: var(--latin); overflow-wrap: anywhere; }
.py-mini { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 2px; }
.py-mini th, .py-mini td { text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--line2); }
.py-mini thead th { font-size: 11.5px; color: var(--muted); }
.py-mini td { font-family: var(--latin); white-space: nowrap; }
.py-mini tbody th small { display: block; font: 500 11.5px var(--latin); color: var(--ink2); margin-top: 1px; }
.py-mini td:last-child, .py-mini th:last-child { text-align: right; }
.py-mini tfoot th, .py-mini tfoot td { border-bottom: 0; font-weight: 700; }
.py-total { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 8px; }
.py-total div { background: var(--line2); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.py-total small { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.py-total b { font: 600 19px var(--latin); }
.py-total span { font-size: 11.5px; color: var(--ink2); }
.py-total .net { background: #f0fdfa; }
.py-total .net b { color: #0f766e; }
.py-cnote { margin: 0; font-size: 12px; color: var(--muted); }

/* 道具 2 */
.py-tax { padding: 14px 16px; display: grid; gap: 12px; }
.py-taxin { display: grid; grid-template-columns: minmax(0, 1.4fr) auto minmax(0, .8fr); gap: 10px; align-items: end; }
.py-tax .py-calc { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.py-tax .py-calc > li { border: 1px solid var(--line2); border-radius: 10px; padding: 8px 10px; }
.py-tax .py-calc > li:last-child { padding-bottom: 8px; border-bottom: 1px solid var(--line2); }
.py-verdict { margin: 0; font-size: 13.5px; border-radius: 10px; padding: 9px 12px; background: var(--line2); color: var(--ink2); }
.py-verdict.ok { background: #f0fdf4; color: #14532d; }
.py-verdict.ng { background: #fef2f2; color: #7f1d1d; }
.py-verdict a { color: #1d4ed8; }

/* 項目の 4 つの扱い */
.py-matrix { padding: 12px 14px; display: grid; gap: 12px; }
.py-mwrap { overflow-x: auto; }
.py-mtable { width: 100%; border-collapse: collapse; font-size: 13px; }
.py-mtable th, .py-mtable td { text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--line2); }
.py-mtable thead th { font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); }
.py-mtable tbody th { font-weight: 700; white-space: nowrap; }
.py-cell { appearance: none; width: 100%; font: inherit; font-size: 12.5px; font-weight: 700; text-align: left; border-radius: 8px; padding: 5px 9px; cursor: pointer; border: 1px solid transparent; white-space: nowrap; }
.py-cell.in, .py-cv.in { background: #f0fdf4; color: #166534; }
.py-cell.out, .py-cv.out { background: #f1f5f9; color: #475569; }
.py-cell.free, .py-cv.free { background: #fffbeb; color: #92400e; }
.py-cell.na, .py-cv.na { background: transparent; color: var(--muted); }
.py-cell:hover { border-color: #94a3b8; }
.py-cell[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.py-mnote h3 { margin: 0 0 4px; font-size: 14.5px; }
.py-cv { border-radius: 6px; padding: 1px 8px; font-size: 13px; }
.py-mnote p { margin: 0; font-size: 13px; color: var(--ink2); }
.py-mnote .srcl { margin-top: 6px; }

/* データの形 */
.py-data { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 12px; align-items: start; }
.py-tlist { display: grid; gap: 6px; }
.py-tlist button { border-radius: 10px; text-align: left; display: flex; flex-direction: column; gap: 1px; padding: 8px 12px; }
.py-tlist button code { font: 600 13px var(--latin); color: #1d4ed8; }
.py-tlist button span { font-size: 12px; font-weight: 500; color: var(--ink2); }
.py-tlist button:hover { border-color: #94a3b8; }
.py-tlist button[aria-pressed="true"] { background: #eff6ff; border-color: #93c5fd; }
.py-tdetail { padding: 14px 16px; min-width: 0; }
.py-tdetail h3 { margin: 0 0 6px; font-size: 16px; }
.py-tdetail h3 code { font: 600 15px var(--latin); }
.py-tdetail > p { margin: 0 0 10px; font-size: 13.5px; color: var(--ink2); }
.py-cols { width: 100%; border-collapse: collapse; font-size: 13px; }
.py-cols th, .py-cols td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line2); vertical-align: top; }
.py-cols thead th { font-size: 11.5px; color: var(--muted); }
.py-cols td:first-child { white-space: nowrap; width: 1%; }
.py-cols code { font: 600 12.5px var(--latin); background: var(--line2); border-radius: 5px; padding: 0 5px; }

/* 質問 */
.py-ask { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; counter-reset: q; }
.py-ask li { counter-increment: q; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 10px 40px; position: relative; font-size: 13px; color: var(--ink2); }
.py-ask li::before { content: counter(q); position: absolute; left: 12px; top: 10px; width: 20px; height: 20px; border-radius: 50%; background: #0d9488; color: #fff; font: 600 11.5px/20px var(--latin); text-align: center; }
.py-ask li.py-asklink { background: var(--line2); border-style: dashed; }
.py-ask li.py-asklink::before { content: '→'; background: #475569; }

/* チェックリスト */
.cklist { padding: 10px 16px; }
.mlist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; }
.mlist label { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; cursor: pointer; padding: 5px 0; }
.mlist input { flex: none; width: 17px; height: 17px; margin: 2px 0 0; accent-color: #0d9488; cursor: pointer; }
.mlist input:checked + span { color: var(--muted); text-decoration: line-through; }
.ckfoot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.ckcount { font-family: var(--latin); font-size: 13px; color: var(--muted); }
.ckreset { appearance: none; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--ink2); cursor: pointer; }

.py-sbtn:focus-visible, .py-seg button:focus-visible, .py-rtabs button:focus-visible, .py-presets button:focus-visible, .py-tlist button:focus-visible, .py-cell:focus-visible, .py-in input:focus-visible, .py-tax input:focus-visible, .py-go:focus-visible, .srcl a:focus-visible, .fhead p a:focus-visible, .py-asklink a:focus-visible, .py-verdict a:focus-visible, .mlist input:focus-visible, .ckreset:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }

@media (max-width: 1200px) {
  .py-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .py-grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .py-grid3, .py-ask { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .py-lab, .py-data { grid-template-columns: minmax(0, 1fr); }
  .py-tax .py-calc { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .py-grid4, .py-grid3, .py-ask, .mlist { grid-template-columns: minmax(0, 1fr); }
  .py-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .py-dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .py-dl dd { margin-bottom: 6px; }
  .py-total { grid-template-columns: minmax(0, 1fr); }
  .py-kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .py-kv dd { margin-bottom: 5px; }
  .py-taxin { grid-template-columns: minmax(0, 1fr); }
  .py-tax .py-calc { grid-template-columns: minmax(0, 1fr); }
  .py-mini th, .py-mini td { padding: 5px 4px; }
  .py-tlist { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .py-tlist button code { font-size: 11.5px; overflow-wrap: anywhere; }
  .py-cols code { font-size: 11.5px; }
  .py-mtable thead th { white-space: normal; }
}
