:root{
  --green:#075b42;
  --deep:#043b2d;
  --lime:#cbed49;
  --bg:#f3f7f5;
  --card:#ffffff;
  --text:#10251e;
  --muted:#6b7b74;
  --line:#d8e4de;
}

*{box-sizing:border-box}

body{
  margin:0;
  font-family:Arial,"Noto Sans Ethiopic",sans-serif;
  background:var(--bg);
  color:var(--text);
}

header{
  min-height:72px;
  padding:12px 18px;
  background:#fff;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  position:sticky;
  top:0;
  z-index:20;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-size:20px;
}

.logo{
  width:44px;
  height:44px;
  border-radius:12px;
  display:grid;
  place-items:center;
  color:#fff;
  font-weight:900;
  background:linear-gradient(65deg,var(--deep) 0 67%,var(--lime) 68%);
}

header button,
.toolbar button{
  border:1px solid #c7d8d0;
  background:#fff;
  color:var(--green);
  border-radius:10px;
  padding:10px 14px;
  font-weight:800;
}

main{
  max-width:1180px;
  margin:auto;
  padding:28px 18px 60px;
}

.intro{
  margin-bottom:24px;
}

.intro h1{
  font-size:clamp(34px,7vw,56px);
  margin:0 0 12px;
  letter-spacing:-.03em;
}

.intro p{
  margin:0;
  max-width:780px;
  color:var(--muted);
  line-height:1.65;
  font-size:17px;
}

.workspace{
  display:grid;
  grid-template-columns:1.05fr .95fr;
  gap:20px;
}

.panel{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:22px;
  padding:20px;
  box-shadow:0 8px 30px rgba(19,58,45,.06);
}

.panel h2{
  margin:0 0 18px;
  font-size:23px;
}

.upload{
  display:block;
  border:2px dashed #9cbcaf;
  border-radius:18px;
  padding:32px 18px;
  background:#f5faf7;
  text-align:center;
  cursor:pointer;
}

.upload input{display:none}

.upload strong{
  display:block;
  font-size:19px;
  margin-bottom:8px;
}

.upload span{
  color:var(--muted);
  font-size:14px;
}

.toolbar{
  margin-top:12px;
}

#summary{
  margin-top:16px;
  padding:14px;
  background:#edf7f2;
  border-radius:12px;
  display:none;
  line-height:1.55;
}

#fileList{
  margin-top:14px;
  display:grid;
  gap:10px;
}

.file{
  border:1px solid var(--line);
  border-radius:14px;
  padding:14px;
}

.file-top{
  display:flex;
  justify-content:space-between;
  gap:10px;
}

.file-name{
  font-weight:800;
  overflow-wrap:anywhere;
}

.status{
  padding:5px 9px;
  border-radius:999px;
  font-size:12px;
  font-weight:900;
  white-space:nowrap;
}

.ready{
  background:#dff4e9;
  color:#046041;
}

.needs{
  background:#fff0cf;
  color:#8b5700;
}

.meta{
  margin-top:8px;
  color:var(--muted);
  font-size:14px;
  line-height:1.5;
}

.chat{
  min-height:600px;
  display:flex;
  flex-direction:column;
}

#messages{
  flex:1;
  overflow:auto;
  min-height:420px;
  max-height:580px;
  padding:4px 0 14px;
}

.bubble{
  max-width:88%;
  padding:13px 15px;
  margin-bottom:10px;
  border-radius:15px;
  line-height:1.5;
  white-space:pre-wrap;
}

.bot{
  background:#eef5f1;
  border-radius:15px 15px 15px 4px;
}

.user{
  background:var(--green);
  color:#fff;
  margin-left:auto;
  border-radius:15px 15px 4px 15px;
}

.composer{
  display:flex;
  gap:8px;
  border-top:1px solid var(--line);
  padding-top:12px;
}

.composer input{
  flex:1;
  min-width:0;
  border:1px solid #c9d8d1;
  border-radius:11px;
  padding:13px;
  font-size:16px;
}

.composer button{
  border:0;
  border-radius:11px;
  background:var(--green);
  color:#fff;
  padding:0 18px;
  font-weight:900;
}

@media(max-width:850px){
  .workspace{grid-template-columns:1fr}
  .chat{min-height:500px}
  #messages{min-height:360px}
}

/* CLEAN PART CARDS V2 */

.file{
  background:#fff;
  border:1px solid #dfe8e3;
  border-radius:12px;
  padding:11px 12px;
  box-shadow:none;
}

.file-name{
  font-size:13.5px;
  font-weight:800;
  line-height:1.3;
}

.meta{
  font-size:12px;
  color:#708078;
  line-height:1.45;
  margin-top:6px;
}

.status{
  font-size:10px;
  padding:4px 7px;
}

.part-number{
  color:#075b42;
  font-size:11px;
  font-weight:900;
  margin-bottom:4px;
}

.missing-row{
  margin-top:7px;
  display:flex;
  gap:5px;
  flex-wrap:wrap;
}

.missing-chip{
  font-size:10px;
  background:#fff0cf;
  color:#855700;
  padding:4px 7px;
  border-radius:999px;
}

.bubble{
  font-size:14px;
  line-height:1.4;
  padding:11px 13px;
}

