/* MT940 workspace — shared by /mt940-viewer, /mt940-to-csv, /mt940-to-json. */

.m9-wrap { max-width: 1400px; margin: 0 auto; padding: 24px 32px 40px; }

.m9-hero { text-align: center; margin-bottom: 20px; }
.m9-hero h1 { font-size: 32px; font-weight: 800; letter-spacing: -0.6px; margin-bottom: 8px; color: var(--text); }
.m9-hero p { color: var(--text-secondary); font-size: 15px; max-width: 680px; margin: 0 auto; line-height: 1.6; }

.m9-privacy { display: flex; gap: 10px; align-items: flex-start; max-width: 760px; margin: 0 auto 20px; padding: 12px 16px; border-radius: 10px; background: #ECFDF5; color: #065F46; font-size: 13.5px; line-height: 1.55; }
.m9-privacy svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }

.m9-drop { border: 2px dashed var(--border); border-radius: 14px; background: var(--surface); padding: 36px 20px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.m9-drop:hover, .m9-drop:focus-visible, .m9-drop.is-over { border-color: #10B981; background: #F0FDF4; outline: none; }
.m9-drop-icon { font-size: 40px; line-height: 1; margin-bottom: 10px; }
.m9-drop-title { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.m9-drop-sub { font-size: 13.5px; color: var(--text-secondary); margin-bottom: 14px; }
.m9-drop-note { font-size: 12px; color: var(--text-muted); margin-top: 12px; }

.m9-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; font-family: inherit; font-size: 14px; font-weight: 600; border-radius: 8px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text-secondary); cursor: pointer; text-decoration: none; transition: all .15s; }
.m9-btn:hover { border-color: #10B981; color: #047857; background: #ECFDF5; }
.m9-btn-primary { background: #10B981; border-color: #10B981; color: #fff; }
.m9-btn-primary:hover { background: #059669; border-color: #059669; color: #fff; }
.m9-btn-ghost { border-color: transparent; }

.m9-paste { max-width: 760px; margin: 14px auto 0; font-size: 13.5px; }
.m9-paste > summary { cursor: pointer; color: var(--text-secondary); font-weight: 600; padding: 6px 0; }
.m9-paste textarea { width: 100%; min-height: 150px; margin: 10px 0; padding: 12px 14px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.5; border: 1.5px solid var(--border); border-radius: 10px; background: #FAFBFF; color: #1A1D26; resize: vertical; }

.m9-error { margin: 18px auto 0; max-width: 760px; padding: 14px 16px; border-radius: 10px; background: #FEE2E2; color: #991B1B; font-size: 14px; font-weight: 600; line-height: 1.55; }

.m9-result { margin-top: 24px; }

.m9-filebar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border: 1.5px solid var(--border); border-radius: 12px 12px 0 0; background: var(--bg); border-bottom: 0; }
.m9-filename { font-weight: 700; font-size: 14.5px; color: var(--text); word-break: break-all; }
.m9-spacer { flex: 1; }
.m9-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.m9-badge { font-size: 11.5px; font-weight: 700; letter-spacing: .3px; padding: 3px 9px; border-radius: 999px; background: #E0E7FF; color: #3730A3; }
.m9-badge.is-ok { background: #DCFCE7; color: #166534; }
.m9-badge.is-warn { background: #FEF3C7; color: #92400E; }

.m9-warnings { border: 1.5px solid #FCD34D; border-top: 0; background: #FFFBEB; padding: 12px 16px; }
.m9-warnings-head { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: #92400E; margin-bottom: 6px; }
.m9-warnings ul { margin: 0; padding-left: 18px; }
.m9-warnings li { font-size: 13.5px; line-height: 1.55; color: #78350F; margin-bottom: 4px; }

.m9-tabs { display: flex; gap: 2px; border: 1.5px solid var(--border); border-bottom: 0; background: var(--bg); padding: 0 8px; }
.m9-tab { padding: 11px 16px; font-family: inherit; font-size: 13.5px; font-weight: 700; border: 0; background: none; color: var(--text-muted); cursor: pointer; border-bottom: 2.5px solid transparent; }
.m9-tab:hover { color: var(--text); }
.m9-tab.is-active { color: #047857; border-bottom-color: #10B981; }

.m9-panel { border: 1.5px solid var(--border); border-radius: 0 0 12px 12px; background: var(--surface); padding: 16px; }

.m9-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.m9-card { padding: 12px 14px; border: 1.5px solid var(--border-light, var(--border)); border-radius: 10px; background: var(--bg); }
.m9-card-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin-bottom: 4px; }
.m9-card-value { font-size: 17px; font-weight: 800; color: var(--text); word-break: break-word; }
.m9-card-value.is-pos { color: #047857; }
.m9-card-value.is-neg { color: #B91C1C; }
.m9-card-sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

.m9-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.m9-search { flex: 1 1 260px; padding: 9px 13px; font-family: inherit; font-size: 14px; border: 1.5px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.m9-select { padding: 9px 12px; font-family: inherit; font-size: 14px; border: 1.5px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); cursor: pointer; }
.m9-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-secondary); cursor: pointer; user-select: none; }
.m9-count { font-size: 13px; color: var(--text-muted); font-weight: 600; }

.m9-stmt { margin-bottom: 22px; }
.m9-stmt-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; padding-bottom: 8px; margin-bottom: 10px; border-bottom: 1.5px solid var(--border); }
.m9-stmt-title { font-size: 16px; font-weight: 800; color: var(--text); }
.m9-stmt-meta { font-size: 13px; color: var(--text-muted); }

.m9-recon { padding: 10px 14px; border-radius: 9px; font-size: 13.5px; font-weight: 600; line-height: 1.5; margin-bottom: 12px; }
.m9-recon.is-ok { background: #DCFCE7; color: #166534; }
.m9-recon.is-mismatch { background: #FEE2E2; color: #991B1B; }
.m9-recon.is-unknown { background: #F1F5F9; color: #475569; }

.m9-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.m9-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 720px; }
.m9-table th { text-align: left; padding: 8px 10px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); border-bottom: 1.5px solid var(--border); white-space: nowrap; }
.m9-table td { padding: 9px 10px; border-bottom: 1px solid var(--border-light, #EEF1F6); vertical-align: top; color: var(--text); }
.m9-table tbody tr:hover { background: #F8FAFC; }
.m9-table .m9-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 700; }
.m9-table .m9-num.is-pos { color: #047857; }
.m9-table .m9-num.is-neg { color: #B91C1C; }
.m9-table .m9-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.m9-desc { font-weight: 600; }
.m9-sub { display: block; font-size: 12px; font-weight: 400; color: var(--text-muted); margin-top: 2px; word-break: break-word; }
.m9-type { font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 5px; background: #EEF2FF; color: #4338CA; white-space: nowrap; }
.m9-rev { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 5px; background: #FEF3C7; color: #92400E; margin-left: 4px; }

.m9-more { background: none; border: 0; padding: 0; font-family: inherit; font-size: 12px; font-weight: 700; color: #4338CA; cursor: pointer; margin-top: 4px; }
.m9-detail td { background: #F8FAFC; }
.m9-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 6px 18px; margin: 0; }
.m9-fields div { font-size: 12.5px; line-height: 1.5; word-break: break-word; }
.m9-fields dt { font-weight: 700; color: var(--text-muted); }
.m9-fields dd { margin: 0; color: var(--text); }
.m9-raw { margin-top: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; color: var(--text-muted); white-space: pre-wrap; word-break: break-all; }

.m9-empty { padding: 28px 16px; text-align: center; color: var(--text-muted); font-size: 14px; }

.m9-code { max-height: 520px; overflow: auto; margin: 0; padding: 14px 16px; border-radius: 10px; background: #FAFBFF; border: 1.5px solid var(--border); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.55; color: #1A1D26; white-space: pre; }

.m9-handoff { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: var(--bg); border: 1.5px solid var(--border); font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.m9-handoff small { flex-basis: 100%; font-weight: 400; font-size: 12px; color: var(--text-muted); }

.m9-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(16px); padding: 11px 20px; border-radius: 10px; background: #111827; color: #fff; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 60; }
.m9-toast.is-shown { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ==================================================================
 |  Analysis + transform tools
 |
 |  The validator, reconciliation report, duplicate finder, diff,
 |  anonymiser, splitter and merger share the .m9-* system above and
 |  add only what their own input and output shapes need.
 * ================================================================== */

/* Two-file input (diff) */
.m9-pair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.m9-drop-sm { padding: 26px 18px; }
.m9-drop-sm .m9-drop-icon { font-size: 30px; }
.m9-drop-sm .m9-drop-sub { margin-bottom: 0; word-break: break-all; }
.m9-drop-tag { display: inline-block; margin-left: 6px; padding: 2px 7px; border-radius: 999px; background: var(--bg); font-size: 11px; font-weight: 700; color: var(--text-muted); vertical-align: middle; }
.m9-drop.is-loaded { border-style: solid; border-color: #34D399; background: #F0FDF4; }
.m9-pair-vs { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); }
.m9-pair-go { margin-top: 14px; text-align: center; }

/* Many-file input (merger) */
.m9-filelist { margin-top: 14px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; }
.m9-filelist-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--bg); border-bottom: 1.5px solid var(--border); font-size: 13px; font-weight: 700; color: var(--text-secondary); }
.m9-filelist ul { list-style: none; margin: 0; padding: 0; }
.m9-file { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border-light, #EEF1F6); }
.m9-file-name { font-size: 13.5px; font-weight: 600; color: var(--text); word-break: break-all; }
.m9-file-meta { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.m9-filelist-go { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; background: var(--bg); }

/* Output panel — same box the tabbed .m9-panel draws, without the tabs */
.m9-tools .m9-result > .m9-toolbar { padding: 12px 16px; border-left: 1.5px solid var(--border); border-right: 1.5px solid var(--border); background: var(--surface); }
.m9-out { border: 1.5px solid var(--border); border-radius: 0 0 12px 12px; background: var(--surface); padding: 16px; }
.m9-out > .m9-cards { margin-bottom: 4px; }

.m9-block { margin-top: 22px; }
.m9-block:first-child { margin-top: 0; }
.m9-block-title { font-size: 15px; font-weight: 800; color: var(--text); margin: 0 0 6px; }
.m9-block-note { font-size: 12.5px; line-height: 1.6; color: var(--text-muted); margin: 0 0 10px; }

/* Findings */
.m9-issues { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.m9-issue { padding: 11px 14px; border-radius: 10px; border: 1.5px solid var(--border); border-left-width: 4px; background: var(--bg); }
.m9-issue.is-error { border-left-color: #DC2626; background: #FEF2F2; }
.m9-issue.is-warning { border-left-color: #D97706; background: #FFFBEB; }
.m9-issue.is-info { border-left-color: #94A3B8; }
.m9-issue-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.m9-issue-sev { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; }
.m9-issue.is-error .m9-issue-sev { color: #B91C1C; }
.m9-issue.is-warning .m9-issue-sev { color: #B45309; }
.m9-issue.is-info .m9-issue-sev { color: #64748B; }
.m9-issue-where { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.m9-issue-msg { font-size: 13.5px; line-height: 1.55; color: var(--text); }

/* Verdict cards + in-table verdicts */
.m9-card-value.is-ok { color: #047857; }
.m9-card-value.is-bad { color: #B91C1C; }
.m9-card-value.is-warn { color: #B45309; }
.m9-table .m9-ok { color: #047857; font-weight: 700; white-space: nowrap; }
.m9-table .m9-bad { color: #B91C1C; font-weight: 700; white-space: nowrap; }
.m9-table .m9-muted { color: var(--text-muted); white-space: nowrap; }

/* Splitter parts */
.m9-parts { display: grid; gap: 8px; }
.m9-part { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--bg); }
.m9-part-info { flex: 1 1 240px; }
.m9-part-name { font-size: 13.5px; font-weight: 700; color: var(--text); word-break: break-all; }
.m9-part-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Anonymiser mapping — collapsed by default: it is the un-redacted data */
.m9-map { border: 1.5px solid var(--border); border-radius: 10px; background: var(--bg); padding: 10px 14px; }
.m9-map > summary { cursor: pointer; font-size: 13.5px; font-weight: 700; color: var(--text-secondary); }
.m9-map .m9-table { min-width: 420px; }

@media (max-width: 640px) {
    .m9-pair { grid-template-columns: 1fr; }
    .m9-pair-vs { text-align: center; }
    .m9-out { padding: 12px; }
}

@media (max-width: 768px) {
    .m9-wrap { padding: 20px 20px 40px; }
}

@media (max-width: 640px) {
    .m9-hero h1 { font-size: 25px; }
    .m9-panel { padding: 12px; }
    .m9-tabs { padding: 0 4px; }
    .m9-tab { padding: 10px 11px; font-size: 13px; }
}
