:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#192f2d;background:#f4f5ef;font-synthesis:none;line-height:1.55}*{box-sizing:border-box}body{margin:0}header{max-width:1152px;margin:auto;padding:25px 40px;border-bottom:1px solid #d6ded6;display:flex;justify-content:space-between;align-items:center}.brand{font-size:30px;font-weight:800;letter-spacing:-1.5px;text-decoration:none;color:inherit}.brand-dot{color:#40845e}.local{font-size:13px;color:#415b51;border:1px solid #cbd8cd;border-radius:40px;padding:6px 12px}main{max-width:1072px;margin:auto;padding:0 32px}.intro{max-width:740px;margin:52px 0 36px}.eyebrow{font-size:11px;font-weight:750;letter-spacing:2px;color:#47664d}h1{font-size:clamp(32px,4.8vw,51px);line-height:1.12;letter-spacing:-1.9px;margin:15px 0 20px;font-weight:650}.intro>p:last-child{max-width:580px;font-size:17px;color:#54645c}.steps{display:flex;gap:32px;padding:0;list-style:none;margin:32px 0 22px;color:#64736a;font-size:14px}.steps li{display:flex;align-items:center;gap:9px}.steps span{border:1px solid #becbbf;display:grid;place-items:center;border-radius:50%;width:27px;height:27px}.steps [aria-current]{color:#183f32;font-weight:700}.steps [aria-current] span{background:var(--accent);color:white;border-color:var(--accent)}.panel{background:white;border:1px solid #d9e1d8;border-radius:15px;padding:30px;box-shadow:0 5px 25px #294a3110}.section-heading{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:24px}.section-heading>span{color:#708074;font-size:12px;white-space:nowrap}h2{font-size:22px;letter-spacing:-.5px;margin:0}h3{font-size:16px;margin:0}.uploads{display:grid;grid-template-columns:1fr 1fr;gap:20px}.upload{border:1px dashed #b7c9b9;border-radius:10px;padding:24px;background:var(--surface);min-width:0}.file-icon{display:grid;place-items:center;width:44px;height:50px;border:1px solid #b8c5b6;border-radius:6px;background:white;font-size:11px;font-weight:bold;margin-bottom:15px}.excel{color:#226248}.upload label{display:block;font-weight:650}.upload p,.action-row p{font-size:13px;color:#58665e}.upload input{width:100%;font:inherit;font-size:13px;margin:12px 0}.upload input::file-selector-button{background:white;border:1px solid #b5c5b9;padding:9px 12px;border-radius:6px;font:inherit;cursor:pointer}.file-list{overflow-wrap:anywhere}.action-row{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:24px 0 4px}.action-row p{max-width:430px}button,.button{font:inherit;font-size:14px;font-weight:650;cursor:pointer;border-radius:7px;border:1px solid var(--accent);background:var(--accent);color:white;text-decoration:none;padding:12px 18px;display:inline-flex;align-items:center;justify-content:center;gap:18px;line-height:1.4}button:hover,.button:hover{filter:brightness(.93)}button:disabled{opacity:.6;cursor:wait}.secondary{background:white;color:var(--accent);border-color:#bbcbbc}.text-button{background:transparent;color:#536557;border:0;padding-left:0;text-decoration:underline}.notice{padding:15px 18px;background:#f4f6ec;border-left:3px solid #97ad66;border-radius:3px;font-size:14px}.error{background:#fff0ed;border-left:3px solid #b54e36;padding:15px;color:#8b3022}details{border-top:1px solid #e1e6dd;padding-top:17px;margin-top:24px;font-size:14px}summary{cursor:pointer;font-weight:600}details p{color:#536459}footer{font-size:12px;line-height:1.8;color:#617267;max-width:820px;margin:28px 0 48px}footer strong{color:#324c3d}.columns{display:grid;gap:10px}.column{display:grid;grid-template-columns:1fr 1fr;gap:20px;align-items:center;border-bottom:1px solid #e8ede4;padding:12px 0;overflow-wrap:anywhere}.column label{font-weight:650}select{width:100%;min-width:0;border:1px solid #a8bcac;border-radius:6px;background:white;font:inherit;font-size:14px;padding:10px}.counts{display:flex;gap:28px;font-size:18px;font-weight:650;margin-bottom:22px}.outcome{border:1px solid #dce4da;border-radius:8px;padding:20px;margin:14px 0;overflow-wrap:anywhere}.outcome-heading{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}.badge{border-radius:20px;background:#e8f1e7;color:#2c5d3c;padding:4px 10px;font-size:12px;white-space:nowrap}.review{background:#fff1cf;color:#755219}.failed{background:#fce7e3;color:#963a29}.outcome ul{padding-left:20px;font-size:14px}.outcome p{font-size:13px}.downloads{display:flex;gap:12px;flex-wrap:wrap;margin-top:26px}.provenance{max-height:300px;overflow:auto;font-size:13px}.provenance p{padding:8px;border-bottom:1px solid #ddd;overflow-wrap:anywhere}:focus-visible{outline:3px solid #be873e;outline-offset:4px}[hidden]{display:none!important}#progress:not(:empty){padding:12px 0;color:#315c3f}@media(max-width:640px){header{padding:18px 20px}.brand{font-size:26px}.local{font-size:10px;padding:5px 8px}main{padding:0 18px}.intro{margin-top:32px}h1{letter-spacing:-1px}.intro>p:last-child{font-size:15px}.steps{gap:17px;font-size:12px}.steps li{gap:6px}.steps span{width:23px;height:23px}.panel{padding:20px 16px}.uploads{grid-template-columns:1fr}.upload{padding:18px}.action-row{align-items:stretch;flex-direction:column;gap:10px}.section-heading{gap:5px}h2{font-size:19px}.column{grid-template-columns:1fr;gap:8px}.outcome-heading{flex-direction:column}.downloads{flex-direction:column}.counts{font-size:16px;gap:16px}.outcome{padding:16px}footer{margin-top:24px}}
h1{font-size:clamp(1.8rem,4vw,2.5rem);line-height:1.2;margin:20px 0}fieldset{border:0;padding:0;margin:0 0 20px;display:flex;gap:20px;flex-wrap:wrap}legend{margin-bottom:12px;font-weight:600}fieldset input{width:auto}.table-wrap{overflow:auto}table{border-collapse:collapse;width:100%;font-size:.9rem}td,th{text-align:left;padding:8px;border-bottom:1px solid #ddd;white-space:pre-wrap}pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:.85rem}select{max-width:100%}.column{min-width:0}main{padding-top:12px}details{margin:12px 0}[hidden]{display:none!important}
.workspace-tabs{display:flex;gap:12px;margin:24px 0}.workspace-tabs [aria-pressed=true]{outline:2px solid var(--accent);outline-offset:2px}.outcome{padding:10px 14px;margin:8px 0}.outcome p{margin:5px 0}.outcome h3{font-size:14px}.profile-tools{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:20px 0}.profile-tools select{width:220px}.profile-tools input{max-width:100%}input:not([type=checkbox]):not([type=radio]):not([type=file]){font:inherit;padding:8px;border:1px solid #a8bcac;border-radius:5px;min-width:0}.output-column{display:grid;grid-template-columns:22px 80px minmax(150px,1fr) 20px minmax(150px,1fr) 40px 40px;align-items:center;gap:8px;min-width:670px;padding:8px 0;border-bottom:1px solid #ddd}.output-column button{padding:8px}.position{font-size:13px;font-weight:650}#source-workspace,#table-workspace{min-width:0}#source-preview h4{overflow-wrap:anywhere}#batch-preview{margin:18px 0}#outcomes{max-height:300px;overflow:auto}section>label{display:block;margin-top:12px;font-weight:600}

.table-wrap table{min-width:520px}#profile-structure{overflow-wrap:anywhere;font-size:14px}
/* The result is a compact workspace: data first, maintenance in details. */
main{max-width:1440px}body:has(#result-panel:not([hidden])) h1{display:none}header{padding:14px 24px;max-width:1440px}.panel{padding:18px}button,.button{padding:8px 12px;gap:6px}.result-bar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:16px}.result-bar select{width:auto;max-width:360px}.result-bar #result-title{font-weight:650}.result-bar #new-run{margin-left:auto}h2{font-size:18px;margin-bottom:10px}.step-heading{display:flex;justify-content:space-between;gap:12px;align-items:center}.step-heading select{width:200px;margin-left:8px}.data-choices{display:flex;gap:10px;overflow:auto;padding:3px 3px 10px;margin-bottom:12px}.data-choice{display:block;text-align:left;flex:0 0 auto;max-width:420px;min-width:200px;padding:10px;border-radius:8px;font-weight:400}.data-choice strong{display:block;margin-bottom:5px}.data-choice table{font-size:12px;min-width:0}.data-choice td,.data-choice th{padding:4px 8px}.data-choice[aria-pressed=true]{border:2px solid var(--accent);background:#eef5ed;padding:9px}.compose-grid{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:20px}.compose-grid>section{min-width:0}.output-column{grid-template-columns:20px 62px minmax(85px,1fr) 14px minmax(95px,1fr) 30px 30px;gap:5px;min-width:460px;padding:5px 0;font-size:13px}.output-column button{padding:5px}.output-column input:not([type=checkbox]){padding:6px;width:100%}.output-column>span{overflow-wrap:anywhere}.position{font-size:12px}#batch-preview{margin:0}#batch-preview h3{margin:0 0 10px}#batch-preview .table-wrap table{min-width:0}#batch-preview td,#batch-preview th{padding:6px 8px}#batch-preview p{font-size:13px;margin:6px 0}.downloads{margin-top:12px;gap:8px}.secondary-tools{display:flex;align-items:baseline;gap:16px;flex-wrap:wrap;margin-top:18px;border-top:1px solid #ddd;padding-top:12px}.secondary-tools>details{border:0;margin:0;padding:0}.secondary-tools>details[open]{flex-basis:100%}#profile-notice:empty{display:none}#result-warning{font-size:13px;margin:4px 0 12px}#source-preview .table-wrap{max-height:300px}#profile-management input{display:block;margin:8px 0}
@media(max-width:1000px){.compose-grid{grid-template-columns:1fr}.step-heading{align-items:flex-start;flex-direction:column}.result-bar select{max-width:100%}}@media(max-width:640px){main{padding:8px}.panel{padding:12px}.result-bar{gap:8px}.result-bar #new-run{margin-left:0}.result-bar select{max-width:220px}.downloads{flex-direction:row}.data-choice{max-width:300px}.secondary-tools{gap:12px}.compose-grid{gap:16px}}

body:has(#result-panel:not([hidden])) main>details{display:none}

.secondary-tools>details{min-width:0;max-width:100%}
#source-preview>.table-wrap{max-height:220px;overflow:auto;margin-bottom:8px}#source-preview th{position:sticky;top:0}#source-preview th,#batch-preview th{background:#eef5ed}#source-preview td{min-width:100px}#source-preview details{display:inline-block;margin-right:16px}#data-choices label{display:flex;align-items:center;gap:5px;font-size:13px;white-space:nowrap}.sources-button{display:block;margin-top:4px;font-size:11px!important}.output-column{min-width:560px;grid-template-columns:20px 58px minmax(150px,1fr) 14px minmax(100px,1fr) 30px 30px}.output-column>div{overflow-wrap:anywhere}dialog{border:1px solid #bbcbbc;border-radius:12px;max-width:min(620px,95vw);max-height:85vh;padding:20px}dialog::backdrop{background:#192f2d66}#source-options{overflow:auto;max-height:60vh}#source-options label{display:grid;grid-template-columns:24px 1fr;padding:10px 0;border-bottom:1px solid #ddd}#source-options small{grid-column:2;overflow-wrap:anywhere;color:#536459}#close-sources{margin-top:15px}.unlinked-row{display:grid;grid-template-columns:1fr 150px;gap:8px;margin:8px 0}.unlinked-row span{overflow-wrap:anywhere}

#source-options label{display:flex;align-items:center;gap:6px;padding:6px 0;white-space:nowrap}#source-options .source-example{color:#68716d;font-style:italic;font-synthesis:style}#data-choices{margin:0;padding:0;max-width:100%;flex-wrap:wrap}#source-options label>span{font-style:normal;font-weight:400}
/* Five-step workspace: document and table scrolling are independent. */
.document-strip{display:flex;gap:12px;overflow-x:auto;padding-bottom:10px;max-width:100%}
.document-card{flex:0 0 550px;max-width:100%;min-width:0;border:1px solid #d9e1d8;border-radius:8px;padding:10px}
.document-card h3{font-size:13px;overflow-wrap:anywhere;margin-bottom:8px}
.document-card .table-wrap{width:100%;overflow-x:auto}
.document-card th,.document-card td,#batch-preview th,#batch-preview td{white-space:nowrap;min-width:112px;max-width:none}
.document-card table{width:max-content;min-width:100%}
#document-step{margin:16px 0 20px}#data-choices{gap:8px 16px}
.output-column{grid-template-columns:25px 25px 52px minmax(110px,1fr) 92px minmax(80px,1fr) 25px;min-width:470px;gap:5px}
.output-column .sources-button{margin:0;font-size:11px}.binding-labels{font-size:12px}
.column-validation{display:block;font-size:11px;color:#8b3022;line-height:1.3}.column-validation:empty{display:none}
#add-column{margin-top:8px}#export-step{margin-top:20px}
#table-link[aria-disabled=true]{opacity:.5;cursor:default}
#batch-preview .table-wrap table{width:max-content;min-width:100%}
@media(max-width:640px){.document-card{flex-basis:100%}.output-column{min-width:470px}#source-options label{white-space:normal}#source-options label>span{overflow-wrap:anywhere}}

.output-column .position{white-space:nowrap}

.document-heading,.preview-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px;min-width:0}
.document-heading h3{margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.document-heading>span{font-size:12px;color:#68716d;white-space:nowrap;flex-shrink:0}
.preview-heading h2{margin:0;white-space:nowrap}.preview-heading>span{font-size:13px;white-space:nowrap}
.source-hint,input::placeholder{color:#68716d;opacity:1}

/* Only column names use a quiet inset keyboard focus. */
.column-name input:focus{outline:none;box-shadow:none}
.column-name input:focus-visible{outline:none;box-shadow:inset 0 0 0 1px #536459}
.source-document{width:0;min-width:100%;font-size:12px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;padding:6px 0;border-bottom:1px solid #bbcbbc}
#batch-preview>.error,#composition-error,#output-step>#error{overflow-wrap:anywhere;font-size:13px}

.result-bar #new-run{margin-left:0}.result-bar #add-document{margin-left:auto}.document-title{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.document-title h2{margin:0}.document-title #result-title{font-size:12px;color:#68716d;white-space:nowrap}.step-heading{margin-bottom:10px}.document-heading .remove-document{padding:0;width:22px;height:22px;flex:0 0 22px;font-size:16px}.document-heading h3{flex:1}.document-heading{justify-content:flex-start}

.export-options{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:12px}.export-option{display:inline-flex;align-items:center;gap:8px;font-size:13px;margin-bottom:10px}.export-option select{width:auto;max-width:100%;padding:5px 8px}.export-option[hidden]{display:none}


#date-notation {width:200px; max-width:65vw} #output-step > .export-option {margin-right:10px}

/* Shared presentation for all five processing steps. */
.step-container{min-width:0;padding:14px;border:1px solid var(--border);border-radius:10px;background:var(--surface);box-shadow:0 2px 7px #294a3110}
#source-search{display:block;width:100%;height:32px;margin:0 0 8px;font:inherit}
#source-options{max-height:calc(60vh - 40px)}

/* Keep the native border and caret; scope the focus override to source search. */
#source-search:focus{outline:none;box-shadow:none}

:root{--accent:#214f3d;--surface:#fafbf8;--border:#a8b8ac}
.route-choices{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:18px 0}
.route-choices button{min-height:68px;flex-direction:column;gap:3px}.route-choices small{font-weight:400}
.route-choices [aria-pressed=true]{border:2px solid var(--accent);background:#eef5ed}
.route-choices button:disabled{cursor:default}
.upload-surface{display:flex;flex-direction:column;cursor:pointer;margin:10px 0 16px;padding:16px}
.upload-surface span{font-size:13px;color:#58665e}.upload-surface input{margin-bottom:0}
@media(max-width:640px){.route-choices{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}}

#use-profile{display:flex;align-items:center;gap:.5rem;margin:.5rem 0 1rem;flex-wrap:wrap}#saved-profile{width:auto;max-width:100%;min-width:10rem}#profile-notice{color:var(--green, #21633e);font-size:.875rem}#profile-error{margin:.5rem 0}.downloads{align-items:center}

.save-profile-group{display:inline-flex;align-items:center;gap:8px;max-width:100%}.save-profile-group button{flex-shrink:0}#profile-notice{overflow-wrap:anywhere}

/* Step 3 is an independent height reference, never stretched by the preview. */
.compose-grid{align-items:start}
#batch-preview th:first-child,#batch-preview td:first-child{min-width:38px;width:38px;color:#68716d}
#batch-preview .preview-ellipsis td{height:35px;text-align:center}
.save-profile-group{flex-wrap:wrap}

.profile-choice{display:flex;align-items:center;gap:8px;min-width:0;max-width:100%}#use-profile .profile-choice select{min-width:0;flex:1;width:200px}#delete-profile{flex:none}#delete-profile-title{overflow-wrap:anywhere}

#csv-advanced{margin:12px 0;max-width:580px}
.csv-grid{display:grid;gap:10px;margin:12px 0}
.csv-grid>label{display:grid;grid-template-columns:148px 90px minmax(0,1fr);align-items:center;gap:8px;min-width:0}
.csv-grid>label:nth-child(n+3)>select{grid-column:2/4}
.csv-grid select{width:max-content;max-width:100%;min-width:0;padding:6px}
.csv-example{color:#68716d;font-style:italic;font-synthesis:style;white-space:nowrap}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
#custom-date-option input{max-width:100%}#custom-date-option small{display:block}
@media(max-width:600px){
 .csv-grid>label{grid-template-columns:122px 78px minmax(0,1fr);gap:6px;font-size:12px}
 .csv-grid select{font-size:12px;padding:6px 3px;min-height:34px}
 .csv-example{font-size:12px}
}
.template-summary{font-size:.75rem;color:var(--muted,#647067);line-height:1.5;margin:.5rem 0;overflow-wrap:anywhere}
.template-summary strong{display:block;color:inherit}
.template-choice{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;margin-top:.5rem;font-size:.8rem}
.template-choice>span{flex-basis:100%;overflow-wrap:anywhere}

/* Output choices precede the effective table, including narrow step-4 cards. */
.preview-heading{flex-wrap:wrap}.preview-heading h2{white-space:normal}
.output-settings .export-option{display:flex;flex-wrap:wrap;min-width:0;margin-bottom:8px}
.notation-options{display:flex;flex-wrap:wrap;gap:0 12px}
.output-settings #csv-advanced{margin:8px 0}
#csv-header-notice{font-size:13px;margin:6px 0}
@media(min-width:1001px){.csv-grid>label{grid-template-columns:122px 78px minmax(0,1fr);gap:6px;font-size:12px}.csv-grid select{font-size:12px;padding:6px 3px}}

/* Paired notation controls share fixed label tracks in each grid column. */
.notation-options{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px 14px;margin-bottom:12px}
.notation-options>label{display:grid!important;grid-template-columns:128px minmax(0,1fr);gap:6px;align-items:center;margin:0!important;font-size:12px;min-width:0}
.notation-options select,.notation-options #date-notation{width:100%;max-width:100%;min-height:34px;padding:5px 3px;font-size:12px}
.notation-options .csv-example,.notation-options .sr-only{display:none}
#custom-date-option,#date-error{grid-column:1/-1}
#custom-date-option small{grid-column:1/-1}
.csv-grid>label{grid-template-columns:122px minmax(0,1fr)}
.csv-grid>label>select{grid-column:2!important}
#batch-preview .literal-csv :is(td,th):not(:first-child){white-space:pre;tab-size:4}
#batch-preview .literal-csv{max-width:100%;overflow:auto}
@media(max-width:600px){.notation-options{grid-template-columns:minmax(0,1fr)}.notation-options>label{grid-template-columns:128px minmax(0,1fr)}}

.notation-options>label[hidden]{display:none!important}
.mail-text {white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;max-height:20rem;overflow:auto;}
.source-reviews {flex-basis:100%;max-width:100%;}
.source-reviews details {max-width:100%;overflow:auto;}
.source-reviews select {max-width:100%;}
/* Mail families share a compact overview; only the local table can scroll. */
#source-preview.mail-overview{display:block;overflow:visible;min-width:0}
#source-preview.mail-overview>.mail-table-scroll{max-height:none;max-width:100%;overflow:auto}
.mail-overview table{min-width:1000px}
#source-preview.mail-overview th{position:static}
.mail-overview td{vertical-align:middle;font-size:12px}
.mail-overview tr[data-mail-detail]>td{white-space:normal;overflow-wrap:anywhere;padding:12px}
.mail-part{margin:8px 0;padding:10px;border:1px solid var(--border);border-radius:6px;max-width:100%}
.mail-part .source-status{font-size:13px;margin:6px 0}
.mail-part label{display:flex;gap:8px;align-items:center}
#source-preview .mail-part details{display:block;margin:8px 0;padding-top:6px}
#source-preview .mail-part .table-wrap{max-height:240px}
.source-document{white-space:normal;overflow-wrap:anywhere;width:auto}
#source-options label{white-space:normal;align-items:flex-start}
#source-options details{margin:4px 0;padding:0;border:0;font-size:12px}
#source-options details p{white-space:pre-wrap;overflow-wrap:anywhere}
.coverage-notice{font-size:13px;padding:8px 0;color:#536459}
#data-choices>p{flex-basis:100%;font-size:13px;margin:0}
/* Mail controls keep recognition, selection and explicit review separate. */
.mail-overview tr[data-mail]{cursor:pointer}
.mail-overview tr[data-mail]:hover{background:#eef5ed}
.mail-details{border:1px solid var(--border);border-radius:8px;padding:12px;width:min(900px,calc(100vw - 100px));white-space:normal}
.mail-metadata{display:grid;grid-template-columns:auto minmax(0,1fr);gap:5px 12px;margin:0 0 12px}
.mail-metadata dt{font-weight:650}.mail-metadata dd{margin:0;overflow-wrap:anywhere}
.mail-part{border:0;border-top:1px solid var(--border);border-radius:0;padding:10px 0}
.source-filename{font-size:12px;color:#68716d;overflow-wrap:anywhere}
.recognition{display:flex;gap:6px;white-space:nowrap}.recognized{color:#21633e}.unrecognized{color:#963a29}.unknown{color:#68716d}
.mail-warning{max-width:240px;white-space:normal;font-size:12px;margin-top:5px}
#source-options .source-example:focus{font-size:0;white-space:normal}
#source-options .source-example:focus::after{content:attr(data-full);font-size:13px;white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:640px){.mail-metadata{grid-template-columns:1fr;gap:2px}.mail-metadata dd{margin-bottom:6px}}
/* Two-digit column positions must not overlap the editable output name. */
.output-column{grid-template-columns:25px 25px 65px minmax(110px,1fr) 92px minmax(80px,1fr) 25px;min-width:490px}
/* Document pairs stay readable together inside the mobile mail container. */
.mail-part .document-fields table{min-width:0;width:100%;table-layout:fixed}
.mail-part .document-fields :is(td,th){min-width:0;white-space:pre-wrap;overflow-wrap:anywhere}
.mail-part .document-fields :is(td,th):first-child{width:40%}

/* Scoped mail controls reuse the existing secondary button and primary toggles. */
.mail-part-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.mail-part-actions{display:flex;align-items:center;justify-content:flex-end;gap:12px;flex-wrap:wrap;margin-left:auto}
.mail-part-actions label{margin:0;font-size:12px}.mail-part-actions button{flex:none}
#data-choices.mail-source-buttons{display:flex;flex-wrap:wrap;gap:8px;overflow:visible}
#data-choices.mail-source-buttons button{width:var(--source-width,max-content);height:var(--source-height,auto);max-width:100%;overflow-wrap:anywhere;flex:none}

/* One review component moves with the existing journey. */
.source-review{margin:12px 0;padding:12px;border:1px solid var(--border);border-radius:8px;min-width:0}
.source-review h3{margin-bottom:8px}.source-review p{font-size:13px;margin:4px 0 8px}
.source-review table{min-width:0;table-layout:fixed}.source-review :is(td,th){overflow-wrap:anywhere;font-size:12px;white-space:pre-wrap}
.source-review label{font-size:13px;margin-top:10px}.source-review details{margin:8px 0;font-size:12px}
#source-reviews{margin-bottom:12px;min-width:0}#source-reviews select{margin-top:6px}

/* Relevant differences remain side by side, including at 390px. */
.source-review h3{font-size:14px;line-height:1.4}
.source-review .review-comparison :is(td,th){padding:6px;vertical-align:top}
.source-review .review-comparison th{background:#eef5ed}
.source-review .review-comparison th:first-child{width:32%}
.source-review details{padding-top:6px}
.source-review .review-excluded,.source-review .review-unmatched{font-size:12px;color:#536459}
/* Source use belongs to the overview; recognition remains independent. */
.source-use{display:inline;padding:2px 0;background:none;border:0;color:var(--text);font:inherit;text-align:left;border-radius:2px;box-shadow:none}
.source-use:hover{background:none;text-decoration:underline}.source-unused{text-decoration:line-through}
.recognition{display:flex;align-items:baseline;gap:5px;white-space:nowrap}
#source-preview.mail-overview td:first-child{min-width:32px}
.review-lines{margin:14px 0}.review-lines td{vertical-align:top;padding:6px}
.review-lines th:first-child{width:12%}.review-lines th:last-child{width:30%}
#source-reviews select{width:auto;max-width:100%;font-size:12px;margin:0}
.review-bulk{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:14px 0}
.review-bulk label{margin:0}.review-bulk button{font-size:12px}
@media(max-width:600px){
 .review-lines tr{display:grid;grid-template-columns:24% 38% 38%}
 .review-lines th:last-child{display:none}.review-lines td:last-child{grid-column:1 / -1}
 .review-lines th:first-child,.review-lines th:last-child{width:auto}
 .review-lines :is(td,th){min-width:0}
}

.source-review > summary{font-size:14px;font-weight:600;cursor:pointer}
.review-complete{display:inline-block;margin-left:10px;font-size:12px;color:var(--green,#27643b);font-weight:normal}

/* Compact three-state source control: recognition is a separate icon. */
.recognition{display:grid;grid-template-columns:12px minmax(55px,1fr) 36px auto;align-items:center;gap:5px;min-height:30px}
.source-use-toggle{position:relative;width:36px;height:28px;min-width:36px;padding:0;border:0;background:transparent;border-radius:5px}
.source-use-toggle::before{content:"";position:absolute;inset:5px 1px;border-radius:12px;background:#78847b}
.source-use-toggle::after{content:"";position:absolute;top:8px;left:4px;width:12px;height:12px;border-radius:50%;background:white}
.source-use-toggle[aria-checked=true]::before{background:var(--accent)}
.source-use-toggle[aria-checked=true]::after{left:20px}
.source-use-toggle[aria-checked=mixed]::before{background:#697759}
.source-use-toggle[aria-checked=mixed]::after{left:12px;border-radius:2px;height:4px;top:12px}
.source-use-toggle:hover{background:#e7eee8}
.source-use-toggle:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

.languages{display:flex;align-items:center;gap:.25rem;margin-left:1rem;white-space:nowrap}
.languages button{background:transparent;color:inherit;border:0;padding:.35rem;font:inherit;font-size:.85rem;border-radius:3px}
.languages button[aria-pressed="true"]{font-weight:700;text-decoration:underline;text-underline-offset:.3em}
.languages button:focus-visible{outline:2px solid currentColor;outline-offset:2px}
header .local{margin-left:auto}
@media(max-width:480px){header{flex-wrap:wrap}.languages{margin-left:.5rem}}

#import-progress{margin:10px 0} #import-progress p{margin:4px 0} #import-meter{width:min(320px,65%);height:8px;accent-color:var(--accent)} .optional-report{display:inline-block;font-size:12px;margin-top:12px}

/* One full-width choice row; the existing editor and output share the next row. */
.column-choices-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.column-choice{min-width:0;border:1px solid #d9e1d8;border-radius:10px;padding:16px;background:var(--surface)}
.column-choice p,#column-choices>p{font-size:13px;color:#58665e;margin:8px 0 14px}
.column-choice .upload{padding:0;border:0;background:transparent}.column-choice .file-icon{display:none}
#column-choices{margin-bottom:20px}#column-step .save-profile-group{margin:10px 0}
#import-progress{display:flex;align-items:center;flex-wrap:wrap;gap:12px 20px}
#import-progress p{flex-basis:100%}#import-meter{appearance:none;border:0;border-radius:4px;overflow:hidden;background:#e1e6dd;color:var(--accent)}
#import-meter::-moz-progress-bar{background:var(--accent)}
#import-meter::-webkit-progress-bar{background:#e1e6dd}#import-meter::-webkit-progress-value{background:var(--accent)}
#import-meter:indeterminate{background:linear-gradient(90deg,#e1e6dd 0 30%,var(--accent) 30% 60%,#e1e6dd 60%)}
.output-column .binding-labels{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}
.binding-full{display:none}.binding-labels:focus .binding-full{display:block;position:absolute;z-index:5;left:24px;right:24px;padding:12px;background:white;border:1px solid var(--border);border-radius:6px;white-space:normal;overflow-wrap:anywhere;box-shadow:0 4px 12px #294a3130}
@media(max-width:1000px){.column-choices-grid{grid-template-columns:1fr}}
/* Unknown duration is a moving segment, never a visually completed bar. */
#import-meter:indeterminate{background:linear-gradient(90deg,#e1e6dd 0 40%,var(--accent) 40% 60%,#e1e6dd 60%);background-size:200% 100%;animation:import-pending 1.8s linear infinite alternate}
#import-meter:indeterminate::-moz-progress-bar{background:transparent}
@keyframes import-pending{from{background-position:100% 0}to{background-position:0 0}}
@media(prefers-reduced-motion:reduce){#import-meter:indeterminate{animation:none;background-position:50% 0}}

#proposal-options{overflow:auto;max-height:50vh;margin-bottom:15px}#proposal-options label{display:grid;grid-template-columns:24px 1fr;gap:4px;padding:6px 0;border-bottom:1px solid #ddd}#proposal-options small{grid-column:2;color:#536459;overflow-wrap:anywhere}

#proposal-options label{grid-template-columns:24px minmax(0,1fr)}#proposal-options small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#proposal-options small:focus{white-space:normal;overflow:visible}