.bot{
  max-width:88%;
}

.user{
  max-width:82%;
}

@media(max-width:600px){
  .panel{padding:12px}
  .panel h2{font-size:18px}
  .file-name{font-size:13px}
  .bubble{font-size:13.5px}
}


/* CYCLEFAB MOBILE-FIRST V10 */

html,body{
  width:100%;
  max-width:100%;
  overflow-x:hidden !important;
}

main{
  width:100%;
  max-width:1180px;
}

.workspace{
  width:100%;
  min-width:0;
}

.panel{
  width:100%;
  min-width:0;
  overflow:hidden;
}

#fileList,
#messages{
  width:100%;
  min-width:0;
}

.file{
  width:100%;
  min-width:0;
  overflow:hidden;
}

.file-top{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  align-items:start;
}

.file-name{
  width:100%;
  min-width:0;
  font-size:13px;
  line-height:1.3;
  overflow-wrap:anywhere !important;
  word-break:break-word !important;
}

.meta{
  font-size:12px;
  line-height:1.45;
}

.bubble{
  width:auto;
  max-width:90%;
  overflow-wrap:anywhere;
  word-break:break-word;
}

.composer{
  width:100%;
  display:grid;
  grid-template-columns:minmax(0,1fr) 56px;
  gap:8px;
}

.composer input{
  width:100%;
  min-width:0;
}

.composer button{
  width:56px;
  min-width:56px;
}

@media(max-width:600px){

  main{
    padding:14px 10px 40px;
  }

  .intro h1{
    font-size:30px;
  }

  .intro p{
    font-size:14px;
  }

  .workspace{
    display:block;
  }

  .panel{
    padding:12px;
    border-radius:16px;
    margin-bottom:14px;
  }

  .panel h2{
    font-size:18px;
    margin-bottom:14px;
  }

  .file{
    padding:10px;
    border-radius:10px;
  }

  .file-name{
    font-size:12.5px;
  }

  .meta{
    font-size:11.5px;
  }

  .status{
    font-size:9px;
  }

  .bubble{
    max-width:94%;
    font-size:13px;
    padding:10px 11px;
  }

  #messages{
    min-height:220px;
    max-height:380px;
  }
}


/* NUMBERED CHAT LIST */
.bot{
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  word-break:normal;
}

@media(max-width:600px){
  .bot{
    font-size:13px;
    line-height:1.5;
  }
}

/* STRUCTURED MISSING PARTS V14 */

.missing-list{
  display:grid;
  gap:14px;
}

.missing-item{
  display:grid;
  grid-template-columns:24px minmax(0,1fr);
  gap:8px;
  align-items:start;
}

.missing-number{
  font-weight:900;
  color:#075b42;
}

.missing-name{
  font-weight:700;
  overflow-wrap:anywhere;
  word-break:break-word;
  line-height:1.35;
}

.missing-fields{
  margin-top:3px;
  font-size:12px;
  color:#6f7f77;
  line-height:1.4;
}

.missing-example{
  margin-top:16px;
  padding-top:12px;
  border-top:1px solid #dce7e1;
  font-size:12.5px;
  color:#51635b;
}


/* COMPACT MISSING LIST V15 */

.missing-list{
  display:flex !important;
  flex-direction:column;
  gap:8px !important;
}

.missing-item{
  display:flex !important;
  align-items:flex-start !important;
  gap:8px !important;
  min-height:0 !important;
  margin:0 !important;
  padding:8px 0 !important;
}

.missing-item > div:last-child{
  flex:1;
  min-width:0;
}

.missing-number{
  flex:0 0 24px;
  margin:0 !important;
  padding:0 !important;
  line-height:1.35;
}

.missing-name{
  margin:0 !important;
  padding:0 !important;
  line-height:1.35 !important;
  font-size:13px;
}

.missing-fields{
  margin:3px 0 0 !important;
  padding:0 !important;
  line-height:1.3 !important;
  font-size:11.5px;
}

.missing-example{
  margin-top:10px !important;
  padding-top:9px !important;
}


/* FINAL CUSTOMER APPROVAL */

.approval-title{
  font-weight:900;
  font-size:16px;
  margin-bottom:3px;
}

.approval-sub{
  color:#687971;
  font-size:12px;
  margin-bottom:12px;
}

.approval-part{
  display:grid;
  grid-template-columns:25px minmax(0,1fr);
  gap:7px;
  padding:9px 0;
  border-top:1px solid #dbe6e0;
}

.approval-number{
  font-weight:900;
  color:#076347;
}

.approval-data{
  min-width:0;
}

.approval-data strong{
  display:block;
  font-size:12.5px;
  line-height:1.35;
  overflow-wrap:anywhere;
  margin-bottom:4px;
}

.approval-data span{
  display:inline-block;
  font-size:11.5px;
  color:#65766e;
  margin-right:8px;
}

.approval-actions{
  display:flex;
  gap:8px;
  margin-top:12px;
}

.approval-actions button{
  border:0;
  border-radius:9px;
  padding:10px 12px;
  font-weight:800;
}

#cfApprove{
  background:#076347;
  color:#fff;
}

#cfModify{
  background:#e7efeb;
  color:#164637;
}
