/* v79 月次収支管理：印刷対象選択（画面表示のみ） */
.lf-wp-print-toolbar {display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.lf-wp-print-toolbar button {white-space:nowrap;}
.lf-wp-print-overlay[hidden], #lfWriterPayoutPrintDocument {display:none!important;}
.lf-wp-print-overlay {position:fixed;inset:0;z-index:15000;background:rgba(17,24,39,.55);display:flex;align-items:center;justify-content:center;padding:20px;}
.lf-wp-print-dialog {width:min(570px,96vw);max-height:92vh;overflow:auto;background:#fff;border-radius:14px;padding:20px;color:#1f2937;box-shadow:0 20px 55px rgba(0,0,0,.22);}
.lf-wp-print-dialog h3 {margin:0;font-size:1.14rem;}
.lf-wp-print-dialog p {margin:8px 0 16px;color:#4b5563;font-size:.9rem;}
.lf-wp-print-controls {display:flex;gap:10px;flex-wrap:wrap;margin:10px 0;}
.lf-wp-print-month-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:12px 0 18px;}
.lf-wp-print-month {display:flex;gap:7px;align-items:center;padding:9px 11px;border:1px solid #d1d5db;border-radius:8px;cursor:pointer;font-weight:600;font-size:.9rem;}
.lf-wp-print-month:has(input:checked){background:#eef5ff;border-color:#3563bd;}
.lf-wp-print-month input{margin:0;accent-color:#3563bd;}
.lf-wp-print-actions {display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap;}
.lf-wp-print-status {padding:9px;color:#22488d;background:#eaf2ff;border-radius:8px;margin:10px 0;}
.lf-wp-print-status.is-error {color:#9b1c1c;background:#fff1f0;}
@media(max-width:590px){.lf-wp-print-month-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
/* v80：A4縦・明朝体・1か月1ページの印刷専用スタイル */
@media print {
  @page { size: A4 portrait; margin: 5mm; }
  html, body {
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }
  body.lf-wp-printing > *:not(#lfWriterPayoutPrintDocument) { display: none !important; }
  body.lf-wp-printing #lfWriterPayoutPrintDocument {
    display: block !important;
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .lf-wp-print-sheet {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    break-after: page;
    page-break-after: always;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .lf-wp-print-sheet:last-child { break-after: auto; page-break-after: auto; }
  .lf-wp-print-sheet table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: fixed;
    font-family: 'Yu Mincho', 'Hiragino Mincho ProN', 'Noto Serif CJK JP', 'MS PMincho', serif !important;
    font-size: var(--wp-font, 7pt) !important;
    line-height: 1.13;
    color: #111;
    font-variant-numeric: tabular-nums;
  }
  .lf-wp-print-sheet caption {
    caption-side: top;
    text-align: center;
    font-family: inherit;
    font-size: var(--wp-title-font, 10pt);
    font-weight: bold;
    padding: 0 0 2mm;
    margin: 0;
  }
  .lf-wp-print-sheet th,
  .lf-wp-print-sheet td {
    box-sizing: border-box;
    border: 0.3pt solid #777;
    text-align: right;
    vertical-align: middle;
    padding: var(--wp-pad, 0.65mm) 0.38mm;
    overflow-wrap: anywhere;
    word-break: normal;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1.13;
  }
  .lf-wp-print-sheet th:first-child,
  .lf-wp-print-sheet td:first-child {
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .lf-wp-print-sheet thead th {
    background: #ededed !important;
    font-weight: bold;
    text-align: center;
    white-space: normal;
    font-size: var(--wp-heading-font, 6.4pt) !important;
    line-height: 1.2;
    padding: 1mm 0.3mm;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .lf-wp-print-sheet tbody tr:nth-child(even) {
    background: #fafafa !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  /* 合計行の大きな金額はセル内で改行し、隣の金額と重ねない。 */
  .lf-wp-print-sheet .lf-wp-print-total td,
  .lf-wp-print-sheet .lf-wp-print-total th {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .lf-wp-print-sheet .lf-wp-print-total {
    background: #e5e5e5 !important;
    font-weight: bold;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .lf-wp-print-sheet tbody tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* v87: サイト本来の白・グレージュ・チャコールに合わせた穏やかな操作バー。
   全ボタンの角丸を広げ、クリック領域と操作の判別性は維持。 */
#writerPayoutPanel .writer-payout-toolbar {
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:12px;
}
#writerPayoutPanel .writer-payout-toolbar > div:first-child {
  min-width:0;
}
#writerPayoutPanel .writer-payout-toolbar .writer-article-count-toolbar-actions {
  width:100%;
  display:flex;
  flex-wrap:wrap;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:12px 14px;
  background:#f8f7f5;
  border:1px solid #e8e4de;
  border-radius:16px;
}
#writerPayoutPanel .lf-wp-print-toolbar {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:flex-end;
  gap:9px;
}
#writerPayoutPanel .lf-wp-action-btn {
  box-sizing:border-box;
  appearance:none;
  display:inline-flex;
  justify-content:center;
  align-items:center;
  gap:7px;
  white-space:nowrap;
  min-height:43px;
  padding:10px 15px;
  border:1px solid;
  border-radius:16px;
  font:inherit;
  font-size:12px;
  font-weight:750;
  line-height:1.2;
  letter-spacing:.01em;
  box-shadow:0 1px 3px rgba(43,38,32,.075);
  cursor:pointer;
  transition:background-color .16s ease, border-color .16s ease, transform .12s ease, box-shadow .16s ease;
}
#writerPayoutPanel .lf-wp-action-btn span[aria-hidden] {
  font-size:17px;
  font-weight:750;
  line-height:1;
}
/* 主操作だけチャコール。残りは落ち着いた淡色の面で用途を区別。 */
#writerPayoutPanel .lf-wp-btn-print {
  background:#484540;
  color:#fff;
  border-color:#484540;
}
#writerPayoutPanel .lf-wp-btn-multi {
  background:#ece8e2;
  color:#45413c;
  border-color:#d5cdc3;
}
#writerPayoutPanel .lf-wp-btn-excel {
  background:#eaf0eb;
  color:#355943;
  border-color:#cddbd0;
}
#writerPayoutPanel .lf-wp-btn-reload {
  background:#fff;
  color:#59534c;
  border-color:#d9d3cb;
}
#writerPayoutPanel .lf-wp-action-btn:hover:not(:disabled) {
  transform:translateY(-1px);
  box-shadow:0 3px 7px rgba(43,38,32,.13);
}
#writerPayoutPanel .lf-wp-btn-print:hover:not(:disabled) {background:#373531;}
#writerPayoutPanel .lf-wp-btn-multi:hover:not(:disabled) {background:#e5dfd7;border-color:#bfb4a8;}
#writerPayoutPanel .lf-wp-btn-excel:hover:not(:disabled) {background:#e0e9e1;border-color:#b2c7b7;}
#writerPayoutPanel .lf-wp-btn-reload:hover:not(:disabled) {background:#f5f3ef;border-color:#c6beb5;}
#writerPayoutPanel .lf-wp-action-btn:active:not(:disabled) {transform:translateY(0);box-shadow:0 1px 2px rgba(43,38,32,.1);}
#writerPayoutPanel .lf-wp-action-btn:focus-visible {
  outline:3px solid rgba(185,127,76,.45);
  outline-offset:3px;
}
#writerPayoutPanel .lf-wp-action-btn:disabled {opacity:.55;cursor:wait;}
#writerPayoutPanel .lf-wp-export-message {
  padding:10px 14px;
  border-radius:12px;
  margin:6px 0;
  border:1px solid #d0dacd;
  background:#f2f7f0;
  color:#355943;
  font-size:12px;
  font-weight:700;
}
#writerPayoutPanel .lf-wp-export-message.is-error {
  border-color:#e6bfc0;
  background:#fcf2f1;
  color:#972323;
}
@media (max-width:1080px) {
  #writerPayoutPanel .writer-payout-toolbar .writer-article-count-toolbar-actions {flex-direction:column;align-items:stretch;}
  #writerPayoutPanel .lf-wp-print-toolbar {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));}
  #writerPayoutPanel .lf-wp-action-btn {white-space:normal;}
}
@media (max-width:400px) {
  #writerPayoutPanel .lf-wp-action-btn {font-size:11px;min-height:46px;padding:9px 8px;}
}
@media (prefers-reduced-motion:reduce) {
  #writerPayoutPanel .lf-wp-action-btn {transition:none;}
}
