*{box-sizing:border-box}body{margin:0;font-family:Arial,sans-serif;background:#f4f7f6;color:#14231f}header{background:#123d32;color:#fff;padding:16px 24px;display:flex;gap:22px;align-items:center}header span{flex:1}header em{font-size:12px;background:#dff1ea;color:#123d32;padding:7px 10px;border-radius:14px}.hero,.panel{max-width:1500px;margin:18px auto;padding:22px;background:#fff;border:1px solid #ccd9d5}.hero{background:#eaf4f0}.panel h2{margin-top:0}input{padding:12px;border:1px solid #aabbb5}button{background:#17634f;color:white;border:0;padding:12px 16px;margin:4px;cursor:pointer;font-weight:700}button:disabled{opacity:.45}.hidden{display:none!important}.top{display:flex;justify-content:space-between;gap:20px}.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:16px 0}.cards div{border:1px solid #d5e0dc;padding:12px;background:#f8fbfa}.cards strong{display:block;font-size:19px;margin-top:6px}.page{border:1px solid #afc1bb;margin:20px 0;background:white}.pagehead{display:flex;justify-content:space-between;background:#e7f0ed;padding:12px}.tablebox{padding:12px}.tabletitle{font-size:12px;font-weight:bold;color:#45665c;margin-bottom:5px}.scroll{overflow:auto}table{border-collapse:collapse;width:100%;table-layout:auto}td{border:1px solid #cdd8d4;padding:7px 9px;vertical-align:top;white-space:pre-wrap;min-width:70px;font-family:Consolas,monospace;font-size:13px}.rawblock{border-bottom:1px dotted #d4ddda;padding:8px;font-family:Consolas,monospace;font-size:13px}details{margin:12px;background:#fafcfc;border:1px solid #e0e7e5;padding:10px}.tabs{margin:12px 0}.tabs button{background:#dae7e2;color:#173b31}.tabs button.on{background:#17634f;color:white}iframe{width:100%;height:80vh;border:1px solid #aaa}.lock,.notice{padding:14px;background:#fff8dd;border:1px solid #e5d58d;margin:15px 0}.busy{color:#755d00}.good{color:#17634f}.bad{color:#9a2727}@media(max-width:800px){.cards{grid-template-columns:1fr 1fr}.top{display:block}}@media print{header,.hero,#file,#run,.tabs,.top button,.lock,details{display:none!important}.panel{border:0;margin:0;padding:0}.page{break-after:page}td{font-size:10px}}
.diagbar{margin-top:12px}.diag{margin-top:12px;border:1px solid #ccd8d3;background:#fbfdfc;padding:12px}.diag h3{margin:0 0 8px}.drow{display:flex;gap:14px;justify-content:space-between;padding:7px 8px;border-top:1px solid #e2e8e5}.drow:first-of-type{border-top:0}.drow span{text-align:right}.drow.pass b{color:#176b3a}.drow.fail b{color:#a12222}
/* 06J: pre-extraction inspection, live progress, adaptive RAW table sizing */
.intake{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.preview{margin:16px 0;border:1px solid #b9cbc5;background:#f9fcfb}.previewhead{padding:10px 12px;background:#e7f0ed;display:flex;justify-content:space-between;gap:18px}.previewhead span{display:block;font-size:12px;margin-top:4px;color:#527067}.preview iframe{width:100%;height:58vh;border:0;border-top:1px solid #cbd9d4}.inspection-note{margin:0;padding:10px 12px}.progresswrap{margin:14px 0;padding:14px;border:1px solid #b9cbc5;background:#f9fcfb}.progresshead{display:flex;justify-content:space-between;gap:12px;margin-bottom:8px}.progressbar{height:20px;background:#dfe9e5;border:1px solid #b7c8c2;overflow:hidden}.progressbar>div{height:100%;width:0;background:#17634f;transition:width .25s ease}.progressdetail{font-size:13px;margin-top:7px;color:#4d675f}.rawtable{width:max-content;min-width:100%;table-layout:auto}.rawtable td{width:auto;min-width:max(90px,8ch);max-width:42ch;white-space:normal;overflow-wrap:normal;word-break:normal;hyphens:none;line-height:1.35}.rawtable td:empty{min-width:28px}.scroll{overflow-x:auto;overflow-y:visible}

/* 06K: additive dual-zone presentation. 06J transaction table rules remain intact. */
.zone{margin:12px;border:1px solid #cbd9d4;background:#fff}.zone>h3{margin:0;padding:10px 12px;background:#edf5f2}.zonehint{margin:0;padding:8px 12px;color:#536c64;font-size:12px}.headerzone{border-left:4px solid #668f82}.txzone{border-left:4px solid #17634f}.evidence{display:flex;justify-content:space-between;gap:18px;padding:8px 10px;border-top:1px dotted #d6dfdc;font-family:Consolas,monospace;font-size:13px}.evidence small{white-space:nowrap;color:#698078;font-family:Arial,sans-serif}.headerzone details{margin:10px}.headerzone .rawtable td{min-width:120px}.txzone .rawtable{width:max-content;min-width:100%;table-layout:auto}

/* 06N: additive adaptive opening-compartment renderer. Transaction CSS remains frozen. */
.adaptive-opening{padding:12px;overflow-x:auto;background:#fff}.opening-row{display:grid;grid-template-columns:repeat(24,minmax(28px,1fr));column-gap:6px;align-items:start;border-bottom:1px solid #e1e8e5;min-width:980px}.opening-cell{font-family:Consolas,monospace;font-size:13px;line-height:1.45;padding:7px 5px;white-space:normal;overflow-wrap:normal;word-break:normal;hyphens:none;min-width:max-content;max-width:none}.opening-row:last-child{border-bottom:0}.headerzone .tablebox .rawtable td{max-width:none;min-width:max(120px,12ch)}
.discoveryzone{border-left:5px solid #527f72;margin-top:14px}.discoveryzone h4{margin:18px 0 8px}.discoverytable th{white-space:nowrap;text-align:left}.discoverytable td:nth-child(2),.discoverytable td:nth-child(3){min-width:240px;white-space:normal}.source-chip{display:inline-block;border:1px solid #ccd9d5;padding:5px 8px;margin:3px;background:#f8fbfa}.chips{padding:10px}
.registry-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px;margin:12px 0 18px}.registry-summary>div{border:1px solid #c8d8d3;padding:12px;background:#f8fbfa}.registry-summary b{display:block}.registry-summary strong{display:block;font-size:1.35rem;margin-top:5px}.registryzone{border-left:4px solid #176b55}.registryzone details{margin-top:14px}

/* Milestone 09 — protected matching layer; extraction/registry styling remains unchanged */
.matchingzone{border-left:5px solid #315f55}
.matching-note{padding:12px 14px;background:#f6faf8;border:1px solid #cbd9d5;margin:10px 0 14px}
.manual-bank{display:grid;grid-template-columns:minmax(210px,280px) minmax(280px,520px) 1fr;gap:10px;align-items:center;margin:10px 0 18px}
.manual-bank input,.map-select{width:100%;box-sizing:border-box;padding:8px 9px;border:1px solid #aebfba;background:#fff;font:inherit}
.matchingtable th:nth-child(4){min-width:260px}
.match-status{font-weight:700;white-space:nowrap}.match-status.auto{color:#0d6b49}.match-status.manual{color:#8a5b00}.match-status.unselected{color:#666}
.matching-actions{display:flex;gap:14px;align-items:center;margin:14px 0}
.targetschemas>div{padding:8px 0;border-bottom:1px solid #dde5e2}
@media(max-width:900px){.manual-bank{grid-template-columns:1fr}}

/* Milestone 11 — validated transition gate */
.defined-schema-gate{margin:16px 0;padding:14px;border:1px solid #bfd2cc;background:#f6faf8}
.defined-schema-gate h4{margin-top:0}
#definedSchemaPreview{margin-top:12px;padding:10px;border-left:4px solid #315f55;background:#fff}

/* Milestone 12 — Defined Schema generation layer */
.defined-schema-result{margin-top:14px;padding:14px;background:#fff;border:1px solid #bfd2cc}
.schema-result-head{display:flex;justify-content:space-between;gap:18px;align-items:flex-start}
.schema-result-head h4{margin:0 0 5px}.schema-result-head p{margin:0 0 12px}
.schema-controls{margin-top:14px;padding:11px;background:#f6faf8;border-left:4px solid #315f55}
@media(max-width:900px){.schema-result-head{display:block}.schema-result-head button{margin-bottom:12px}}

/* Milestone 13 — Defined Schema validation and protected transaction-transform transition */
.defined-validation{display:flex;gap:14px;align-items:center;margin-top:14px}
.transaction-transform-gate{margin-top:14px;padding:14px;border:1px solid #bfd2cc;background:#f6faf8}
.transaction-transform-gate h4{margin:0 0 6px}

/* Milestone 14 — protected transaction transformation */
#transactionTransformResult{margin-top:14px}
.transform-summary{padding:11px;background:#fff;border-left:4px solid #315f55;margin-bottom:10px}
.transformed-table{font-size:12px;min-width:1500px}
.transform-actions{margin-top:12px}

/* Milestone 15 — refined working data layer */
.transformed-table th,.transformed-table td{white-space:nowrap}

/* Milestone 16 — immutable Transaction Table Zone + Defined Schema overlay */
.txzone table.refined-working-table th.defined-schema-header{
  background:#e9f4f0;
  cursor:help;
  text-decoration:underline dotted;
  text-underline-offset:3px;
}
.txzone table.refined-working-table th.system-schema-header{background:#f0f5f3}
.txzone table.refined-working-table td[data-immutable="true"]{user-select:text}
.schema-overlay-note{margin-top:10px;padding:10px 12px;background:#fff;border-left:4px solid #315f55}

/* Milestone 16C — actual tableView renderer uses first TBODY row as schema row */
.txzone table.refined-working-table tbody tr:first-child > td.defined-schema-header{
  background:#e9f4f0;
  font-weight:700;
  cursor:help;
  text-decoration:underline dotted;
  text-underline-offset:3px;
  position:sticky;
  top:0;
  z-index:1;
}
.txzone table.refined-working-table tbody tr:first-child > td.system-schema-header{background:#f0f5f3}

/* Milestone 16D — Pure Source Schema Overlay */
.txzone table.pure-schema-overlay .defined-schema-header{
  background:#e9f4f0;
  font-weight:700;
  cursor:help;
  text-decoration:underline dotted;
  text-underline-offset:3px;
}
.txzone table.pure-schema-overlay td[data-immutable="true"],
.txzone table.pure-schema-overlay th[data-immutable="true"]{user-select:text}

/* Milestone 16F — protected post-overlay cleanup */
.schema-protection-status{
  margin-top:10px;
  padding:10px 12px;
  background:#fff;
  border-left:4px solid #315f55;
}

/* Milestone 16G — statement-level schema continuity */
.txzone table.inherited-schema-table tr.inherited-schema-row > td{
  background:#e9f4f0;
  font-weight:700;
  cursor:help;
  text-decoration:underline dotted;
  text-underline-offset:3px;
}
.txzone table.inherited-schema-table tr.inherited-schema-row > td::after{
  content:"";
}


/* Milestone 17 — controlled processing-machine handoff */
.processing-handoff-gate{margin-top:14px;padding:14px;border:1px solid #bfd2cc;background:#f6faf8}
.processing-handoff-gate h4{margin:0 0 6px}
#processingHandoffResult{margin-top:14px}
.handoff-summary{padding:12px;background:#fff;border-left:4px solid #315f55}
.handoff-summary h4{margin:0 0 8px}


/* Milestone 17A — human-readable handoff */
.handoff-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}
#processingHandoffReadable{margin-top:16px}
.handoff-readable{border:1px solid #bfd2cc;background:#fff;padding:16px}
.handoff-report-head{border-left:5px solid #315f55;padding-left:12px}
.handoff-status{padding:10px;background:#f3f8f6;margin:10px 0}
.handoff-kv,.handoff-transactions,.handoff-audit-table{width:100%;border-collapse:collapse;margin:8px 0 16px}
.handoff-kv th,.handoff-kv td,.handoff-transactions th,.handoff-transactions td,.handoff-audit-table th,.handoff-audit-table td{border:1px solid #c7d5d0;padding:7px;text-align:left;vertical-align:top}
.handoff-kv th,.handoff-transactions th,.handoff-audit-table th{background:#eaf2ef}
.handoff-table-wrap{overflow:auto;max-height:620px}
.handoff-transactions{min-width:1450px}
.handoff-audit{margin-top:14px}
.handoff-audit summary{cursor:pointer;font-weight:700;font-size:1.05em}

.engine-switch{display:flex;align-items:center;gap:10px}.engine-switch button{font:inherit;font-weight:700;padding:8px 12px;border-radius:8px;border:1px solid currentColor;cursor:pointer}

/* Milestone 18D — persistent dual-engine host. */
.processing-engine-host{position:fixed;inset:0;z-index:100000;background:#f4f7f6;}
.processing-engine-host.hidden{display:none!important;}
.processing-engine-host iframe{display:block;width:100%;height:100%;border:0;background:#fff;}
.processing-engine-active body{overflow:hidden;}

/* Milestone 18E — high-attention progressive section controls. */
.mp18e-attention-toggle{
 display:block;width:100%;min-height:64px;margin:18px 0 0;padding:16px 24px;
 border:3px solid #075f50;border-radius:4px;background:#075f50;color:#fff;
 font-size:20px;font-weight:900;letter-spacing:.35px;text-align:left;cursor:pointer;
 box-shadow:0 3px 0 rgba(0,0,0,.16);
}
.mp18e-attention-toggle:hover,.mp18e-attention-toggle:focus{filter:brightness(.92);outline:3px solid rgba(7,95,80,.20);outline-offset:2px;}
.mp18e-attention-toggle.is-open{background:#123c35;}
.mp18e-collapsible-body[hidden]{display:none!important;}
.mp18e-collapsible-body{display:block;}

/* Milestone 18F — direct, reliable stage disclosure controls. */
details.mp18f-stage{display:block;margin:18px 0;border:0;background:transparent;}
details.mp18f-stage>summary{
 display:block;box-sizing:border-box;width:100%;min-height:68px;padding:18px 24px;
 border:3px solid #075f50;border-radius:4px;background:#075f50;color:#fff;
 font-size:20px;font-weight:900;letter-spacing:.35px;line-height:1.25;cursor:pointer;
 box-shadow:0 3px 0 rgba(0,0,0,.16);list-style:none;
}
details.mp18f-stage>summary::-webkit-details-marker{display:none;}
details.mp18f-stage>summary::after{content:'  ▶';float:right;font-size:24px;font-weight:900;}
details.mp18f-stage[open]>summary{background:#123c35;}
details.mp18f-stage[open]>summary::after{content:'  ▼';}
details.mp18f-stage>summary:hover,details.mp18f-stage>summary:focus{filter:brightness(.92);outline:3px solid rgba(7,95,80,.20);outline-offset:2px;}
.mp18f-stage-body{padding-top:8px;}
details.mp18f-stage[hidden]{display:none!important;}

/* Milestone 18K — collapsible runtime information, closed by default */
.runtime-info{margin-top:18px;border:1px solid #c8d9d3;border-radius:10px;background:#fbfdfc;overflow:hidden}
.runtime-info>summary{cursor:pointer;list-style:none;padding:16px 18px;font-weight:900;letter-spacing:.035em;color:#0d664f;background:#eef7f4}
.runtime-info>summary::-webkit-details-marker{display:none}
.runtime-info>summary:after{content:"+";float:right;font-size:22px;line-height:16px}
.runtime-info[open]>summary:after{content:"−"}
.runtime-info-body{padding:16px}
