.fm-stage-dialog{width:min(960px,calc(100vw - 24px));max-width:none;max-height:calc(100dvh - 24px);padding:0;overflow:hidden;border:1px solid #dce5ec;border-radius:18px;color:#142b40;background:#fff;box-shadow:0 24px 90px #071b3340}
.fm-stage-dialog::backdrop{background:#071b3399}
.fm-stage-dialog[open]{display:block}
.fm-stage-form{display:flex;flex-direction:column;max-height:calc(100dvh - 26px);margin:0}
.fm-stage-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;padding:22px 24px;border-bottom:1px solid #e6edf2;flex:none}
.fm-stage-head h2{font-size:23px;line-height:1.2;margin:4px 0;color:#0b243d}
.fm-stage-head p{margin:4px 0 0;font-size:13px;line-height:1.5;color:#56697b}
.fm-stage-kicker{font-size:11px;letter-spacing:.08em;text-transform:uppercase;font-weight:800;color:#576c7c}
.fm-stage-close{border:1px solid #dce5ec;border-radius:9px;background:#fff;color:#19344e;min-width:44px;min-height:44px;font-size:22px;cursor:pointer;flex:none}
.fm-stage-scroll{overflow:auto;min-height:0;flex:1 1 auto;scrollbar-gutter:stable}
.fm-stage-body{margin:0;padding:20px 24px;border:0;overflow:visible;min-height:0;min-width:0;display:block;}
.fm-stage-body>section,.fm-stage-body>div{margin:0 0 20px;min-height:min-content}
.fm-stage-context{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding:14px;border:1px solid #e1e8ee;border-radius:12px;background:#f7fafc}
.fm-stage-context span{font-size:11px;color:#607386;display:block;margin-bottom:4px}
.fm-stage-context strong{font-size:13px;overflow-wrap:anywhere}
.fm-stage-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.fm-stage-field{display:grid;align-content:start;gap:6px;min-width:0;font-size:13px;font-weight:700;color:#263e54}
.fm-stage-field input,.fm-stage-field select,.fm-stage-field textarea{width:100%;min-width:0;box-sizing:border-box;border:1px solid #cbd8e1;border-radius:9px;padding:11px 12px;min-height:44px;font:inherit;font-weight:500;color:#142b40;background:#fff}
.fm-stage-field textarea{min-height:88px;resize:vertical}
.fm-stage-field input[readonly]{background:#f1f5f8;color:#536779}
.fm-stage-field small{font-size:11px;font-weight:500;color:#627789;line-height:1.45}
.fm-stage-full{grid-column:1/-1}
.fm-stage-section-title{font-size:17px;line-height:1.35;margin:0 0 8px;color:#0b2d49}
.fm-stage-field+.fm-stage-section-note{margin-top:8px}
.fm-stage-section-note{font-size:13px;line-height:1.5;color:#617486;margin:0 0 14px}
.fm-stage-file-group{border:1px solid #d6e2eb;border-radius:12px;padding:14px;margin:0 0 12px;min-height:min-content;background:#fff}
.fm-stage-file-group[data-required="true"]{border-left:3px solid #b88c34}
.fm-stage-file-group h4{display:flex;align-items:center;flex-wrap:wrap;gap:9px;margin:0 0 6px;font-size:14px}
.fm-stage-tag{font-size:10px;font-weight:800;padding:3px 7px;border-radius:5px;background:#fff4dd;color:#795619}
.fm-stage-tag.is-optional{background:#edf3f7;color:#4f6679}
.fm-stage-file-group>p{margin:0 0 10px;font-size:12px;line-height:1.45;color:#617486}
.fm-stage-file-group input[type="file"]{display:block;width:100%;max-width:100%;box-sizing:border-box;min-height:44px;padding:8px;border:1px dashed #afc2d0;border-radius:8px;background:#f8fbfd;font-size:12px;color:#284a63}
.fm-stage-file-list{display:grid;gap:9px;margin-top:10px}
.fm-stage-file{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;padding:10px;border:1px solid #e2e9ef;border-radius:8px;background:#f9fbfc;min-width:0}
.fm-stage-file b{display:block;font-size:12px;overflow-wrap:anywhere;line-height:1.4}
.fm-stage-file small{display:block;font-size:11px;line-height:1.5;color:#617486;margin-top:3px}
.fm-stage-file-actions{display:flex;flex-wrap:wrap;gap:7px;align-items:center}
.fm-stage-file-actions a,.fm-stage-file-actions button{border:1px solid #d2dfe9;background:#fff;color:#204764;border-radius:6px;padding:7px 9px;font:inherit;font-size:11px;font-weight:700;text-decoration:none;cursor:pointer}
.fm-stage-file-actions a,.fm-stage-file-actions button{min-height:44px;display:inline-flex;align-items:center;box-sizing:border-box}
.fm-stage-file-actions button[data-remove]{color:#9b3030}
.fm-stage-existing{font-size:12px;color:#176040;background:#eff9f2;border:1px solid #cfe8d6;border-radius:7px;padding:9px;margin:8px 0}
.fm-stage-saved{border-top:1px solid #e3eaf0;padding-top:18px}
.fm-stage-saved h4{font-size:14px;margin:14px 0 8px}
.fm-stage-footer{padding:14px 24px 18px;border-top:1px solid #e3eaf0;background:#fff;display:grid;gap:10px;flex:none}
.fm-stage-footer progress{display:block;width:100%;height:8px;accent-color:#177754}
.fm-stage-progress-copy{margin:0;font-size:12px;color:#5b7081}
.fm-stage-message{margin:0;font-size:13px;line-height:1.5;overflow-wrap:anywhere;color:#345065}
.fm-stage-message.is-error{color:#9b2525}
.fm-stage-message.is-success{color:#156443}
.fm-stage-footer-actions{display:flex;justify-content:flex-end;gap:10px}
.fm-stage-footer button{min-height:44px;border-radius:9px;border:1px solid #cbd8e1;padding:10px 16px;background:#fff;color:#203d54;font:inherit;font-size:13px;font-weight:800;cursor:pointer}
.fm-stage-footer button[type="submit"]{background:#bd933f;border-color:#bd933f;color:#101e29}
.fm-stage-dialog button:disabled{opacity:.55;cursor:default}
.fm-stage-dialog :focus-visible{outline:3px solid #277cb8;outline-offset:3px}
.fm-stage-dialog [hidden]{display:none!important}
@media(max-width:600px){.fm-stage-dialog{width:calc(100vw - 12px);max-height:calc(100dvh - 12px);border-radius:13px}.fm-stage-form{max-height:calc(100dvh - 14px)}.fm-stage-head{padding:16px}.fm-stage-head h2{font-size:20px}.fm-stage-body{padding:16px;scrollbar-gutter:auto}.fm-stage-context{grid-template-columns:1fr;gap:10px}.fm-stage-fields{grid-template-columns:1fr}.fm-stage-footer{padding:12px 16px 16px}.fm-stage-file{grid-template-columns:1fr}.fm-stage-file-actions{justify-content:flex-start}.fm-stage-footer-actions>button{flex:1}.fm-stage-file-group{padding:12px}}

/* The PO detail column can be narrower than the shipment dialog. */
[data-po-evidence-root] .fm-stage-file { display:grid; grid-template-columns:minmax(0,1fr); gap:12px; }
[data-po-evidence-root] .fm-stage-file > div { min-width:0; }
[data-po-evidence-root] .fm-stage-file b,
[data-po-evidence-root] .fm-stage-file p,
[data-po-evidence-root] .fm-stage-file small { overflow-wrap:anywhere; }
[data-po-evidence-root] .fm-stage-file-actions { display:flex; flex-wrap:wrap; justify-content:flex-start; gap:8px; }

/* Global button display rules must not reveal hidden picker actions. */
.fm-stage-port-picker [hidden] { display:none !important; }
