/* 帳票と外部連携。style.css・flow.css・fm.css の上に重ねる（接頭辞 fo-。よいは緑、注意は琥珀、だめは赤） */
.fo-k { margin: 0 0 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.fo-lead { margin: 0 0 10px; font-size: 13.5px; color: var(--ink2); max-width: 56em; }
.fo-small { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.fo-n { text-align: right; font-family: var(--latin); white-space: nowrap; }
.fo-res { margin: 8px 0 0; font-size: 13px; font-weight: 700; border-radius: 8px; padding: 7px 11px; }
.fo-res.fo-ok { background: #f0fdf4; color: #14532d; }
.fo-res.fo-mid { background: #fffbeb; color: #78350f; }
.fo-res.fo-ng { background: #fef2f2; color: #7f1d1d; }
.fo-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.fo-score { margin: 0; font-size: 13px; font-weight: 700; color: var(--ink2); }

/* 帳票（改ページと税額） */
.fo-bar { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-bottom: 10px; }
.fo-pages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: start; }
.fo-page { background: #fffef9; border: 1px solid #e7e2cf; border-radius: 10px; padding: 10px 12px; min-width: 0; box-shadow: 0 1px 2px rgba(15, 23, 42, .05); }
.fo-page header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; border-bottom: 1px solid #e7e2cf; padding-bottom: 4px; }
.fo-page header b { font-size: 13.5px; }
.fo-page header span { font: 600 12px var(--latin); color: var(--muted); }
.fo-meta { margin: 4px 0 6px; font-size: 11.5px; color: var(--ink2); }
.fo-carry { margin: 4px 0; font-size: 12px; font-weight: 700; color: #92400e; }
.fo-ptable { width: 100%; border-collapse: collapse; font-size: 12px; }
.fo-ptable th, .fo-ptable td { padding: 3px 4px; border-bottom: 1px solid #efe9d6; text-align: left; vertical-align: top; }
.fo-ptable th { font-size: 11px; color: var(--muted); }
.fo-ptable .fo-n { text-align: right; }
.fo-ptax { margin: 6px 0 0; font-size: 12px; color: #991b1b; }
.fo-tot { margin: 8px 0 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; font-size: 12.5px; }
.fo-tot dt { font-weight: 700; color: var(--muted); }
.fo-tot dd { margin: 0; font-family: var(--latin); }
.fo-tot b { font-size: 14px; }
.fo-mark { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); }

/* Excel で開かれるとき */
.fo-sheetwrap { overflow-x: auto; margin: 10px 0; }
.fo-sheet { border-collapse: collapse; font-size: 13px; background: var(--paper); min-width: 560px; }
.fo-sheet th, .fo-sheet td { border: 1px solid #d4d9e2; padding: 0; text-align: left; }
.fo-sheet thead th, .fo-sheet .fo-rh { background: #f1f5f9; color: var(--muted); font: 600 11.5px var(--latin); text-align: center; padding: 3px 8px; }
.fo-sheet tbody td { padding: 0; min-width: 7.5em; }
.fo-sheet tbody tr:first-child td { padding: 4px 8px; font-size: 12px; font-weight: 700; color: var(--ink2); }
.fo-cell { appearance: none; display: block; width: 100%; border: 0; background: transparent; font: 600 13px var(--latin); color: var(--ink); text-align: left; padding: 6px 8px; cursor: pointer; }
.fo-cell:hover { background: #f8fafc; }
.fo-cell.fo-chg { background: #fff7ed; color: #9a3412; }
.fo-cell.fo-sel { outline: 2px solid #16a34a; outline-offset: -2px; }
.fo-cell:focus-visible { outline: 3px solid #2563eb; outline-offset: -3px; }
.fo-xlout { padding: 12px 14px; margin-bottom: 10px; }
.fo-xlout h3 { margin: 0 0 6px; font-size: 14px; }
.fo-xlout > p { margin: 6px 0 0; font-size: 13px; color: var(--ink2); }
.fo-dl { margin: 0; display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 3px 10px; font-size: 13px; }
.fo-dl dt { font-weight: 700; color: var(--muted); font-size: 12px; padding-top: 1px; }
.fo-dl dd { margin: 0; color: var(--ink2); overflow-wrap: anywhere; }
.fo-dl code, .fo-segt code, .fo-small code, .fo-fcard code { font: 600 12px var(--latin); background: var(--line2); border-radius: 5px; padding: 0 5px; overflow-wrap: anywhere; }

/* 練習（文字化け・API） */
.fo-quiz { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fo-qz { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.fo-qz.fo-ok { border-color: #86efac; }
.fo-qz.fo-ng { border-color: #fca5a5; }
.fo-q { margin: 0; font-size: 13.5px; display: flex; gap: 7px; align-items: baseline; }
.fo-q i { font-style: normal; flex: none; width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font: 600 11px var(--latin); background: #e2e8f0; color: #334155; }
.fo-saw { margin: 0; font: 500 14px/1.6 var(--latin); background: #0f172a; color: #fde68a; border-radius: 8px; padding: 7px 10px; overflow-wrap: anywhere; }
.fo-bytes { margin: 0; font: 500 11.5px var(--latin); color: var(--muted); overflow-wrap: anywhere; }
.fo-qopts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.fo-qopt { appearance: none; font: inherit; font-size: 12px; text-align: left; cursor: pointer; border: 1px solid var(--line); background: #f8fafc; border-radius: 9px; padding: 6px 9px; color: var(--ink); line-height: 1.5; }
.fo-qopt:hover { border-color: #94a3b8; }
.fo-qopt[aria-pressed="true"] { background: #0f172a; border-color: #0f172a; color: #fff; }
.fo-qopt:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
.fo-fb { margin: 0; font-size: 12.5px; border-radius: 8px; padding: 6px 10px; background: var(--line2); color: var(--ink2); }
.fo-qz.fo-ok .fo-fb, .fo-fb.fo-good { background: #f0fdf4; color: #14532d; }
.fo-qz.fo-ng .fo-fb, .fo-fb.fo-miss { background: #fef2f2; color: #7f1d1d; }
.fo-qz .srcl, .fo-qz .fm-go { margin: 0; }

/* 全銀協の形式 */
.fo-zg { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 12px; align-items: start; margin-top: 10px; }
.fo-zgin, .fo-zgout { padding: 12px 14px; min-width: 0; }
.fo-zgout h3 { margin: 0 0 6px; font-size: 14px; }
.fo-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; margin-top: 10px; }
.fo-fields label, .fo-zgin > label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 700; color: var(--muted); min-width: 0; }
.fo-fields label[hidden] { display: none; }
.fo-wide { grid-column: 1 / -1; }
.fo-zgin > label { margin-top: 10px; }
.fo-fields input, .fo-fields select, .fo-zgin textarea { font: 500 13.5px var(--latin); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: var(--paper); min-width: 0; width: 100%; }
.fo-zgin textarea { resize: vertical; word-break: break-all; }
.fo-fields .fo-inl { flex-direction: row; align-items: center; gap: 6px; color: var(--ink2); grid-column: 1 / -1; }
.fo-fields .fo-inl input { width: auto; }
.fo-fields input:focus-visible, .fo-fields select:focus-visible, .fo-zgin textarea:focus-visible { outline: 3px solid #2563eb; outline-offset: 1px; }
.fo-rec { font: 500 13px/1.9 var(--latin); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; overflow-wrap: anywhere; word-break: break-all; }
.fo-rec span { border-radius: 3px; padding: 1px 0; }
.fo-errs, .fo-notes { margin: 8px 0 0; padding-left: 1.2em; font-size: 12.5px; display: grid; gap: 2px; }
.fo-errs { color: #991b1b; }
.fo-notes { color: var(--ink2); }
.fo-segt { margin-top: 8px; font-size: 12.5px; }
.fo-segt td, .fo-segt th { padding: 4px 6px; }
.fo-pos { font-family: var(--latin); white-space: nowrap; font-size: 12px; }
.fm-table tr.fo-bad td { background: #fef2f2; color: #7f1d1d; }
.fo-filebox { display: grid; gap: 6px; }
.fo-fline { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 8px; align-items: start; }
.fo-ftag { font-size: 12.5px; font-weight: 700; display: flex; flex-direction: column; padding-top: 6px; }
.fo-ftag small { font: 500 11px var(--latin); color: var(--muted); }

/* API とファイル */
.fo-cmp th:first-child { min-width: 7em; }
.fo-cmp td, .fo-cmp th { font-size: 12.5px; }

/* 受け渡しの運用 */
.fo-ops { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; margin-bottom: 10px; }
.fo-opsl { min-width: 0; }
.fo-fcard { padding: 12px 14px; }
.fo-fcard h3 { margin: 0 0 2px; font-size: 14px; }
.fo-at { margin: 0; font-size: 12.5px; color: var(--muted); }
.fo-note { margin: 6px 0 0; font-size: 12.5px; color: #78350f; background: #fffbeb; border-radius: 8px; padding: 6px 10px; }
.fo-ftable { margin-top: 8px; font-size: 12.5px; }
.fo-trailer { margin: 8px 0 0; font: 600 12.5px var(--latin); color: var(--ink); background: var(--line2); border-radius: 8px; padding: 5px 10px; }
.fo-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.fo-act { appearance: none; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 8px 14px; color: var(--ink); }
.fo-act:hover { border-color: #94a3b8; }
.fo-act[data-o="stop"] { color: #991b1b; }
.fo-act:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
.fo-fcard > .fo-res:first-child { margin: 0 0 8px; }
.fo-ledger { padding: 12px 14px; position: sticky; top: 12px; min-width: 0; }
.fo-ledger h3 { margin: 0 0 4px; font-size: 14px; }
.fo-ltable { margin-top: 6px; font-size: 12.5px; }
.fm-table tr.fo-cx td { color: var(--muted); text-decoration: line-through; }
.fo-sum { margin: 8px 0 0; font-size: 13px; font-weight: 700; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fo-warn { font-size: 11.5px; background: #fee2e2; color: #991b1b; border-radius: 999px; padding: 1px 9px; }

/* 仕様書 */
.fo-spec { padding: 12px 14px; }
.fo-spec h3 { margin: 0 0 8px; font-size: 14px; }
.fo-specl { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.fo-specl li { display: grid; gap: 4px; min-width: 0; }
.fo-sitem { appearance: none; font: inherit; text-align: left; cursor: pointer; width: 100%; border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 7px 10px; color: var(--ink); display: grid; grid-template-columns: 8.5em minmax(0, 1fr) auto; gap: 8px; align-items: baseline; }
.fo-sitem b { font-size: 13px; }
.fo-sitem span { font-size: 12.5px; color: var(--ink2); overflow-wrap: anywhere; }
.fo-sitem em { font-style: normal; font-size: 11px; font-weight: 700; color: #92400e; }
.fo-sitem:hover { border-color: #94a3b8; }
.fo-sitem[aria-pressed="true"] { background: #fffbeb; border-color: #f59e0b; }
.fo-sitem:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }

@media (max-width: 1100px) {
  .fo-pages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fo-zg { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .fo-pages, .fo-quiz, .fo-ops, .fo-specl, .fo-qopts, .fo-fields { grid-template-columns: minmax(0, 1fr); }
  .fo-ledger { position: static; }
  .fo-fline { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .fo-sitem { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .fo-dl { grid-template-columns: minmax(0, 1fr); gap: 0 10px; }
  .fo-dl dd { margin-bottom: 4px; }
  .fo-segt { min-width: 470px; }
}
