/* Preserve the original DS160 shell; only the dynamic form mount is restyled. */
body.ds160-dynamic {
    --af-primary: #14286d;
    --af-primary-dark: #113871;
    --af-text: #464c4e;
    --af-muted: #666;
    --af-border: #d9d9d9;
    --af-shadow: none;
    background: #fff;
    color: #464c4e;
    padding-bottom: 0 !important;
}
.ds160-dynamic .content { position: relative; width: 100%; z-index: 1000; }
.ds160-dynamic .footer { position: relative !important; top: auto !important; bottom: auto !important; }
.ds160-dynamic .visa-form-mount { width: min(1200px, calc(100% - 32px)); margin: 32px auto 48px; min-height: 560px; }
.ds160-dynamic .af-page { grid-template-columns: 230px minmax(0, 1fr); gap: 18px; align-items: start; }
.ds160-dynamic .af-steps { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 8px; padding: 0; border: 0; border-radius: 0; max-height: calc(100vh - 48px); overflow-y: auto; background: transparent; }
.ds160-dynamic .af-steps li { flex: none; min-width: 0; padding: 14px 12px; background: #e0e4e9; border-radius: 4px; color: #464c4e; }
.ds160-dynamic .af-steps li:not(:last-child) { padding-right: 12px; }
.ds160-dynamic .af-steps li::before, .ds160-dynamic .af-steps li::after { display: none; }
.ds160-dynamic .af-steps li.is-current { color: #fff; background: #14286d; }
.ds160-dynamic .af-steps li.is-done { color: #fff; background: #024c8b; }
.ds160-dynamic .af-steps em { font-size: 14px; }
.ds160-dynamic .af-steps span { width: 26px; height: 26px; font-size: 12px; }
.ds160-dynamic .af-form-card { min-width: 0; border: 0; border-radius: 12px; background: #f3f4f6; box-shadow: none; }
.ds160-dynamic .af-step-content { padding: 32px; }
.ds160-dynamic .af-step-heading h2 { color: #333; font-size: 22px; }
.ds160-dynamic .af-actions { background: transparent; border-top-color: #ddd; }
.ds160-dynamic .af-status-card { border-radius: 12px; background: #f3f4f6; padding: 24px; }
@media (max-width: 767px) {
    .ds160-dynamic .visa-form-mount { width: calc(100% - 20px); margin-top: 18px; }
    .ds160-dynamic .af-page { grid-template-columns: minmax(0, 1fr); }
    .ds160-dynamic .af-steps { position: static; flex-direction: row; overflow-x: auto; max-height: none; }
    .ds160-dynamic .af-steps li { flex: 0 0 auto; min-width: 130px; }
    .ds160-dynamic .af-step-content { padding: 20px 16px; }
    .ds160-dynamic .top .logo img { max-width: calc(100vw - 75px); height: auto; }
}

.ds160-dynamic .af-form-card.layui-form { display: block; }

.ds160-dynamic .content { padding-top: 0; }
.ds160-dynamic .content .top { position: relative; }
.ds160-dynamic .content .nav { position: relative; top: auto; }
.ds160-dynamic .af-form-card .layui-input-block .layui-input,
.ds160-dynamic .af-form-card .layui-input-block .layui-form-select,
.ds160-dynamic .af-form-card .layui-input-block textarea { width: 100%; }
.ds160-dynamic .af-form-card .layui-btn-primary { color: #14286d; background: #fff; border-color: #14286d; }

.ds160-dynamic .af-upload .layui-btn-primary { color: #fff !important; background-color: #14286d !important; }
@media (max-width: 767px) {
    .ds160-dynamic .af-steps em { display: block; }
    .ds160-dynamic .top .logo img { max-width: calc(100vw - 105px); }
}

.ds160-dynamic .ds160-no-number { display: inline-flex; align-items: center; gap: 7px; margin-top: 8px; font-weight: normal; cursor: pointer; }
.ds160-dynamic .ds160-no-number input[type="checkbox"] { display: inline-block; width: 16px; height: 16px; margin: 0; accent-color: #113871; }
.ds160-dynamic .af-form-card input[readonly] { background-color: #f0f1f3; }

/* Keep controls legible against the original navy theme. */
.ds160-dynamic .af-form-card .layui-btn { color: #fff !important; }
.ds160-dynamic .af-form-card .layui-btn-primary { background: #fff !important; color: #14286d !important; border-color: #14286d !important; }
.ds160-dynamic .af-form-card .layui-form-select dl dd.layui-this,
.ds160-dynamic .af-form-card .layui-form-select dl dd.layui-this * { background-color: #14286d !important; color: #fff !important; }
.ds160-dynamic .af-steps li { padding: 0; }
.ds160-dynamic .af-steps li button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px 12px; border: 0; border-radius: 4px; background: transparent; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.ds160-dynamic .af-steps li button:focus-visible { outline: 2px solid #337ab7; outline-offset: 2px; }
.ds160-dynamic .af-steps li button:disabled { cursor: default; }

.ds160-camera-dialog { width: min(640px, 90vw); border: 0; border-radius: 12px; padding: 24px; color: #173567; }
.ds160-camera-dialog::backdrop { background: rgba(0,0,0,.55); }
.ds160-camera-dialog video { display: block; width: 100%; max-height: 60vh; background: #111; margin: 12px 0; }
.ds160-camera-dialog .ds160-camera-status { min-height: 24px; }

.ds160-dynamic .af-field-section[hidden] { display: none !important; }

/* DS160 visual language: warm background, quiet completed steps, navy actions. */
body.ds160-dynamic{--af-primary:#142b50;--af-primary-dark:#102440;--af-text:#243c55;--af-muted:#718092;--af-border:#dce5eb;background:#f5f7f8;color:#243c55;font-family:"Microsoft YaHei","PingFang SC",sans-serif}
.ds160-dynamic .visa-form-mount{width:min(1200px,calc(100% - 48px));margin:40px auto 64px;min-height:560px}
.ds-draft-toolbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:22px;margin-bottom:32px;color:#142b50}
.ds-draft-heading>p{font-size:12px;letter-spacing:2px;color:#217e87;margin:0 0 10px}.ds-draft-heading h1{font-size:28px;font-weight:600;line-height:1.5;margin:0 0 9px}.ds-draft-heading>span{font-size:14px;color:#718092}.ds-draft-controls{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap}.ds-draft-controls label{display:flex;flex-direction:column;gap:7px;font-size:12px;color:#718092;margin:0}.ds-draft-controls select{display:block!important;width:260px;max-width:100%;height:44px;background:#fff;border:1px solid #d4dfe6;border-radius:6px;color:#243c55;font-size:13px;padding:0 10px}.ds-draft-controls button{height:44px;border:1px solid #cbd8e1;border-radius:6px;padding:0 15px;background:#fff;color:#142b50;font-size:13px;cursor:pointer}.ds-draft-controls [data-draft-new]{background:#142b50;color:#fff;border-color:#142b50}.ds-draft-controls button:disabled{opacity:.55;cursor:wait}.ds-draft-controls button[hidden]{display:none!important}.ds-draft-message{width:100%;font-size:13px;color:#217e87;margin:0}.ds-draft-message:empty{display:none}
.ds160-dynamic .af-page{grid-template-columns:220px minmax(0,1fr);gap:30px}.ds160-dynamic .af-steps{gap:6px;padding:12px;background:#fff;border:1px solid #e1e8ed;border-radius:10px}.ds160-dynamic .af-steps li,.ds160-dynamic .af-steps li:not(:last-child){padding:0;background:transparent;color:#778697;border-radius:6px}.ds160-dynamic .af-steps li button{padding:14px 10px;border-radius:6px;gap:10px}.ds160-dynamic .af-steps li.is-done{background:#eef6f5;color:#28696c}.ds160-dynamic .af-steps li.is-current{background:#142b50;color:#fff}.ds160-dynamic .af-steps li span{background:#edf1f5;color:#6a7c8e;border:0;width:25px;height:25px}.ds160-dynamic .af-steps li.is-done span{background:#d7ece8;color:#217e87}.ds160-dynamic .af-steps li.is-current span{background:#ffffff25;color:#fff}.ds160-dynamic .af-steps em{font-size:13px;line-height:1.5}.ds160-dynamic .af-form-card{background:#fff;border:1px solid #e0e7ec;border-radius:12px;box-shadow:0 8px 28px #142b5004}.ds160-dynamic .af-step-content{padding:36px 36px 40px}.ds160-dynamic .af-step-heading{margin-bottom:28px;padding-bottom:22px;border-bottom:1px solid #edf1f4}.ds160-dynamic .af-step-heading h2{font-size:25px;font-weight:600;color:#142b50}.ds160-dynamic .af-field-section{background:transparent!important;border-left:3px solid #217e87!important;border-bottom:1px solid #e4ebef!important;padding:10px 0 12px 14px!important;margin-top:22px!important;color:#234b59;font-size:17px;font-weight:600}.ds160-dynamic .af-form-card .layui-input,.ds160-dynamic .af-form-card .layui-textarea,.ds160-dynamic .af-form-card select{border-color:#d5dfe6;border-radius:6px!important;background:#fff;color:#243c55;box-shadow:none;min-height:44px}.ds160-dynamic .af-form-card .layui-input:focus,.ds160-dynamic .af-form-card .layui-textarea:focus{border-color:#217e87!important;box-shadow:0 0 0 3px #217e8710}.ds160-dynamic .af-form-card .layui-form-label{color:#344d64;font-size:14px;font-weight:500}.ds160-dynamic .af-form-card .layui-btn{background:#142b50;border-radius:6px}.ds160-dynamic .af-form-card .layui-btn-primary{border-color:#bdceda!important;color:#142b50!important}.ds160-dynamic .af-actions{padding:22px 32px;background:#fbfcfd;border-top:1px solid #e4ebef;border-radius:0 0 12px 12px}.ds160-dynamic .af-actions .layui-btn{min-width:120px;height:44px;line-height:42px}.ds160-dynamic .af-form-card input[readonly]{background:#f1f4f6;color:#718092}.ds160-dynamic .af-status-card{background:#fff;border:1px solid #e0e7ec}.ds-draft-controls select:focus-visible,.ds-draft-controls button:focus-visible{outline:2px solid #217e87;outline-offset:3px}
@media(max-width:1000px){.ds-draft-toolbar{align-items:flex-start}.ds-draft-controls{width:100%}.ds-draft-controls label{flex:1}.ds-draft-controls select{width:100%}}
@media(max-width:767px){.ds160-dynamic .visa-form-mount{width:calc(100% - 24px);margin-top:26px}.ds-draft-heading h1{font-size:23px}.ds-draft-toolbar{gap:18px;margin-bottom:22px}.ds-draft-controls label{flex-basis:100%}.ds-draft-controls button{flex:1;padding-inline:8px}.ds160-dynamic .af-page{grid-template-columns:minmax(0,1fr);gap:18px}.ds160-dynamic .af-steps{padding:8px;gap:7px;flex-direction:row}.ds160-dynamic .af-steps li{min-width:120px}.ds160-dynamic .af-step-content{padding:25px 18px}.ds160-dynamic .af-step-heading h2{font-size:22px}.ds160-dynamic .af-actions{padding:18px}.ds160-dynamic .af-actions .layui-btn{min-width:105px}.ds160-dynamic .af-field-section{font-size:16px}}

.ds160-dynamic .af-field-section{border:0!important;padding:0!important;margin:12px 0 8px!important}.ds160-dynamic .af-field-section h3{border-left:3px solid #217e87!important;border-bottom:1px solid #e4ebef!important;padding:10px 0 12px 14px!important;margin:0!important;color:#234b59;font-size:17px;font-weight:600;background:transparent}

/* Keep the passport upload and camera actions aligned, including on mobile. */
.ds160-dynamic .ds160-passport-actions{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:4px 0 10px}
.ds160-dynamic .ds160-passport-actions .af-upload{display:flex;align-items:center;gap:8px;margin:0;min-width:0}
.ds160-dynamic .ds160-passport-actions .layui-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:40px;line-height:1;padding:0 16px;margin:0;font-size:14px}
.ds160-dynamic .ds160-passport-actions .layui-icon{margin:0;font-size:17px}
.ds160-dynamic .ds160-passport-actions .af-upload-status:empty{display:none}
.ds160-dynamic .ds160-passport-actions .layui-btn:hover{border-color:#217e87!important;background:#f1f8f7!important;color:#217e87!important}
.ds160-dynamic .ds160-passport-actions .layui-btn:focus-visible{outline:2px solid #217e87;outline-offset:3px}

.ds160-dynamic [data-field-wrapper="visa_detail"] .layui-form-select dl dt{background:#eef3f7;color:#344d64;font-weight:600;line-height:36px;padding:0 12px;border-top:1px solid #dce5eb}
.ds160-dynamic [data-field-wrapper="visa_detail"] .layui-form-select dl dd{padding-left:22px;white-space:normal;line-height:1.6;padding-top:8px;padding-bottom:8px}

/* Submitted application receipt. */
.ds160-dynamic .af-submitted{display:flex;flex-direction:column;align-items:center;gap:0;max-width:680px;min-height:0;box-sizing:border-box;padding:40px 44px;margin:12px auto 36px;text-align:center;box-shadow:0 12px 36px rgba(20,43,80,.04)}
.ds160-dynamic .af-submitted-icon{display:flex;align-items:center;justify-content:center;width:60px;height:60px;border-radius:50%;background:#e7f4f0;color:#218375;font-size:30px;margin-bottom:20px}
.ds160-dynamic .af-submitted h2{font-size:26px;font-weight:600;line-height:1.4;color:#142b50;margin:0 0 10px}
.ds160-dynamic .af-submitted-description{font-size:16px;color:#42566e;margin:0;line-height:1.8}
.ds160-dynamic .af-submitted-order{display:flex;justify-content:space-between;align-items:center;gap:16px;width:100%;box-sizing:border-box;padding:18px 20px;margin:26px 0;background:#f5f8fa;border:1px solid #e8eef2;border-radius:8px;font-size:14px;color:#6b7e90}
.ds160-dynamic .af-submitted-order strong{font-size:16px;font-weight:600;color:#243e5c;overflow-wrap:anywhere;min-width:0}
.ds160-dynamic .af-submitted-actions{display:flex;justify-content:center;flex-wrap:wrap;gap:12px;width:100%}
.ds160-dynamic .af-submitted-actions .layui-btn{margin:0;min-width:150px;height:44px;line-height:42px;padding:0 22px;background:#142b50;color:#fff;border:1px solid #142b50;border-radius:6px;font-size:14px}
.ds160-dynamic .af-submitted-actions .layui-btn-primary{background:#fff;color:#142b50;border-color:#bdceda}
.ds160-dynamic .af-submitted-actions .layui-btn:focus-visible{outline:2px solid #217e87;outline-offset:3px}
.ds160-dynamic .af-submitted .af-submitted-hint{font-size:14px;color:#52667b;margin:18px 0 0}
.ds160-dynamic .af-submitted .af-entry-error:empty{display:none}
.ds160-dynamic .af-submitted .af-entry-error:not(:empty){margin-bottom:18px}
@media(max-width:600px){.ds160-dynamic .af-submitted{padding:28px 20px;margin-top:0}.ds160-dynamic .af-submitted h2{font-size:23px}.ds160-dynamic .af-submitted-order{flex-direction:column;gap:6px;padding:15px}.ds160-dynamic .af-submitted-actions{flex-direction:column}.ds160-dynamic .af-submitted-actions .layui-btn{width:100%}}

.ds-draft-controls{max-width:100%;min-width:0}.ds-draft-controls label{min-width:0}.ds-draft-controls select{width:360px;font-weight:400;padding-right:28px}.ds-draft-controls select option{font-weight:400;background:#fff;color:#243c55}@media(max-width:1000px){.ds-draft-controls select{width:100%}}

/* Keep application controls legible against the light page background. */
.ds160-dynamic .ds-draft-controls label{font-size:14px;font-weight:400;color:#42566e}.ds160-dynamic .ds-draft-controls select,.ds160-dynamic .ds-draft-controls button{font-family:"Microsoft YaHei","PingFang SC",Arial,sans-serif;font-size:15px;font-weight:400;line-height:1.5;text-shadow:none}.ds160-dynamic .ds-draft-controls select{color:#20344d;background-color:#fff;width:400px;height:46px}.ds160-dynamic .ds-draft-controls option{font-family:inherit;font-size:15px;font-weight:400;color:#20344d;background-color:#fff}.ds160-dynamic .ds-draft-heading>span{color:#52667b;font-size:15px}.ds160-dynamic .af-submitted-actions .layui-btn{font-size:16px}.ds160-dynamic .af-submitted-order{color:#42566e;font-size:15px}@media(max-width:1000px){.ds160-dynamic .ds-draft-controls select{width:100%}}

/* Both restored and newly submitted receipts use this action. */
body.ds160-dynamic .af-entry button[data-new-application],body.ds160-dynamic .af-entry button[data-new-application]:hover,body.ds160-dynamic .af-entry button[data-new-application]:focus{background:#fff!important;color:#142b50!important;border:1px solid #a6b9cc!important;opacity:1;text-shadow:none;font-size:16px}
body.ds160-dynamic .layui-layer-btn .layui-layer-btn0{background:#142b50;border-color:#142b50;color:#fff}body.ds160-dynamic .layui-layer-dialog{max-width:calc(100vw - 32px);border-radius:10px;overflow:hidden}body.ds160-dynamic .layui-layer-title{background:#f5f7f8;color:#142b50;font-size:16px}body.ds160-dynamic .layui-layer-content{color:#243c55;font-size:15px;line-height:1.8}

.af-actions .ds-save-later{margin-left:auto;color:#147880!important;border:1px solid #9fc0c2!important;background:#fff!important}
/* Explicit positioning survives the site's global margin reset. */
dialog.ds-resume-dialog{position:fixed;inset:0;margin:auto;width:calc(100% - 32px);max-width:560px;max-height:calc(100dvh - 32px);height:fit-content;overflow:auto;border:1px solid #dce7e8;border-radius:18px;padding:30px;color:#143447;background:#fff;box-shadow:0 24px 80px #102d4633;font:14px/1.65 "Microsoft YaHei","PingFang SC",Arial,sans-serif;text-align:left}
.ds-resume-dialog,.ds-resume-dialog *{box-sizing:border-box}
.ds-resume-dialog::backdrop{background:rgba(15,36,51,.48)}
.ds-resume-heading{display:flex;align-items:center;gap:14px}.ds-resume-check{display:grid;place-items:center;flex:0 0 46px;height:46px;background:#eaf5f2;border-radius:50%;font-size:25px;color:#147880}
.ds-resume-dialog h2{font-size:23px;font-weight:600;line-height:1.4;margin:0;color:#143447}.ds-resume-heading p{margin:4px 0 0;color:#6b7e87}
.ds-resume-dialog button,.ds-resume-dialog a{font:inherit;display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:8px 16px;border:1px solid #147880;border-radius:7px;color:#fff;background:#147880;cursor:pointer;text-decoration:none;white-space:nowrap}
.ds-resume-dialog [data-close]{margin-left:auto;align-self:flex-start;min-height:32px;width:32px;padding:0;border:0;background:transparent;color:#75858d;font-size:25px}
.ds-resume-dialog .ds-resume-description{margin:22px 0;color:#627581;line-height:1.8}
.ds-resume-link-box{padding:16px;background:#f3f8f8;border:1px solid #e0ebeb;border-radius:10px}
.ds-resume-dialog label{display:block;margin:16px 0 7px;font-weight:500;color:#304d5c}.ds-resume-link-box label{margin:0 0 9px}
.ds-resume-dialog input{display:block;width:100%;min-width:0;height:44px;margin:0;padding:10px 12px;border:1px solid #cddce0;border-radius:7px;background:#fff;color:#304d5c;font:400 14px/1.5 "Microsoft YaHei",Arial,sans-serif;box-shadow:none}
.ds-resume-dialog input:focus{outline:2px solid #14788033;border-color:#147880}.ds-resume-dialog .ds-resume-url{font-size:13px}
.ds-resume-link-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:12px}.ds-resume-dialog .ds-resume-expiry{margin:0;font-size:12px;color:#6b7e87}.ds-resume-dialog [data-copy]{min-height:34px;padding:5px 12px;background:#fff;color:#147880;border-color:#aacbcd}
.ds-resume-send-title{margin-top:24px;font-size:15px;font-weight:600}.ds-resume-send-row{display:flex;gap:10px}.ds-resume-send-row input{flex:1}.ds-resume-send-row button{flex-shrink:0;background:#fff;color:#147880;border-color:#aacbcd;min-width:102px}
.ds-resume-dialog button:disabled{opacity:.5;cursor:wait}.ds-resume-dialog button:hover:not(:disabled),.ds-resume-dialog a:hover{filter:brightness(.95)}.ds-resume-dialog :focus-visible{outline:2px solid #147880;outline-offset:3px}
.ds-resume-dialog .ds-resume-message{margin:12px 0;color:#147880;overflow-wrap:anywhere}.ds-resume-message:empty{display:none}
.ds-resume-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid #e7edef;margin-top:24px;padding-top:20px}.ds-resume-footer span{font-size:12px;color:#7a8b93}
@media(max-width:600px){.af-actions{flex-wrap:wrap;gap:10px}.af-actions .ds-save-later{margin-left:0;order:3;width:100%}dialog.ds-resume-dialog{padding:22px 18px;border-radius:14px}.ds-resume-dialog h2{font-size:21px}.ds-resume-link-actions{flex-wrap:wrap}.ds-resume-send-row{gap:8px}.ds-resume-send-row button{min-width:88px;padding:8px 12px}}

/* Keep long schema option labels inside their own field. */
.ds160-dynamic .af-form-card .layui-form-select{min-width:0;max-width:100%}
.ds160-dynamic .af-form-card .layui-form-select dl{box-sizing:border-box;left:0;right:0;width:100%;min-width:0;max-width:100%;max-height:300px;max-height:min(300px,50vh);padding:6px;margin:0;border:1px solid #d5e2e6;border-radius:8px;background:#fff;box-shadow:0 8px 24px rgba(20,52,71,.12);overflow-x:hidden;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#bdcdd3 #f5f8f9}
.ds160-dynamic .af-form-card .layui-form-select dl dd,.ds160-dynamic .af-form-card .layui-form-select dl dt{box-sizing:border-box;white-space:normal;overflow-wrap:anywhere;word-break:normal;height:auto;min-height:38px;line-height:1.65;padding:9px 12px;margin:0;border-radius:5px;font-size:14px;color:#304d5c;text-align:left}
.ds160-dynamic .af-form-card .layui-form-select dl dt{font-weight:600;background:#f2f6f7;color:#617985;border-radius:3px}
.ds160-dynamic .af-form-card .layui-form-select dl dd:hover{background:#edf5f5;color:#147880}
.ds160-dynamic .af-form-card .layui-form-select dl dd.layui-this,.ds160-dynamic .af-form-card .layui-form-select dl dd.layui-this *{background-color:#147880!important;color:#fff!important}
.ds160-dynamic .af-form-card .layui-form-select dl dd.layui-disabled{color:#98a5ac!important;background:#fff!important;cursor:not-allowed}
.ds160-dynamic .af-form-card .layui-form-select dl dd.layui-select-tips{color:#85959e}
.ds160-dynamic .af-form-card .layui-form-select .layui-select-title input{padding-right:32px;text-overflow:ellipsis;background:#fff}
.ds160-dynamic .af-form-card .layui-form-selected .layui-select-title input{border-color:#147880;box-shadow:0 0 0 2px rgba(20,120,128,.10)}
