/* Data Sanitizer — builds on the shared generator shell (cash-flow.css, pipeline.css). */
[hidden] { display: none !important; }
.sanitizer-workspace { grid-template-columns: minmax(20rem, .85fr) minmax(40rem, 1.9fr) minmax(20rem, .9fr); }
.import-panel, .review-panel { grid-row: span 2; }
.panel h3 { margin: 1.3rem 0 .5rem; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.import-actions { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }
.import-actions .import-button { font-weight: 900; font-size: .8rem; }
.paste-box { margin: .9rem 0; padding: .6rem .75rem; border: 1px dashed var(--line); border-radius: .7rem; }
.paste-box summary { cursor: pointer; color: var(--accent); font-weight: 800; font-size: .78rem; }
.paste-box textarea { display: block; width: 100%; margin: .6rem 0; padding: .6rem; border: 1px solid var(--line); border-radius: .55rem; background: var(--panel); color: var(--ink); font: .75rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; resize: vertical; }
.source-summary { display: flex; flex-direction: column; gap: .15rem; margin: .9rem 0 0; padding: .75rem .85rem; border-radius: .7rem; background: var(--soft); }
.source-summary strong { color: var(--accent); overflow-wrap: anywhere; }
.source-summary span { color: var(--muted); font-size: .75rem; }
.rule-toggles { display: grid; gap: .45rem; }
.rule-toggles label { display: flex; gap: .55rem; align-items: flex-start; font-size: .78rem; color: var(--ink); cursor: pointer; }
.rule-toggles input { margin-top: .15rem; accent-color: var(--accent); }
.option-field { display: grid; gap: .3rem; margin-top: .8rem; font-size: .68rem; font-weight: 850; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.option-field select { width: 100%; padding: .55rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--panel); color: var(--ink); font: inherit; font-size: .8rem; font-weight: 600; text-transform: none; letter-spacing: 0; }
.column-list { display: grid; gap: .55rem; max-height: 30rem; overflow: auto; padding-right: .2rem; }
.column-card { padding: .65rem .7rem; border: 1px solid var(--line); border-radius: .65rem; background: color-mix(in srgb, var(--panel), var(--soft) 30%); }
.column-card-head { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
.column-card-head strong { font-size: .82rem; overflow-wrap: anywhere; }
.column-card-head span { flex: none; color: var(--muted); font-size: .66rem; }
.column-samples { margin: .3rem 0 .5rem; color: var(--muted); font-size: .7rem; overflow-wrap: anywhere; }
.column-card-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.column-card-fields label { display: grid; gap: .2rem; font-size: .62rem; font-weight: 850; color: var(--muted); text-transform: uppercase; }
.column-card-fields select { width: 100%; padding: .42rem; border: 1px solid var(--line); border-radius: .45rem; background: var(--panel); color: var(--ink); font-size: .72rem; }
.split-fields { display: grid; gap: .1rem; }
.detect-button { width: 100%; margin-top: 1.2rem; }
.review-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5rem; margin: 1rem 0; }
.review-summary div { padding: .6rem .65rem; border: 1px solid var(--line); border-radius: .6rem; }
.review-summary span { display: block; color: var(--muted); font-size: .6rem; text-transform: uppercase; letter-spacing: .06em; }
.review-summary strong { font-size: 1.05rem; }
.bulk-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .8rem; }
.bulk-actions .secondary-button { padding: .55rem .8rem; font-size: .74rem; }
.bulk-actions .quiet { border: 0; background: transparent; color: var(--muted); font-weight: 800; font-size: .74rem; cursor: pointer; }
.review-table { min-width: 52rem; }
.review-table td { vertical-align: middle; }
.review-table td.original code { font: .7rem/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); }
.review-table td small { display: block; margin-top: .2rem; color: var(--muted); font-size: .6rem; }
.review-table tr.needs-review td:first-child { box-shadow: inset 4px 0 #c78824; }
.review-table tr.decision-approved td { background: color-mix(in srgb, var(--soft), transparent 35%); }
.review-table tr.decision-rejected td { opacity: .6; }
.review-badge { display: inline-block; margin-left: .35rem; padding: .12rem .4rem; border: 1px solid #c78824; border-radius: 999px; color: var(--warning); font-size: .56rem; font-weight: 900; white-space: nowrap; }
.decision-cell { white-space: nowrap; }
.decision-cell button { margin: .1rem; padding: .38rem .55rem; border: 1px solid var(--line); border-radius: .45rem; background: var(--panel); color: var(--ink); font-size: .66rem; font-weight: 800; cursor: pointer; }
.decision-cell button[data-decide="approved"][aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-mint-ink); }
.decision-cell button[data-decide="rejected"][aria-pressed="true"] { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: .6rem; margin: .6rem 0; font-size: .72rem; color: var(--muted); }
.pager button { min-width: 2.2rem; padding: .35rem; border: 1px solid var(--line); border-radius: .45rem; background: var(--panel); color: var(--ink); cursor: pointer; }
.duplicate-row { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .6rem .7rem; margin: .4rem 0; border: 1px solid var(--line); border-left: 4px solid #c78824; border-radius: .55rem; font-size: .75rem; }
.duplicate-row span { display: block; color: var(--muted); font-size: .66rem; }
.flag-list { margin: .3rem 0; padding-left: 1.1rem; font-size: .75rem; line-height: 1.6; }
.result-panel .metric-grid { grid-template-columns: 1fr 1fr; }
.preview-wrap { max-height: 24rem; margin-top: .8rem; }
.preview-table { min-width: 36rem; }
.preview-table td.unknown { color: var(--warning); font-weight: 800; background: color-mix(in srgb, #c78824 14%, transparent); }
.export-controls button:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 82rem) {
    .sanitizer-workspace { grid-template-columns: minmax(19rem, .8fr) minmax(36rem, 1.6fr); }
    .result-panel { grid-column: 1 / -1; }
    .review-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 48rem) {
    .sanitizer-workspace { display: block; }
    .mobile-tabs { grid-template-columns: repeat(3, 1fr); }
    .review-summary { grid-template-columns: 1fr 1fr; }
    /* Review rows become cards so the suggestion and the decision stay on screen. */
    .review-panel .pipeline-table-wrap { max-height: none; }
    .review-table { min-width: 0; }
    .review-table thead { display: none; }
    .review-table tr { display: grid; grid-template-columns: auto 1fr; gap: .3rem .6rem; padding: .75rem; border-bottom: 1px solid var(--line); }
    .review-table tr.needs-review { box-shadow: inset 4px 0 #c78824; }
    .review-table tr.needs-review td:first-child { box-shadow: none; }
    .review-table td { display: block; padding: 0 !important; border: 0 !important; }
    .review-table td:nth-child(1) { font-weight: 900; }
    .review-table td:nth-child(1)::before { content: "Row "; }
    .review-table td:nth-child(2) { font-weight: 800; }
    .review-table td:nth-child(n+3) { grid-column: 1 / -1; }
    .review-table td:nth-child(3)::before, .review-table td:nth-child(4)::before, .review-table td:nth-child(5)::before { display: block; margin-bottom: .15rem; color: var(--muted); font-size: .58rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
    .review-table td:nth-child(3)::before { content: "Original"; }
    .review-table td:nth-child(4)::before { content: "Suggested — edit if needed"; }
    .review-table td:nth-child(5)::before { content: "Rule"; }
    .review-table td.empty { grid-column: 1 / -1; }
    .review-table td.empty::before { content: none !important; }
    .decision-cell { display: flex !important; gap: .4rem; }
    .decision-cell button { flex: 1; padding: .6rem; font-size: .75rem; }
    .column-list { max-height: none; }
    .duplicate-row { flex-direction: column; align-items: stretch; }
    .export-controls { grid-template-columns: 1fr; }
}
