
*{box-sizing:border-box} body{margin:0;font-family:Arial,"Noto Sans KR",sans-serif;background:#f5f6f8;color:#1b1e23}
.app{display:grid;grid-template-columns:235px 1fr;min-height:100vh}
aside{background:#111827;color:white;padding:24px 16px;display:flex;flex-direction:column;gap:8px}
.brand{font-size:23px;font-weight:800;margin:4px 8px 28px}.brand span{display:block;font-size:11px;color:#9ca3af;margin-top:4px;letter-spacing:.5px}
.nav{border:0;background:transparent;color:#cbd5e1;text-align:left;padding:13px 14px;border-radius:9px;font-weight:700;cursor:pointer}
.nav:hover,.nav.active{background:#263247;color:white}.side-note{margin-top:auto;color:#6b7280;font-size:12px;padding:8px}
main{padding:26px 30px;min-width:0} header{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px}
h1{margin:0 0 6px;font-size:25px} header p{margin:0;color:#6b7280;font-size:14px}
.live{font-size:13px;background:white;border:1px solid #e5e7eb;padding:9px 12px;border-radius:20px}.live i{display:inline-block;width:8px;height:8px;border-radius:50%;background:#10b981;margin-right:5px}
.cards{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;margin-bottom:18px}.card,.panel{background:white;border:1px solid #e5e7eb;border-radius:12px}
.card{padding:16px}.card b{display:block;font-size:24px;margin-top:6px}.muted{color:#6b7280;font-size:12px}
.alerts{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:18px}.alert{padding:13px;border-radius:10px;background:white;border:1px solid #e5e7eb;font-size:13px}.alert.red{border-left:4px solid #ef4444}.alert.orange{border-left:4px solid #f59e0b}.alert.yellow{border-left:4px solid #eab308}
.panel{padding:18px;margin-bottom:18px}.panel-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:13px}.panel-title h3{margin:0}
table{width:100%;border-collapse:collapse;font-size:13px} th{text-align:left;color:#6b7280;background:#f9fafb;padding:11px;border-bottom:1px solid #e5e7eb}td{padding:11px;border-bottom:1px solid #eef0f2;vertical-align:middle}
.badge{display:inline-block;padding:5px 8px;border-radius:999px;background:#eef2ff;font-size:11px;font-weight:700}.badge.warn{background:#fff7ed}.badge.ok{background:#ecfdf5}
button.primary,button.small{border:0;background:#111827;color:#fff;border-radius:8px;cursor:pointer}.primary{padding:10px 13px}.small{padding:7px 9px;font-size:12px}
.grid2{display:grid;grid-template-columns:1.15fr .85fr;gap:16px}.timeline{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:14px}.stage{padding:8px 10px;border-radius:8px;background:#f3f4f6;font-size:12px}.stage.current{background:#111827;color:white}
.formgrid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}.field label{display:block;font-size:11px;color:#6b7280;margin-bottom:5px}.field input,.field select,.field textarea{width:100%;padding:9px;border:1px solid #d1d5db;border-radius:7px;background:white}.field textarea{min-height:82px}
.toolbar{display:flex;gap:8px;align-items:center;margin-bottom:14px}.toolbar select{padding:9px;border:1px solid #d1d5db;border-radius:7px;background:white}
.comment{padding:10px 0;border-bottom:1px solid #eee}.comment strong{font-size:12px}.comment p{margin:4px 0;font-size:13px}.comment time{font-size:11px;color:#9ca3af}
.doc{display:flex;justify-content:space-between;padding:9px 0;border-bottom:1px solid #eee;font-size:12px}
@media(max-width:1200px){.cards{grid-template-columns:repeat(3,1fr)}}
@media(max-width:1000px){.cards{grid-template-columns:repeat(2,1fr)}.alerts{grid-template-columns:1fr}.grid2{grid-template-columns:1fr}.app{grid-template-columns:1fr}aside{display:none}main{padding:16px}}

.importbox{border-left:4px solid #111827}.importrow{display:flex;gap:10px;align-items:center}.importrow input{flex:1;padding:10px;border:1px dashed #cbd5e1;border-radius:8px;background:#f9fafb}.previewHead,.previewActions{display:flex;justify-content:space-between;align-items:center;margin-top:16px;padding:11px 0}.tablewrap{overflow:auto;max-height:320px;border:1px solid #e5e7eb;border-radius:9px}.previewActions .primary:disabled{opacity:.4;cursor:not-allowed}
.previewHint{margin-top:5px}.importTable{min-width:1450px}.previewInput,.previewArea{width:100%;min-width:110px;padding:7px 8px;border:1px solid #d7dce3;border-radius:6px;background:#fff;font:inherit}.previewInput.wide{min-width:210px}.previewArea{min-width:250px;min-height:58px;resize:vertical}.rawValue{margin-top:5px;font-size:10px;color:#7c8491;line-height:1.35}.fieldWarning{margin-top:5px;padding:5px 7px;border-radius:5px;background:#fff7ed;color:#9a3412;font-size:10px}.badge.check{background:#fff7ed;color:#9a3412}.needsCheck td{background:#fffdf8}.importTable th{position:sticky;top:0;z-index:1}
.docTabs{display:flex;gap:6px;margin:14px 0}.docTab{border:1px solid #d8dde5;background:#fff;padding:9px 16px;border-radius:8px;font-weight:700;cursor:pointer}.docTab.active{background:#111827;color:#fff;border-color:#111827}.hidden{display:none!important}.ghost{background:#fff!important;color:#374151!important;border:1px solid #d1d5db!important}.docResult{margin-top:18px;border-top:1px solid #e5e7eb;padding-top:16px}.resultTitle{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:12px}.resultTitle span{font-size:12px;color:#6b7280}.resultGrid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.resultGrid>div{border:1px solid #e5e7eb;border-radius:9px;padding:11px;background:#fafbfc}.resultGrid small{display:block;color:#6b7280;margin-bottom:5px}.resultGrid b{font-size:13px;word-break:break-word}.matchBox{margin-top:12px;padding:13px;border-radius:9px;background:#f7f8fa;display:grid;grid-template-columns:180px 1fr auto;gap:10px;align-items:center}.matchBox label{font-size:12px;font-weight:700}.matchBox select{padding:9px;border:1px solid #d1d5db;border-radius:7px;background:#fff}.matchBox .muted{grid-column:2/3}@media(max-width:1000px){.resultGrid{grid-template-columns:1fr}.matchBox{grid-template-columns:1fr}.matchBox .muted{grid-column:auto}}

.matchEvidence{margin:10px 0;padding:11px 12px;border:1px solid #e5e7eb;border-radius:9px;background:#fff}.matchEvidence b{display:block;margin-bottom:7px}.evidence{font-size:12px;margin:4px 0}.evidence.ok{color:#047857}.evidence.warn{color:#b45309}.evidence.info{color:#6b7280}

.stepActions{display:flex;gap:8px;flex-wrap:wrap}
.collabPanel{border-left:4px solid #111827}

.statusStrip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:14px 0 18px}
.statusStrip>div,.currentLocation,.nextOwner{background:#f8fafc;border:1px solid #e5e7eb;border-radius:10px;padding:12px}
.statusStrip span,.currentLocation span,.nextOwner span{display:block;font-size:12px;color:#64748b;margin-bottom:5px}
.statusStrip b,.currentLocation b,.nextOwner b{font-size:14px}
.roleBlock{border-top:1px solid #e5e7eb;padding-top:16px;margin-top:12px}
.roleHead{display:flex;align-items:center;gap:10px;margin-bottom:14px}.roleHead span{font-size:12px;color:#64748b}
.mediaBox{margin-top:12px;padding:14px;background:#f8fafc;border:1px solid #e5e7eb;border-radius:10px}
.mediaUpload{display:flex;gap:8px;align-items:center;margin:10px 0;flex-wrap:wrap}
.mediaList{display:flex;flex-direction:column;gap:5px;margin:8px 0 12px}.mediaList a{font-size:12px}
.incomingSummary{display:flex;gap:18px;flex-wrap:wrap;background:#f8fafc;padding:12px;border-radius:10px;margin-bottom:12px;font-size:13px}
button:disabled{opacity:.45;cursor:not-allowed}
@media(max-width:900px){.statusStrip{grid-template-columns:1fr 1fr}}

.gateRow{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:8px 0}
.gateHint{font-size:12px;font-weight:700;padding:6px 9px;border-radius:999px;border:1px solid #e5e7eb;background:#f8fafc}
.gateHint.ready{background:#ecfdf5;border-color:#a7f3d0;color:#047857}
.gateHint.locked{background:#f8fafc;border-color:#e5e7eb;color:#64748b}
.gateHint.done{background:#eff6ff;border-color:#bfdbfe;color:#1d4ed8}

.transportSummary{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin:12px 0}
.transportSummary>div{border:1px solid #e5e7eb;border-radius:9px;padding:10px;background:#f8fafc}
.transportSummary span{display:block;font-size:11px;color:#64748b;margin-bottom:4px}.transportSummary b{font-size:13px}
.transportActual{margin-top:14px;padding-top:14px;border-top:1px solid #e5e7eb}
@media(max-width:900px){.transportSummary{grid-template-columns:repeat(2,minmax(0,1fr))}}

.customsSummary{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin:12px 0}.customsSummary>div{border:1px solid #e5e7eb;border-radius:9px;padding:10px;background:#f8fafc}.customsSummary span{display:block;font-size:11px;color:#64748b;margin-bottom:4px}.customsDocsHint{margin-top:12px;padding:10px 12px;background:#f8fafc;border-radius:8px;color:#475569;font-size:12px}@media(max-width:900px){.customsSummary{grid-template-columns:repeat(2,minmax(0,1fr))}}

.noticePreview{width:100%;min-height:190px;resize:vertical;line-height:1.65;background:#f8fafc;border:1px solid #d9e0e8;border-radius:10px;padding:14px;box-sizing:border-box}
.internalFold{padding:0!important;overflow:hidden}
.internalFold>summary{cursor:pointer;padding:18px 20px;list-style:none}
.internalFold>summary::-webkit-details-marker{display:none}
.internalFold>.panel-title,.internalFold>.formgrid,.internalFold>.gateRow,.internalFold>div:not(summary){margin-left:20px;margin-right:20px}

.modeBox{display:grid;grid-template-columns:110px minmax(280px,520px) 1fr;gap:12px;align-items:center;padding:13px 14px;margin:10px 0 14px;background:#f8fafc;border:1px solid #dce3eb;border-radius:10px}
.modeBox select{min-height:40px;border:1px solid #cfd7e2;border-radius:8px;padding:0 10px;background:#fff}
.simpleModeHint{margin:10px 0 14px;padding:12px 14px;border:1px solid #cfe0ff;background:#f5f8ff;border-radius:10px;line-height:1.55}
.hidden{display:none!important}

.forwarderWorkspace{border-left:4px solid #101828}.forwarderWorkspace .roleBlock{margin-top:14px;padding:16px;border:1px solid #e0e5ec;border-radius:12px;background:#fbfcfe}.forwarderWorkspace textarea{width:100%;min-height:72px;box-sizing:border-box;border:1px solid #cfd7e2;border-radius:8px;padding:10px;margin-top:6px}

.forwarderFlowHint{margin:14px 0;padding:14px 16px;border:1px solid #dbe3ec;border-radius:12px;background:#f7f9fc;display:flex;flex-direction:column;gap:5px}
.forwarderFlowHint span{font-weight:700;color:#101828}
.forwarderFlowHint small{color:#667085;line-height:1.5}

/* v0.7.6 visual alignment */
.roleBlock, .forwarderPanel {
  border:1px solid #dfe4ec;
  border-radius:14px;
  background:#fff;
  padding:22px;
  box-sizing:border-box;
}
.forwarderPanel { margin-top:14px; }
.roleHead, .forwarderStepHeading {
  display:flex;
  align-items:flex-start;
  gap:10px;
  margin:0 0 16px;
}
.forwarderStepHeading small {
  display:block;
  margin-top:3px;
  color:#667085;
  font-size:13px;
  font-weight:400;
}
.stepNo {
  width:26px;height:26px;flex:0 0 26px;
  display:inline-flex;align-items:center;justify-content:center;
  border:1px solid #cfd6e2;border-radius:50%;
  font-weight:800;background:#fff;
}
.roleBlock .formgrid, .forwarderPanel .formgrid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px 18px;
}
.roleBlock input,.roleBlock select,.roleBlock textarea,
.forwarderPanel input,.forwarderPanel select,.forwarderPanel textarea {
  width:100%;box-sizing:border-box;
}
.roleBlock textarea,.forwarderPanel textarea { min-height:92px; }
.incomingSummary {
  display:grid !important;
  grid-template-columns:repeat(4,minmax(0,1fr));
  border:1px solid #e4e7ec;border-radius:10px;
  background:#f8fafc;overflow:hidden;padding:0 !important;
}
.incomingSummary>span {
  padding:13px 14px;border-right:1px solid #e4e7ec;min-width:0;
}
.incomingSummary>span:last-child { border-right:0; }
@media(max-width:900px){
  .roleBlock .formgrid,.forwarderPanel .formgrid{grid-template-columns:1fr}
  .incomingSummary{grid-template-columns:1fr 1fr}
}


/* =========================================================
   v0.7.7 — Workroom layout normalization
   Goal: every major section shares one content width / left edge.
   ========================================================= */

/* 공동작업방은 좌/우 2단을 없애고 한 개의 기준선으로 정렬 */
.grid2{
  display:block !important;
  width:100%;
}
.grid2 > div{
  width:100% !important;
  min-width:0;
}

/* 모든 최상위 카드 폭/좌우 기준 통일 */
.grid2 > div > .panel,
.collabPanel,
.transportPanel,
.customsPanel,
.domesticPanel,
.customerDeliveryPanel,
.internalFold{
  width:100% !important;
  max-width:none !important;
  box-sizing:border-box;
  margin-left:0 !important;
  margin-right:0 !important;
  margin-bottom:16px !important;
}

/* 포워더 입력센터가 transportPanel 안에서 한 단계 안쪽으로 밀리던 문제 보정 */
.transportPanel > .forwarderWorkspace{
  width:calc(100% + 36px) !important;
  max-width:none !important;
  margin-left:-18px !important;
  margin-right:-18px !important;
  margin-top:-18px !important;
  margin-bottom:18px !important;
  border-radius:12px !important;
  box-sizing:border-box;
}

/* 주요 업무 카드의 왼쪽 강조선 위치와 굵기 통일 */
.collabPanel,
.forwarderWorkspace{
  border-left:4px solid #111827 !important;
}

/* 내부 역할 카드에는 별도 검은 세로선을 만들지 않음 */
.roleBlock{
  border-left:1px solid #dfe4ec !important;
}

/* DNFIX 공유정보와 포워더 입력영역의 내부 좌우 여백 통일 */
.collabPanel > .roleBlock,
.forwarderWorkspace > .roleBlock{
  margin-left:0 !important;
  margin-right:0 !important;
}

/* 단계 진행 / 공동 메모 / 공동 서류함도 업무 카드와 완전히 같은 폭 */
.grid2 > div:last-child > .panel{
  width:100% !important;
  max-width:none !important;
  margin:0 0 16px 0 !important;
  box-sizing:border-box;
}

/* 세 보조 카드의 내부 간격과 제목 위치 통일 */
.grid2 > div:last-child > .panel{
  padding:20px !important;
}
.grid2 > div:last-child > .panel > h3{
  margin:0 0 16px 0;
}
.grid2 > div:last-child .currentLocation,
.grid2 > div:last-child .nextOwner{
  margin:0;
}
.grid2 > div:last-child .nextOwner{
  margin-top:8px;
}

/* 공동 메모 textarea / 공동 서류함 select도 카드 폭에 맞춤 */
#commentBody,
#docType{
  width:100% !important;
  box-sizing:border-box;
}
#commentBody{
  min-height:96px;
  resize:vertical;
}

/* 상단 상태/공유 정보 그리드의 높이와 간격 통일 */
.statusStrip{
  align-items:stretch;
}
.statusStrip > div{
  min-height:72px;
  box-sizing:border-box;
}
.incomingSummary{
  width:100%;
  box-sizing:border-box;
}

/* 섹션 제목과 설명의 기준선 통일 */
.panel-title{
  min-height:38px;
  align-items:flex-start;
}
.roleHead{
  min-height:28px;
}

/* 데스크톱에서 과도하게 길어지는 입력창은 2열 유지 */
@media (min-width:901px){
  .forwarderWorkspace .formgrid,
  .roleBlock .formgrid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

/* 모바일은 자연스럽게 1열 */
@media (max-width:900px){
  .transportPanel > .forwarderWorkspace{
    width:calc(100% + 36px) !important;
  }
}


/* v0.7.8 — customs select + forwarder identification */
.customsStatusField select,
#customs_work_status{
  width:100% !important;
  min-height:38px !important;
  padding:8px 10px !important;
  border:1px solid #cfd6e2 !important;
  border-radius:8px !important;
  background:#fff !important;
  box-sizing:border-box !important;
  font:inherit;
  color:#111827;
}
.forwarderOnly .incomingSummary{
  grid-template-columns:repeat(5,minmax(0,1fr));
}
@media (max-width:1100px){
  .forwarderOnly .incomingSummary{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (max-width:650px){
  .forwarderOnly .incomingSummary{grid-template-columns:1fr;}
}


/* v0.7.9 — exact field styling for forwarder customs status */
#fw_customs_status,
#customs_work_status{
  display:block !important;
  width:100% !important;
  height:38px !important;
  min-height:38px !important;
  padding:0 10px !important;
  margin:0 !important;
  border:1px solid #d1d5db !important;
  border-radius:7px !important;
  background-color:#fff !important;
  color:#111827 !important;
  font:inherit !important;
  line-height:normal !important;
  box-sizing:border-box !important;
  appearance:auto;
}
.forwarderWorkspace .field > label{
  display:block !important;
  font-size:11px !important;
  color:#6b7280 !important;
  margin-bottom:5px !important;
}
.forwarderWorkspace .field{
  min-width:0;
}
.forwarderFlowHint{
  margin:14px 0 !important;
}
.forwarderMirrorNotice{
  background:#f8fafc;
}

/* v0.8.0 merged customs/tax-invoice workflow */
.subStepDivider{height:1px;background:#e2e8f0;margin:18px 0 14px}.roleHead.compact{margin-bottom:12px}.roleHead.compact b{font-size:15px}


/* v0.8.3 — DNFIX / Forwarder role visual identity */
#actorRole.actorDnfix{border-color:#9fb8df!important;background:#f2f7ff!important;color:#174a8b!important;font-weight:800}
#actorRole.actorForwarder{border-color:#dfb56a!important;background:#fff8e8!important;color:#8a5700!important;font-weight:800}
body.role-dnfix .toolbar{border-left:4px solid #3569a8;padding-left:10px}
body.role-forwarder .toolbar{border-left:4px solid #c98716;padding-left:10px}
body.role-dnfix .dnfixOnly.roleBlock,
body.role-dnfix .dnfixTaskBlock{border-left:4px solid #3569a8!important;background:#f7faff!important}
body.role-forwarder .forwarderOnly.roleBlock,
body.role-forwarder .forwarderWorkspace{border-left:4px solid #c98716!important}
body.role-forwarder .forwarderWorkspace>.panel-title,
body.role-forwarder .forwarderWorkspace>.roleBlock{background:#fffdf8}
body.role-forwarder .forwarderWorkspace>.roleBlock{border-color:#ead8b8}
body.role-forwarder .forwarderFlowHint{background:#fff8e8;border-color:#ead8b8}
body.role-forwarder .forwarderFlowHint span{color:#7a4d00}
body.role-dnfix .panel-title h3::before{content:"DNFIX · ";color:#3569a8;font-size:.72em;font-weight:800}
body.role-forwarder .forwarderWorkspace>.panel-title h3::before{content:"포워더 · ";color:#a56500;font-size:.72em;font-weight:800}
body.role-dnfix .dnfixOnly .roleHead>b{color:#174a8b}
body.role-forwarder .forwarderOnly .roleHead>b,
body.role-forwarder .forwarderWorkspace .roleHead>b{color:#8a5700}

/* v0.8.4 - compact media + DNFIX -> forwarder transfer files */
.compactUpload,.transferUpload{display:grid;grid-template-columns:auto minmax(150px,1fr) 180px auto;gap:8px;align-items:center;margin:10px 0}
.filePick{height:38px;display:inline-flex;align-items:center;justify-content:center;padding:0 12px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;font-size:13px;font-weight:700;cursor:pointer;white-space:nowrap}
.filePick input{display:none}.pickedFileName{height:38px;display:flex;align-items:center;padding:0 12px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#64748b;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.mediaTypeSelect,#transferDocType{height:38px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;padding:0 10px;min-width:0}.uploadSideBtn{height:38px;white-space:nowrap}
.transferBox{margin-top:12px;padding:14px;background:#f8fafc;border:1px solid #dbe4ef;border-radius:10px}.transferTitle{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.transferList,.forwarderSharedFiles>div{display:flex;flex-direction:column;gap:6px;margin-top:8px}.transferList a,.forwarderSharedFiles a{font-size:12px}.forwarderSharedFiles{margin-top:12px;padding:12px;border:1px solid #cfe1f7;border-radius:10px;background:#f8fbff}.forwarderSharedFiles a{display:flex;justify-content:space-between;gap:10px;padding:8px 10px;background:#fff;border:1px solid #dbe4ef;border-radius:8px}.forwarderSharedFiles a span{font-weight:700}
@media(max-width:900px){.compactUpload,.transferUpload{grid-template-columns:auto minmax(0,1fr)}.mediaTypeSelect,#transferDocType,.uploadSideBtn{width:100%}}

/* v0.9.0 — DNFIX customer notice center + handover guide */
.customerNoticeCenter{border-left:4px solid #3569a8!important;background:#fbfdff}
.noticeSteps{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.noticeStep{border:1px solid #dbe4ef;border-radius:12px;padding:14px;background:#f8fafc}
.noticeStep.ready{background:#f7fbff;border-color:#b9d2f0}.noticeStep.done{background:#f4fbf7;border-color:#b9e2ca}
.noticeStepHead{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:10px}.noticeStepHead>div{display:flex;flex-direction:column;gap:4px}.noticeStepHead b{font-size:14px}.noticeStepHead span{font-size:11px;color:#64748b}
.noticeBadge{border:1px solid #d1d5db;border-radius:999px;padding:5px 9px;background:#fff;font-weight:700!important;color:#475569!important;white-space:nowrap}
.noticeStep.ready .noticeBadge{color:#174a8b!important;border-color:#b9d2f0}.noticeStep.done .noticeBadge{color:#087443!important;border-color:#b9e2ca}
.noticeStep textarea{width:100%;min-height:150px;resize:vertical;border:1px solid #cbd5e1;border-radius:9px;padding:12px;background:#fff;box-sizing:border-box;font:inherit;line-height:1.55}.noticeStep textarea:disabled{background:#f1f5f9;color:#64748b}
.processGuide{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}.processGuide>div{min-height:92px;border:1px solid #dbe4ef;border-radius:12px;padding:14px;background:#f8fafc;display:flex;flex-direction:column;gap:10px}.processGuide span{width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#e8f0ff;color:#2457a6;font-weight:800}.processGuide b{font-size:13px;line-height:1.4}
.noticeRuleGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.noticeRuleGrid>div{border:1px solid #dbe4ef;border-radius:12px;padding:16px;background:#f8fafc;display:flex;flex-direction:column;gap:7px}.noticeRuleGrid b{font-size:14px}.noticeRuleGrid span{font-size:12px;color:#64748b;line-height:1.5}.guideHero{border-left:4px solid #3569a8!important}
@media(max-width:1000px){.noticeSteps,.noticeRuleGrid{grid-template-columns:1fr}.processGuide{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.processGuide{grid-template-columns:1fr}}

/* v0.9.3 dashboard completion + safe delete */
.rowActions{display:flex;gap:8px;align-items:center;justify-content:flex-end;white-space:nowrap}
button.danger{background:#fff;color:#b42318;border:1px solid #f1b4ae}
button.danger:hover{background:#fff1f0;border-color:#d92d20;color:#912018}

@media(max-width:620px){.cards{grid-template-columns:1fr}}
.card.completedCard{border-color:#d1fae5;background:#fbfffd}
.card.completedCard b{color:#047857}

/* v0.9.5 UI PATCH 01 — customs action alignment */
.customsActionRow{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
  align-items:stretch;
  margin:12px 0 4px;
}
.customsActionItem{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}
.customsActionItem button{
  min-height:40px;
  white-space:nowrap;
}
.customsActionItem .gateHint{
  white-space:nowrap;
}
.dnfixCustomsActions{
  grid-template-columns:minmax(0,1fr);
  max-width:520px;
}
@media(max-width:1180px){
  .customsActionRow{grid-template-columns:1fr}
  .customsActionItem{flex-wrap:wrap}
}

/* v0.9.8 — document preview alignment */
.previewGrid{align-items:start}
.previewGrid > div{min-width:0}
.previewGrid input,.previewGrid textarea,.previewGrid select{width:100%;box-sizing:border-box}
.previewGrid .muted{display:block;margin-top:7px;line-height:1.45;min-height:34px}
.previewGrid textarea{min-height:62px;resize:vertical}
.previewGrid label{display:block;min-height:20px;margin-bottom:7px}

/* v0.9.8 — forwarder stage follow-on blocks */
.followOnBlock{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:10px 0 16px;padding:13px 15px;border:1px solid #d8c7ff;border-radius:12px;background:#fbf9ff}
.followOnBlock>div{display:flex;flex-direction:column;gap:4px}
.followOnBlock b{font-size:14px;color:#312e81}.followOnBlock span{font-size:12px;color:#64748b}
.followOnBlock button{white-space:nowrap}
@media(max-width:760px){.followOnBlock{align-items:flex-start;flex-direction:column}}

/* v0.9.9 — exact requested forwarding workflow order */
.forwarderInput .customsPanel,.forwarderInput .domesticPanel{margin:12px 0 18px;box-shadow:none}
.forwarderInput .customsPanel{border-left:4px solid #e85d75;background:#fffafb}
.forwarderInput .domesticPanel{border-left:4px solid #7c3aed;background:#fcfaff}

/* v0.9.10 — DNFIX forwarding page exact visual order */
.workflowStageMirror{margin-top:18px}
.customsStageMirror{border-left:4px solid #d97706}
.expressStageMirror{border-left:4px solid #16a34a}
body.role-dnfix .customsPanel{margin-top:10px;border-left:4px solid #e85d75;background:#fffafb}
body.role-dnfix .domesticPanel{margin-top:10px;border-left:4px solid #7c3aed;background:#fcfaff}
body.role-dnfix .workflowStageMirror + .customsPanel,
body.role-dnfix .workflowStageMirror + .domesticPanel{margin-bottom:18px}

/* v0.9.11 — forwarder ④ → ⑩ shared handoff status */
.forwarderReceivingView{
  margin-top:12px;
  padding:18px;
  border:1px solid #d8c7ff;
  border-left:4px solid #7c3aed;
  border-radius:12px;
  background:#fcfaff;
}
.forwarderReceivingView .panel-title{margin-bottom:14px}
.forwarderReceivingView .panel-title h3{margin:0 0 4px;font-size:16px}
.forwarderReceivingView .customsSummary{margin-bottom:12px}
.handoffStatus{
  display:flex;
  align-items:center;
  gap:12px;
  padding:11px 13px;
  border-radius:10px;
  font-size:12px;
}
.handoffStatus b{white-space:nowrap}
.handoffStatus.waiting{background:#f8fafc;color:#64748b;border:1px solid #e2e8f0}
.handoffStatus.received{background:#ecfdf5;color:#047857;border:1px solid #a7f3d0}
@media(max-width:760px){
  .handoffStatus{align-items:flex-start;flex-direction:column;gap:4px}
}

/* v0.9.12 — role privacy */
body.role-forwarder .dnfixOnly,
body.role-forwarder details.dnfixOnly,
body.role-forwarder .internalOrderPanel,
body.role-forwarder [data-privacy="dnfix"]{display:none!important}

/* v0.9.12 — dashboard visual refresh based on approved reference */
:root{
 --navy:#0f2747; --blue:#2563eb; --sky:#eaf3ff; --line:#dbe4ef;
 --surface:#ffffff; --bg:#f4f7fb; --text:#12233f; --muted2:#64748b;
 --green:#10b981; --violet:#7c3aed; --amber:#f59e0b; --rose:#e84d72;
}
body{background:var(--bg);color:var(--text)}
.app{max-width:none}
.panel,.roleBlock,.forwarderReceivingView{
 border-radius:12px!important;
 box-shadow:0 1px 2px rgba(15,39,71,.04);
}
.panel-title h3,.roleHead b{letter-spacing:-.02em}
button.primary{background:#0f1d33}
button.secondary{background:#fff;border-color:#cbd5e1}
.customsSummary{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}
.customsSummary>div{background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px;padding:12px}
.customsSummary span{display:block;font-size:11px;color:#64748b;margin-bottom:5px}
.customsSummary b{font-size:14px}
.forwarderInput>.roleBlock{margin-bottom:12px}
.forwarderInput>.roleBlock:nth-of-type(1){border-left:4px solid var(--amber)}
.forwarderInput>.roleBlock:nth-of-type(2){border-left:4px solid #3b82f6}
.forwarderInput>.roleBlock:nth-of-type(3){border-left:4px solid var(--rose)}
.forwarderInput>.roleBlock:nth-of-type(4){border-left:4px solid var(--green)}
.forwarderReceivingView{border-left:4px solid var(--violet)!important}
@media(max-width:900px){.customsSummary{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.customsSummary{grid-template-columns:1fr}}

.workflowRailV12{display:grid;grid-template-columns:repeat(6,1fr);gap:0;margin:0 0 16px;background:#fff;border:1px solid #dbe4ef;border-radius:12px;overflow:hidden}
.railStep{display:flex;align-items:center;gap:10px;padding:13px 12px;border-right:1px solid #e2e8f0;min-width:0}
.railStep:last-child{border-right:0}
.railStep i{display:grid;place-items:center;flex:0 0 32px;height:32px;border-radius:50%;background:#eaf3ff;color:#2563eb;font-style:normal;font-weight:800}
.railStep span{min-width:0}.railStep b,.railStep small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.railStep b{font-size:13px}.railStep small{font-size:10px;color:#64748b;margin-top:2px}
.railStep:nth-child(3) i{background:#fff1f2;color:#e84d72}
.railStep:nth-child(4) i{background:#f5f3ff;color:#7c3aed}
.railStep:nth-child(5) i{background:#faf5ff;color:#9333ea}
.railStep:nth-child(6) i{background:#ecfdf5;color:#059669}
@media(max-width:1050px){.workflowRailV12{grid-template-columns:repeat(3,1fr)}.railStep:nth-child(3){border-right:0}}
@media(max-width:650px){.workflowRailV12{grid-template-columns:1fr}.railStep{border-right:0;border-bottom:1px solid #e2e8f0}}

body.role-forwarder .dnfixOnly{display:none!important}
.customsPanel .gateRow{display:flex!important;align-items:center;gap:10px;flex-wrap:wrap}
.customsPanel .gateRow button{min-width:175px;min-height:40px}
.guideGridV13{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.guideGridV13 section{padding:16px;border-radius:12px;border:1px solid #dbe4ef}
.guideGridV13 section:first-child{background:#eff6ff;border-color:#bfdbfe}
.guideGridV13 section:last-child{background:#ecfdf5;border-color:#a7f3d0}
.guideGridV13 h4{margin:0 0 10px}.guideGridV13 ol{margin:0;padding-left:20px;line-height:1.7}
.handoverV13{margin-top:12px;padding:14px;border:1px solid #e2e8f0;border-radius:10px;background:#f8fafc}
.handoverV13 b,.handoverV13 span{display:block}.handoverV13 span{margin-top:5px;color:#64748b}
#loginV13{position:fixed;inset:0;z-index:99999;background:#eef3f9;display:grid;place-items:center;padding:20px}
.loginCardV13{width:min(420px,100%);background:#fff;padding:28px;border-radius:16px;box-shadow:0 20px 60px #0f274722}
.loginCardV13 h2{margin:0 0 6px}.loginCardV13 p{color:#64748b}
.loginCardV13 input{display:block;width:100%;box-sizing:border-box;margin:10px 0;padding:12px;border:1px solid #cbd5e1;border-radius:9px}
.loginCardV13 button{width:100%;padding:12px;background:#0f1d33;color:white;border:0;border-radius:9px;font-weight:700}
.loginCardV13 small{display:block;color:#dc2626;margin-top:8px}
@media(max-width:800px){.guideGridV13{grid-template-columns:1fr}}

#accountV14{position:fixed;right:18px;top:16px;z-index:9000;display:flex;gap:10px;align-items:center;background:#fff;border:1px solid #dbe4ef;border-radius:999px;padding:7px 10px 7px 14px;box-shadow:0 2px 10px #0f274710;font-size:12px}
#accountV14 button,.accountNavV14{border:1px solid #cbd5e1;background:#fff;border-radius:8px;padding:7px 10px;cursor:pointer}
.accountNavV14{margin:12px;width:calc(100% - 24px);text-align:left}
#userAdminV14{position:fixed;inset:0;z-index:99999;background:#0f172a66;display:grid;place-items:center;padding:20px}
.userAdminCardV14{width:min(980px,96vw);max-height:88vh;overflow:auto;background:#fff;border-radius:16px;padding:22px;box-shadow:0 24px 70px #0003}
.uaHead{display:flex;justify-content:space-between;align-items:center}.uaHead h2{margin:0}.uaHead button{padding:8px 12px}
.uaCreate{display:grid;grid-template-columns:1.2fr 1.2fr 1.4fr 1fr auto;gap:8px;margin:18px 0}
.uaCreate input,.uaCreate select{padding:10px;border:1px solid #cbd5e1;border-radius:8px}.uaCreate button{background:#0f1d33;color:#fff;border:0;border-radius:8px;padding:0 15px}
#uaMsg{min-height:24px;color:#2563eb}.userAdminCardV14 table{width:100%;border-collapse:collapse}.userAdminCardV14 th,.userAdminCardV14 td{padding:11px;border-bottom:1px solid #e2e8f0;text-align:left}.userAdminCardV14 td button{padding:6px 9px;margin:2px}
@media(max-width:800px){.uaCreate{grid-template-columns:1fr}.uaCreate button{padding:11px}}


/* =========================================================
   v0.9.16 — DNFIX Unified Design System + Responsive UI
   Functional/data behavior unchanged.
   ========================================================= */
:root{
  --ui-navy:#10213d;
  --ui-navy-2:#172b4d;
  --ui-blue:#2f6fed;
  --ui-green:#168a62;
  --ui-amber:#c98212;
  --ui-red:#c94848;
  --ui-violet:#7257d8;
  --ui-bg:#f3f6fa;
  --ui-surface:#ffffff;
  --ui-soft:#f8fafc;
  --ui-line:#d9e2ec;
  --ui-line-strong:#c7d2df;
  --ui-text:#14233d;
  --ui-muted:#6c7b91;
  --ui-radius:12px;
  --ui-control-h:42px;
  --ui-shadow:0 1px 3px rgba(16,33,61,.05);
}

html{font-size:16px}
body{
  background:var(--ui-bg)!important;
  color:var(--ui-text)!important;
  line-height:1.45;
  -webkit-font-smoothing:antialiased;
}
main{padding:26px 28px 40px}
header{min-height:54px;margin-bottom:20px}
h1{font-size:26px;letter-spacing:-.035em}
h2,h3,h4{letter-spacing:-.025em}

/* ---------- universal controls ---------- */
button,
input,
select,
textarea{font:inherit}
button{
  min-height:var(--ui-control-h);
  border-radius:9px!important;
  font-weight:700;
  line-height:1.1;
}
button.primary,
button.small,
button.secondary,
button.ghost,
.docTab,
.filePick,
.uploadSideBtn,
.stepActions button,
.gateRow button,
.rowActions button,
#accountV14 button,
.accountNavV14,
.uaHead button,
.uaCreate button,
.userAdminCardV14 td button{
  min-height:var(--ui-control-h)!important;
  padding:0 14px!important;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  border-radius:9px!important;
  white-space:nowrap;
  box-sizing:border-box;
}
button.small{font-size:13px}
button.primary{
  background:var(--ui-navy)!important;
  color:#fff!important;
  border:1px solid var(--ui-navy)!important;
}
button.primary:hover:not(:disabled){background:#1a3155!important}
button.ghost,button.secondary,.ghost{
  background:#fff!important;
  color:var(--ui-text)!important;
  border:1px solid var(--ui-line-strong)!important;
}
button.danger,.danger{
  background:#fff5f5!important;
  color:var(--ui-red)!important;
  border:1px solid #efbcbc!important;
}
button:disabled{
  opacity:1!important;
  background:#e5eaf0!important;
  color:#8a96a8!important;
  border-color:#d7dee7!important;
  cursor:not-allowed!important;
}
input:not([type="file"]),
select,
textarea,
.previewInput,.previewArea{
  min-height:var(--ui-control-h);
  border:1px solid var(--ui-line-strong)!important;
  border-radius:9px!important;
  background:#fff;
  color:var(--ui-text);
  padding:9px 11px!important;
  outline:none;
}
input:focus,select:focus,textarea:focus{
  border-color:#8bb0f7!important;
  box-shadow:0 0 0 3px rgba(47,111,237,.10);
}
textarea{line-height:1.55}

/* Exact-size action groups: fixes 검수 시작 / 검수 완료 / 이상 발견 etc. */
.stepActions,.gateRow,.rowActions{
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
  flex-wrap:wrap;
}
.stepActions>button,
.gateRow>button,
.rowActions>button{
  min-width:108px;
  height:var(--ui-control-h)!important;
  margin:0!important;
}
.stepActions>button+button{margin-left:0!important}

/* ---------- surfaces ---------- */
.panel,.card,.roleBlock,.forwarderPanel,.forwarderReceivingView{
  background:var(--ui-surface)!important;
  border:1px solid var(--ui-line)!important;
  border-radius:var(--ui-radius)!important;
  box-shadow:var(--ui-shadow)!important;
}
.panel{padding:20px;margin-bottom:16px}
.card{padding:17px 18px}
.panel-title{margin-bottom:16px;gap:12px}
.panel-title h3{font-size:17px}
.muted{color:var(--ui-muted)!important}
.statusStrip>div,.currentLocation,.nextOwner,
.transportSummary>div,.customsSummary>div,.resultGrid>div{
  border-color:var(--ui-line)!important;
  background:var(--ui-soft)!important;
  border-radius:10px!important;
}

/* ---------- sidebar ---------- */
aside{
  width:auto;
  background:#101b2d!important;
  padding:22px 14px!important;
  gap:5px;
}
.brand{
  margin:3px 7px 25px!important;
  font-size:22px!important;
  letter-spacing:.02em;
}
.nav{
  min-height:46px;
  padding:0 13px!important;
  border-radius:9px!important;
  font-size:14px;
}
.nav:hover,.nav.active{background:#273750!important}
.side-note{color:#8390a3!important}
.accountNavV14{
  background:transparent!important;
  color:#cbd5e1!important;
  border:1px solid #33445d!important;
}

/* ---------- dashboard ---------- */
.cards{gap:10px;margin-bottom:16px}
.card span{font-size:12px}
.card b{font-size:25px;color:var(--ui-navy)}
.alerts{gap:10px}
.alert{border-color:var(--ui-line);border-radius:10px;padding:13px 14px}

/* ---------- tables ---------- */
.tablewrap{
  border:1px solid var(--ui-line)!important;
  border-radius:10px!important;
  background:#fff;
}
table{font-size:13px}
th{
  color:#5f6f85!important;
  background:#f7f9fc!important;
  padding:12px!important;
  font-weight:800;
}
td{padding:12px!important}
tr:last-child td{border-bottom:0}

/* ---------- workflow ---------- */
.workflowRailV12{
  border-color:var(--ui-line)!important;
  border-radius:12px!important;
  box-shadow:var(--ui-shadow);
}
.railStep{min-height:64px;padding:11px 13px}
.railStep i{width:30px;height:30px;flex-basis:30px}
.statusStrip{gap:9px}
.roleBlock,.forwarderPanel{padding:19px!important}
.roleHead{margin-bottom:15px}
.forwarderFlowHint{background:#f7f9fc!important;border-color:var(--ui-line)!important}

/* ---------- account pill ---------- */
#accountV14{
  top:14px!important;
  right:18px!important;
  min-height:46px;
  padding:5px 6px 5px 14px!important;
  border-color:var(--ui-line)!important;
  box-shadow:0 3px 14px rgba(16,33,61,.08)!important;
}
#accountV14 button{min-height:34px!important;height:34px!important;padding:0 11px!important}

/* ---------- login ---------- */
#loginV13{background:linear-gradient(180deg,#eef3f9 0%,#e8eef6 100%)!important}
.loginCardV13{
  width:min(440px,100%)!important;
  padding:34px!important;
  border:1px solid #e3e9f0;
  border-radius:18px!important;
}
.loginCardV13 h2{font-size:28px;letter-spacing:-.04em}
.loginCardV13 p{font-size:15px;margin-bottom:20px}
.loginCardV13 input{min-height:50px!important;margin:10px 0!important;padding:0 14px!important}
.loginCardV13 button{min-height:50px!important;margin-top:12px;border-radius:10px!important}

/* ---------- mobile menu ---------- */
.mobileMenuBtn{
  display:none;
  position:fixed;
  z-index:9100;
  left:14px;
  top:14px;
  width:44px;
  height:44px;
  min-height:44px;
  padding:0!important;
  border:1px solid var(--ui-line)!important;
  background:#fff;
  color:var(--ui-navy);
  box-shadow:0 3px 14px rgba(16,33,61,.08);
  font-size:21px;
}
.mobileOverlay{display:none}

/* ---------- responsive ---------- */
@media(max-width:1000px){
  .app{display:block!important}
  aside{
    display:flex!important;
    position:fixed;
    z-index:9200;
    inset:0 auto 0 0;
    width:min(290px,82vw)!important;
    transform:translateX(-105%);
    transition:transform .2s ease;
    box-shadow:18px 0 40px rgba(15,23,42,.18);
  }
  body.mobileNavOpen aside{transform:translateX(0)}
  .mobileMenuBtn{display:inline-flex;align-items:center;justify-content:center}
  .mobileOverlay{
    position:fixed;z-index:9150;inset:0;background:rgba(15,23,42,.35);
  }
  body.mobileNavOpen .mobileOverlay{display:block}
  main{padding:78px 18px 32px!important}
  header{align-items:flex-start;padding-right:0;margin-bottom:16px}
  header h1{font-size:24px}
  #accountV14{
    position:absolute!important;
    top:14px!important;
    right:14px!important;
    max-width:calc(100vw - 76px);
  }
  .cards{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .card{min-height:104px}
  .grid2{display:block!important}
  .statusStrip{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .transportSummary,.customsSummary{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .formgrid,.roleBlock .formgrid,.forwarderPanel .formgrid{grid-template-columns:1fr!important}
  .incomingSummary{grid-template-columns:1fr 1fr!important}
  .userAdminCardV14{width:calc(100vw - 28px)!important;padding:16px!important}
}

@media(max-width:700px){
  main{padding:76px 12px 28px!important}
  header{margin-bottom:14px}
  header h1{font-size:22px}
  header p{font-size:12px;line-height:1.45}
  .panel{padding:15px!important;margin-bottom:12px!important}
  .panel-title{align-items:flex-start;flex-direction:column;margin-bottom:13px}
  .panel-title h3{font-size:16px}
  .cards{gap:8px!important}
  .card{padding:14px!important;min-height:94px}
  .card b{font-size:23px}
  .alerts{margin-bottom:12px}
  .workflowRailV12{
    display:flex!important;
    overflow-x:auto;
    scroll-snap-type:x mandatory;
    border-radius:10px!important;
    -webkit-overflow-scrolling:touch;
  }
  .railStep{
    flex:0 0 74%;
    min-height:62px;
    scroll-snap-align:start;
    border-right:1px solid #e2e8f0!important;
    border-bottom:0!important;
  }
  .statusStrip,.transportSummary,.customsSummary{
    grid-template-columns:1fr 1fr!important;
    gap:7px!important;
  }
  .statusStrip>div,.transportSummary>div,.customsSummary>div{
    padding:10px!important;
    min-width:0;
  }
  .incomingSummary{grid-template-columns:1fr!important}
  .incomingSummary>span{border-right:0!important;border-bottom:1px solid #e4e7ec}
  .incomingSummary>span:last-child{border-bottom:0}
  .stepActions,.gateRow,.rowActions{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr));
    width:100%;
  }
  .stepActions>button,.gateRow>button,.rowActions>button{
    width:100%!important;
    min-width:0!important;
    height:44px!important;
  }
  /* odd third button occupies same visual grid width instead of becoming a tiny box */
  .stepActions>button:last-child:nth-child(odd),
  .gateRow>button:last-child:nth-child(odd){
    grid-column:auto;
  }
  .mediaUpload,.transferUpload,.importrow{
    display:grid!important;
    grid-template-columns:1fr!important;
    align-items:stretch!important;
  }
  .filePick,.uploadSideBtn,.mediaTypeSelect,.transferUpload select{
    width:100%!important;
    min-height:44px!important;
  }
  .pickedFileName{
    min-height:42px;
    display:flex;
    align-items:center;
    padding:8px 10px;
    border:1px solid var(--ui-line);
    border-radius:9px;
    background:var(--ui-soft);
  }
  .toolbar{flex-wrap:wrap}
  .toolbar .authRoleBadge{order:2}
  .toolbar input{width:100%;order:3}
  .modeBox{grid-template-columns:1fr!important}
  .tablewrap{
    max-height:none!important;
    overflow-x:auto!important;
    -webkit-overflow-scrolling:touch;
  }
  table{min-width:720px}
  .userAdminCardV14 table{min-width:700px}
  .uaCreate{grid-template-columns:1fr!important}
  .uaCreate button{height:44px!important}
  .guideGridV13{grid-template-columns:1fr!important}
}

@media(max-width:480px){
  .cards{grid-template-columns:1fr 1fr!important}
  .card{min-height:88px}
  .statusStrip,.transportSummary,.customsSummary{grid-template-columns:1fr!important}
  .stepActions,.gateRow,.rowActions{grid-template-columns:1fr 1fr!important}
  .loginCardV13{padding:26px 22px!important;border-radius:16px!important}
  .loginCardV13 h2{font-size:25px}
  #accountV14{font-size:11px;gap:5px}
  #accountV14 button{padding:0 8px!important}
}

/* Inspection action group: exact equal rectangles regardless of legacy classes */
.inspectionActions,
[data-action-group="inspection"]{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:8px!important;
}
.inspectionActions button,
[data-action-group="inspection"] button{
  width:100%!important;
  min-width:0!important;
  height:42px!important;
  margin:0!important;
  padding:0 12px!important;
  border-radius:9px!important;
}
@media(max-width:560px){
  .inspectionActions,
  [data-action-group="inspection"]{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .inspectionActions button,
  [data-action-group="inspection"] button{font-size:12px!important;padding:0 6px!important}
}


/* =========================================================
   v0.9.16a — requested alignment fixes
   ========================================================= */

/* ATD / ATA are two independent columns.
   Each confirmation action sits directly under its own date field. */
.transportActualGrid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
  margin-top:14px;
  padding-top:14px;
  border-top:1px solid var(--ui-line);
}
.transportActualColumn{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.transportActualColumn .field{margin:0!important}
.transportActualColumn .actualGateRow{
  margin:0!important;
  min-height:42px;
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
  flex-wrap:wrap;
}
.transportActualColumn .actualGateRow button{
  margin:0!important;
  min-width:126px;
}

/* Forwarder input-location notice:
   same full width as B/L → ATA summary, with vertically centered contents. */
.forwarderMirrorNotice{
  width:100%!important;
  box-sizing:border-box!important;
  margin:12px 0 0!important;
  padding:0 18px!important;
  min-height:66px;
  display:flex!important;
  align-items:center!important;
}
.forwarderMirrorNotice .roleHead{
  width:100%;
  min-height:64px;
  margin:0!important;
  display:flex!important;
  align-items:center!important;
  gap:14px!important;
}
.forwarderMirrorNotice .roleHead>b{
  flex:0 0 auto;
  white-space:nowrap;
}
.forwarderMirrorNotice .roleHead>span{
  line-height:1.5;
  margin:0;
}

/* Stage progress: clear breathing room between current position and next owner. */
.stageProgressPanel .currentLocation,
.stageProgressPanel .nextOwner{
  margin:0!important;
}
.stageProgressPanel .stageProgressGap{
  height:18px;
}
.grid2 > div:last-child .stageProgressPanel .nextOwner{
  margin-top:0!important;
}

/* Keep fixed account controls from sitting on top of page content. */
@media(min-width:1001px){
  main>header{
    padding-right:220px!important;
    box-sizing:border-box;
  }
}
@media(max-width:1000px){
  main{padding-top:86px!important}
  #accountV14{
    top:14px!important;
    right:14px!important;
    z-index:9300!important;
  }
}
@media(max-width:700px){
  .transportActualGrid{
    grid-template-columns:1fr;
    gap:14px;
  }
  .transportActualColumn{
    padding-bottom:2px;
  }
  .transportActualColumn .actualGateRow{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
  }
  .transportActualColumn .actualGateRow button,
  .transportActualColumn .actualGateRow .gateHint{
    width:100%!important;
    min-width:0!important;
    box-sizing:border-box;
  }
  .forwarderMirrorNotice{
    padding:12px 14px!important;
    min-height:auto;
  }
  .forwarderMirrorNotice .roleHead{
    min-height:auto;
    align-items:flex-start!important;
    flex-direction:column;
    gap:5px!important;
  }
}
@media(max-width:480px){
  #accountV14{
    max-width:calc(100vw - 74px)!important;
  }
}


/* =========================================================
   v0.9.16b — Shared document file-control alignment
   Native file input is normalized to the same control system.
   ========================================================= */

/* All visible file inputs: same rectangular control language as text/select fields */
input[type="file"]{
  width:100%;
  min-height:42px;
  height:42px;
  box-sizing:border-box;
  padding:0!important;
  border:1px solid var(--ui-line-strong)!important;
  border-radius:9px!important;
  background:#fff!important;
  color:var(--ui-text);
  overflow:hidden;
  line-height:40px;
}

/* Browser-native "파일 선택" button is made the same height and radius */
input[type="file"]::file-selector-button{
  height:40px;
  min-height:40px;
  margin:0 12px 0 0;
  padding:0 14px;
  border:0;
  border-right:1px solid var(--ui-line-strong);
  border-radius:8px 0 0 8px;
  background:#f7f9fc;
  color:var(--ui-text);
  font-weight:700;
  cursor:pointer;
}
input[type="file"]::-webkit-file-upload-button{
  height:40px;
  min-height:40px;
  margin:0 12px 0 0;
  padding:0 14px;
  border:0;
  border-right:1px solid var(--ui-line-strong);
  border-radius:8px 0 0 8px;
  background:#f7f9fc;
  color:var(--ui-text);
  font-weight:700;
  cursor:pointer;
}

/* Shared document box: select → file → upload use the same full-width rhythm */
.sharedDocsPanel input[type="file"],
.sharedDocsPanel select,
.sharedDocsPanel button,
#sharedFile,
#shared_file,
#commonFile,
#common_file{
  min-height:42px!important;
  box-sizing:border-box!important;
}

/* Generic fallback for legacy common-document upload rows */
.panel input[type="file"] + button,
.panel .fileUploadRow button{
  min-height:42px!important;
  height:42px!important;
  border-radius:9px!important;
}

@media(max-width:700px){
  input[type="file"]{
    height:44px;
    min-height:44px;
    line-height:42px;
  }
  input[type="file"]::file-selector-button,
  input[type="file"]::-webkit-file-upload-button{
    height:42px;
    min-height:42px;
  }
}


/* =========================================================
   v0.9.17 — Mobile operations polish
   ========================================================= */
@media(max-width:700px){
  body{overflow-x:hidden}
  main{width:100%;box-sizing:border-box;padding-left:12px!important;padding-right:12px!important}
  header{padding-right:0!important}
  #accountV14{
    max-width:calc(100vw - 76px)!important;
    min-height:44px!important;
    padding:4px 5px 4px 10px!important;
    border-radius:22px!important;
    background:rgba(255,255,255,.98)!important;
  }
  #accountV14 span{max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  #accountV14 button{height:34px!important;min-height:34px!important}

  .panel,.roleBlock,.forwarderPanel,.forwarderReceivingView{
    width:100%!important;
    box-sizing:border-box!important;
    overflow:hidden;
  }
  .panel-title h3,.roleHead b{line-height:1.35}
  .muted{line-height:1.5}

  /* Operational forms: full width, predictable touch targets */
  .field,.field input,.field select,.field textarea,
  .formgrid input,.formgrid select,.formgrid textarea{
    width:100%!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }
  input:not([type="checkbox"]):not([type="radio"]),
  select,textarea,button{
    font-size:14px!important;
  }

  /* Workroom top context becomes compact cards rather than a crowded row */
  .toolbar{
    display:grid!important;
    grid-template-columns:1fr auto!important;
    gap:8px!important;
    align-items:center!important;
  }
  .toolbar>b{font-size:16px}
  .toolbar .badge,.toolbar .authRoleBadge{justify-self:start}
  .toolbar input{
    grid-column:1/-1!important;
    width:100%!important;
  }

  /* Forwarder summary: readable vertical pairs */
  .incomingSummary{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:0!important;
  }
  .incomingSummary>span{
    min-height:48px;
    display:flex!important;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    padding:10px 12px!important;
  }

  /* File rows never overflow phone width */
  .compactUpload,.transferUpload,.mediaUpload,.fileUploadRow{
    width:100%!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
  }
  input[type="file"],.pickedFileName,.uploadSideBtn,
  .compactUpload select,.transferUpload select{
    width:100%!important;
    max-width:100%!important;
  }

  /* Dashboard order table: horizontal swipe with visual breathing room */
  .tablewrap{
    width:100%!important;
    max-width:100%!important;
    overflow-x:auto!important;
    border-radius:10px!important;
  }
  .tablewrap table{min-width:680px!important}
  .tablewrap th,.tablewrap td{white-space:nowrap}

  /* Guide/process cards */
  .noticeRuleGrid,.processGuide{gap:8px!important}
  .processGuide>div,.noticeRuleGrid>div{min-height:64px}

  /* Long labels/status chips wrap rather than collide */
  .gateHint,.badge,.chip,.statusBadge{
    white-space:normal!important;
    line-height:1.35!important;
  }
}
@media(max-width:430px){
  .cards{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .card{padding:12px!important;min-height:84px}
  .card span{font-size:11px}
  .card b{font-size:21px}
  .stepActions,.gateRow,.rowActions{
    grid-template-columns:1fr 1fr!important;
  }
  .stepActions>button,.gateRow>button,.rowActions>button{
    min-height:44px!important;
    height:auto!important;
    padding:8px!important;
    white-space:normal!important;
  }
}


/* =========================================================
   v0.9.17a — User/Permission Management unified controls
   ========================================================= */
.userAdminCardV14{
  width:min(1040px,calc(100vw - 32px))!important;
  padding:24px!important;
}
.userAdminCardV14 .uaHead{
  min-height:44px;
  gap:12px;
}
.userAdminCardV14 .uaHead button{
  width:64px!important;
  height:42px!important;
  min-height:42px!important;
  padding:0 14px!important;
  border:1px solid var(--ui-line-strong)!important;
  border-radius:9px!important;
  background:#fff!important;
  color:var(--ui-text)!important;
  font-weight:700!important;
}
.uaCreateUnified{
  display:grid!important;
  grid-template-columns:minmax(150px,1.15fr) minmax(150px,1.15fr) minmax(190px,1.4fr) 156px 92px!important;
  gap:8px!important;
  align-items:stretch!important;
}
.uaCreateUnified input,
.uaCreateUnified select,
.uaCreateUnified button{
  width:100%!important;
  height:44px!important;
  min-height:44px!important;
  margin:0!important;
  box-sizing:border-box!important;
  border-radius:9px!important;
}
.uaCreateUnified button{
  padding:0 12px!important;
}
.userAdminCardV14 .tablewrap,
.userAdminCardV14 #uaList{
  width:100%;
}
.userAdminCardV14 table{
  table-layout:fixed;
  border:1px solid var(--ui-line)!important;
  border-radius:10px;
  overflow:hidden;
}
.userAdminCardV14 th,
.userAdminCardV14 td{
  height:58px;
  vertical-align:middle!important;
  box-sizing:border-box;
}
.userAdminCardV14 th:nth-child(1){width:19%}
.userAdminCardV14 th:nth-child(2){width:18%}
.userAdminCardV14 th:nth-child(3){width:12%}
.userAdminCardV14 th:nth-child(4){width:12%}
.userAdminCardV14 th:nth-child(5){width:39%}
.userAdminActions{
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
  flex-wrap:nowrap!important;
}
.userAdminActions button{
  width:108px!important;
  min-width:108px!important;
  height:42px!important;
  min-height:42px!important;
  margin:0!important;
  padding:0 10px!important;
  border-radius:9px!important;
}
@media(max-width:800px){
  .userAdminCardV14{padding:16px!important}
  .uaCreateUnified{grid-template-columns:1fr!important}
  .uaCreateUnified input,
  .uaCreateUnified select,
  .uaCreateUnified button{height:46px!important;min-height:46px!important}
  .userAdminCardV14 #uaList{overflow-x:auto;-webkit-overflow-scrolling:touch}
  .userAdminCardV14 table{min-width:760px!important}
}


/* =========================================================
   v0.9.18 — EXTERNAL SHARE + MOBILE FINAL UI PASS
   ========================================================= */
html,body{max-width:100%;overflow-x:hidden}
button,input,select,textarea{touch-action:manipulation}

@media(max-width:1000px){
  main{
    min-width:0!important;
    width:100%!important;
    padding-left:14px!important;
    padding-right:14px!important;
  }
  main>header{
    min-width:0!important;
    padding-right:0!important;
  }
}

@media(max-width:700px){
  body{font-size:14px}
  h1{font-size:24px!important;line-height:1.25!important}
  h2{font-size:20px!important;line-height:1.3!important}
  h3{font-size:17px!important;line-height:1.35!important}

  /* Leave a dedicated top lane for account/logout controls. */
  main{padding-top:82px!important}
  #accountV14{
    position:fixed!important;
    top:12px!important;
    right:12px!important;
    left:auto!important;
    width:auto!important;
    max-width:calc(100vw - 78px)!important;
    z-index:9500!important;
    box-shadow:0 6px 18px rgba(15,31,55,.10)!important;
  }

  /* Main cards */
  .panel,.roleBlock,.forwarderPanel,.forwarderReceivingView,
  .sharedDocsPanel,.noticeBox,.stageProgressPanel{
    border-radius:12px!important;
    padding:14px!important;
    margin-left:0!important;
    margin-right:0!important;
  }

  /* Every 2/3/4 column operational grid becomes a clean single column. */
  .grid2,.grid3,.grid4,.formgrid,.transportActualGrid{
    grid-template-columns:1fr!important;
    gap:12px!important;
  }

  /* Buttons share one mobile control system. */
  button,.btn,.primary,.secondary{
    min-height:44px!important;
    border-radius:9px!important;
  }
  .gateRow,.actualGateRow,.rowActions,.stepActions,.userAdminActions{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:8px!important;
    align-items:stretch!important;
  }
  .gateRow button,.actualGateRow button,.rowActions button,.stepActions button,
  .userAdminActions button{
    width:100%!important;
    min-width:0!important;
    height:auto!important;
    min-height:44px!important;
    white-space:normal!important;
  }

  /* Workflow ribbon stays useful without shrinking text into unreadability. */
  .stageRibbon,.workflowRibbon,.steps{
    overflow-x:auto!important;
    -webkit-overflow-scrolling:touch;
    scroll-snap-type:x proximity;
    padding-bottom:5px!important;
  }
  .stageRibbon>*,
  .workflowRibbon>*,
  .steps>*{
    min-width:150px!important;
    scroll-snap-align:start;
  }

  /* Forwarder read-only shared data */
  .incomingSummary,.summaryGrid{
    grid-template-columns:1fr!important;
  }
  .incomingSummary>span,.summaryGrid>div{
    min-width:0!important;
    overflow-wrap:anywhere;
  }

  /* B/L / ATD / ATA controls */
  .transportActualColumn{gap:8px!important}
  .transportActualColumn .actualGateRow{
    grid-template-columns:1fr!important;
  }
  .transportActualColumn .gateHint{
    width:100%!important;
    min-height:42px;
    display:flex!important;
    align-items:center!important;
  }
  .forwarderMirrorNotice{
    margin-top:10px!important;
    min-height:auto!important;
  }

  /* Shared document controls */
  input[type="file"]{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
  }
  .compactUpload,.transferUpload,.mediaUpload,.fileUploadRow{
    display:grid!important;
    grid-template-columns:1fr!important;
  }

  /* Dashboard KPIs */
  .cards{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
  }
  .card{min-width:0!important}

  /* Long desktop tables are deliberately swipeable rather than crushed. */
  .tablewrap,#uaList{
    overflow-x:auto!important;
    -webkit-overflow-scrolling:touch;
    width:100%!important;
  }
  .tablewrap table{min-width:720px!important}
  #uaList table{min-width:760px!important}

  /* Login */
  .loginCard{
    width:calc(100vw - 28px)!important;
    max-width:520px!important;
    padding:24px 18px!important;
    border-radius:16px!important;
  }
  .loginCard input,.loginCard button{
    width:100%!important;
    min-height:48px!important;
    box-sizing:border-box!important;
  }
}

@media(max-width:430px){
  main{padding-left:10px!important;padding-right:10px!important}
  .panel,.roleBlock,.forwarderPanel,.forwarderReceivingView,
  .sharedDocsPanel,.noticeBox,.stageProgressPanel{padding:12px!important}
  .cards{gap:8px!important}
  .card{padding:12px!important}
  #accountV14 span{max-width:92px!important}
  .uaCreateUnified{grid-template-columns:1fr!important}
}

/* iPhone safe areas */
@supports(padding:max(0px)){
  @media(max-width:700px){
    main{
      padding-left:max(12px,env(safe-area-inset-left))!important;
      padding-right:max(12px,env(safe-area-inset-right))!important;
      padding-bottom:max(18px,env(safe-area-inset-bottom))!important;
    }
    #accountV14{right:max(12px,env(safe-area-inset-right))!important}
  }
}


/* v0.9.18a — Forwarder dashboard: domestic express → DNFIX visibility */
.forwarderKpis{grid-template-columns:repeat(4,minmax(0,1fr))!important}
.forwarderExpressPanel{margin-top:14px}
.forwarderExpressPanel .badge.info{
  background:#eef5ff;
  color:#1f5fae;
  border:1px solid #cfe0f7;
}
@media(max-width:900px){
  .forwarderKpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:430px){
  .forwarderKpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .forwarderExpressPanel{margin-top:10px}
}
